:root {
  --bg: #121414; --panel: #1a1d1d; --panel-2: #202424; --line: #2a2f2f; --line-2: #343a3a;
  --text: #e9eeec; --muted: #9aa5a2; --faint: #6c7774;
  --accent: #5fe0c1; --accent-dim: rgba(95,224,193,.14);
  --crit: #e5545a; --high: #e8b44e; --med: #7f9cf5; --low: #6fbf8a; --none: #6c7774;
  --pink: #e05aa0; --violet: #a68bf5;
  --radius: 12px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6f5; --panel: #ffffff; --panel-2: #f0f3f2; --line: #e1e6e4; --line-2: #d3dad7;
  --text: #16201d; --muted: #586662; --faint: #86928e; --accent: #0f9e7e; --accent-dim: rgba(15,158,126,.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .faint { color: var(--faint); }

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 20px 22px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; border-bottom: 1px solid var(--line); }
.brand span { color: var(--accent); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: .02em; margin-top: 2px; }
.nav-group { padding: 14px 12px; border-bottom: 1px solid var(--line); }
.nav-group h4 { margin: 0 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--panel-2); border-color: var(--line-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); z-index: 5; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs b { overflow: hidden; text-overflow: ellipsis; }
.topbar .btn, .topbar .sync { flex-shrink: 0; }
.crumbs b { color: var(--text); font-weight: 500; }
.topbar .spacer { flex: 1; }
.sync { font-size: 12px; color: var(--faint); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 9px; cursor: pointer; color: var(--muted); }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn svg { width: 15px; height: 15px; }
.btn kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--faint); }
.btn.primary { background: var(--accent-dim); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.btn:disabled { opacity: .6; cursor: progress; }

.page { padding: 26px 22px 40px; max-width: 1500px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 20px; color: var(--muted); font-size: 15px; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.kpi { padding: 16px 18px; border-right: 1px solid var(--line); position: relative; cursor: pointer; }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--panel-2); }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 32px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--faint); }
.kpi .icon { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.kpi .icon svg { width: 15px; height: 15px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-top: 16px; }
.grid-main > * { min-width: 0; } /* let columns shrink to the screen instead of their contents */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0; font-size: 19px; font-weight: 600; }
.card h3 { margin: 0 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--faint); font-size: 11px; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.tooltip { position: absolute; pointer-events: none; background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; font-size: 12px; min-width: 170px; box-shadow: 0 8px 24px rgba(0,0,0,.35); display: none; z-index: 3; }
.tooltip b { display: block; margin-bottom: 4px; font-size: 13px; }
.tooltip div { display: flex; justify-content: space-between; gap: 14px; }

