:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --line: #e2e5ea;
  --accent: #2f5bd3;
  --accent-soft: #e7edfb;
  --crit: #b3122e;
  --high: #d4570f;
  --med: #b58500;
  --low: #2c7a4b;
  --na: #7b8492;
  --kev: #7a1fa2;
  --cal: 47, 91, 211;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --panel: #1a1e24;
    --text: #e6e9ee;
    --muted: #9aa3b0;
    --line: #2b313a;
    --accent: #7c9cf5;
    --accent-soft: #232c45;
    --crit: #ff5c72;
    --high: #ff8a3d;
    --med: #e2b53c;
    --low: #4cc27e;
    --na: #8a93a1;
    --kev: #c27dee;
    --cal: 124, 156, 245;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 8px; }

.top {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: block; border-radius: 6px; }
.search { flex: 1; max-width: 520px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }
.wrap.narrow { max-width: 900px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg a { padding: 5px 12px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.datenav { display: flex; gap: 6px; align-items: center; }
.datenav input[type=date] {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font: inherit;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text);
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.sm { min-width: 28px; padding: 2px 8px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.side { position: sticky; top: 70px; display: grid; gap: 16px; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
}

.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count { color: var(--muted); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; align-items: center; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.chip {
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-size: 13.5px; white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip b { font-weight: 600; color: var(--muted); margin-left: 2px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-critical.on { border-color: var(--crit); color: var(--crit); }
.chip-high.on { border-color: var(--high); color: var(--high); }
.chip-medium.on { border-color: var(--med); color: var(--med); }
.chip-low.on { border-color: var(--low); color: var(--low); }
.chip-kev.on { border-color: var(--kev); color: var(--kev); }

.cves { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cve {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--na); border-radius: var(--radius);
  padding: 10px 14px; position: relative;
}
.cve:hover { border-color: var(--accent); }
.sevline-critical { border-left-color: var(--crit); }
.sevline-high { border-left-color: var(--high); }
.sevline-medium { border-left-color: var(--med); }
.sevline-low { border-left-color: var(--low); }
.cve-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cve .id { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cve .id::after { content: ""; position: absolute; inset: 0; }
.cve time { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.prod { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.desc {
  margin: 4px 0 0; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.sev { font-size: 12.5px; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--na); white-space: nowrap; }
.sev b { font-variant-numeric: tabular-nums; }
.sev-critical { background: var(--crit); }
.sev-high { background: var(--high); }
.sev-medium { background: var(--med); }
.sev-low { background: var(--low); }
@media (prefers-color-scheme: dark) { .sev { color: #111418; } }
.tag {
  font-size: 12px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.tag.sm { font-size: 11px; padding: 0 6px; }
.tag-kev { border-color: var(--kev); color: var(--kev); font-weight: 600; }
.tag-ransom { border-color: var(--crit); color: var(--crit); font-weight: 600; }

.empty { color: var(--muted); padding: 30px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; color: var(--muted); }

.cal, .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.cal-head > a:not(.btn) { color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.cal-grid a {
  position: relative; aspect-ratio: 1; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text); font-size: 12px; line-height: 1.1;
  background: rgba(var(--cal), calc(0.06 + var(--fill) * 0.5));
  border: 1px solid transparent;
}
.cal-grid a:hover { text-decoration: none; border-color: var(--accent); }
.cal-grid a.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-grid a.today .dn { font-weight: 800; text-decoration: underline; }
.cal-grid a.future { opacity: 0.35; }
.cal-grid .dc { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-grid .dot { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--crit); }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.box p { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.feeds { margin: 0; padding-left: 18px; font-size: 14px; }

.detail-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 4px; }
.detail-head .sev { font-size: 14px; padding: 2px 10px; }
.meta { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
main section { margin: 0 0 22px; }
.desc-full { font-size: 15.5px; margin: 0; white-space: pre-line; }
#tr-toggle { white-space: nowrap; }
#tr-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
[data-tr].pending { opacity: 0.55; }
.kev-box { border-color: var(--kev); }
.kev-box h2 { color: var(--kev); }
.kev-box p { color: var(--text); }
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pills li a { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13.5px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.refs { padding-left: 18px; margin: 0; font-size: 13.5px; }
.refs li { margin-bottom: 4px; overflow-wrap: anywhere; }
.refs .tag { margin-left: 4px; }

.foot { max-width: 1240px; margin: 20px auto; padding: 0 16px 20px; color: var(--muted); font-size: 12.5px; }
.foot .warn { color: var(--crit); font-weight: 600; }

@media (max-width: 600px) {
  .top { flex-wrap: wrap; gap: 8px; }
  .search { max-width: none; flex-basis: 100%; }
  .controls { justify-content: flex-start; }
  .seg { overflow-x: auto; max-width: 100%; }
  .cve time { margin-left: 0; width: 100%; }
}