.pipe { margin: 0; padding: 0; list-style: none; }
.pipe li { margin-bottom: 14px; }
.pipe .row { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.pipe .row span:first-child { color: var(--muted); }
.pipe .row code { font: 11px var(--mono); color: var(--accent); margin-right: 6px; }
.bar { height: 7px; border-radius: 6px; background: var(--panel-2); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), var(--accent)); }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { flex: 1; list-style: none; margin: 0; padding: 0; }
.donut-legend li { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; cursor: pointer; }
.donut-legend li:hover { color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--panel-2); }
.cve-id { font: 13px var(--mono); color: var(--accent); white-space: nowrap; }
.cve-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }
.cve-prod { font-size: 12px; color: var(--faint); margin-top: 2px; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; border: 1px solid; white-space: nowrap; margin: 0 4px 3px 0; }
.sev-CRITICAL { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.sev-HIGH { color: var(--high); border-color: color-mix(in srgb, var(--high) 45%, transparent); background: color-mix(in srgb, var(--high) 12%, transparent); }
.sev-MEDIUM { color: var(--med); border-color: color-mix(in srgb, var(--med) 45%, transparent); background: color-mix(in srgb, var(--med) 12%, transparent); }
.sev-LOW { color: var(--low); border-color: color-mix(in srgb, var(--low) 45%, transparent); background: color-mix(in srgb, var(--low) 12%, transparent); }
.sev-NONE { color: var(--none); border-color: var(--line-2); }
.chip.owasp { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-dim); }
.chip.nist { color: var(--muted); border-color: var(--line-2); font-family: var(--mono); font-weight: 500; }
.chip.ai { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.chip.zd { color: #fff; background: var(--crit); border-color: var(--crit); }
.exp { white-space: nowrap; font-size: 13px; }
.exp.active { color: var(--crit); } .exp.poc { color: var(--high); } .exp.none { color: var(--faint); }
.score { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input[type=search], .filters select { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 9px; padding: 8px 10px; font: inherit; }
.filters input[type=search] { min-width: 280px; flex: 1; }
.filters label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 9px; cursor: pointer; }
.filters label:has(input:checked) { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-dim); }
.result-count { color: var(--faint); font-size: 13px; margin-left: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; cursor: pointer; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tile .tid { font: 12px var(--mono); color: var(--accent); }
.tile h4 { margin: 4px 0 10px; font-size: 15px; font-weight: 600; }
.tile .nums { display: flex; gap: 18px; }
.tile .nums b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.tile .nums span { font-size: 12px; color: var(--faint); }
.tile .foot { margin-top: 10px; font-size: 12px; color: var(--faint); }

.hbar { display: grid; grid-template-columns: 210px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; font-size: 13px; }
.hbar:hover .hlabel { color: var(--accent); }
.hbar .hlabel { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; }

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--panel); border-left: 1px solid var(--line-2); z-index: 21; overflow-y: auto; transform: translateX(100%); transition: transform .18s ease; padding: 22px 24px 40px; }
.drawer.open { transform: none; } .drawer-bg.open { display: block; }
.drawer h2 { margin: 6px 0 4px; font: 600 20px var(--mono); color: var(--accent); }
.drawer section { border-top: 1px solid var(--line); padding: 14px 0; }
.drawer section h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; word-break: break-word; }
.close { position: absolute; top: 16px; right: 16px; }

.notice { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: 13px; margin-top: 16px; }
.notice code { font-family: var(--mono); color: var(--text); }
.empty { padding: 40px; text-align: center; color: var(--faint); }
.more { display: block; margin: 14px auto 0; }
footer.site { padding: 18px 22px 30px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); }

@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(3) { border-right: 0; } .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .sync, .btn kbd { display: none; } }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .kpis { grid-template-columns: repeat(2, 1fr); } .hide-sm { display: none; } .hbar { grid-template-columns: 130px 1fr 50px; } }

.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--faint); margin-bottom: 3px; }
.news-meta .chip { margin: 0; font-size: 10px; padding: 1px 5px; }
.news-title { color: var(--text); font-weight: 500; line-height: 1.35; }
.news-title:hover { color: var(--accent); }
.news-cves { margin-top: 6px; }
button.chip { cursor: pointer; font-family: var(--mono); }
.chart svg path { transition: fill-opacity .15s; }
.chart svg path[data-cc]:hover { stroke: var(--text); }

/* static, crawlable pages (home summary before JS, /about/, /agents/) */
.static { max-width: 860px; }
.static h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -.01em; }
.static h2 { font-size: 19px; margin: 28px 0 8px; }
.static h3 { font-size: 15px; margin: 18px 0 6px; }
.static p, .static li { color: var(--muted); font-size: 15px; line-height: 1.6; }
.static strong { color: var(--text); }
.static ul { padding-left: 20px; }
.static code { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.static .status { display: inline-block; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-dim); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.static .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.static .cards a { display: block; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.static .cards a:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); text-decoration: none; }
.static .cards a span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.static details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.static summary { cursor: pointer; font-weight: 600; color: var(--text); }
.simple-head { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.simple-head .brand { border: 0; padding: 0; }
.simple-head nav { margin-left: auto; display: flex; gap: 16px; font-size: 14px; }
.simple-head nav a { color: var(--muted); }
.simple-page { padding: 28px 22px 48px; }

/* phones: keep everything inside the screen, top bar on one line */
@media (max-width: 800px) {
  .page { padding: 18px 14px 32px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .crumbs > a, .crumbs > svg { display: none; }
  #searchBtn { padding: 7px 10px; }
  .card { padding: 14px; }
  .card table { display: block; overflow-x: auto; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .kpi .value { font-size: 26px; }
  .seg { flex-wrap: wrap; }
  .filters select { max-width: 100%; }
}
