:root {
  --bg: #f7f7f8; --panel: #ffffff; --text: #1d1d20; --muted: #6b6b75;
  --border: #e2e2e7; --hover: #f1f1f4; --accent: #2f5bd3;
  --crit-bg: #fde3e3; --crit-fg: #a11919; --high-bg: #feebd6; --high-fg: #9a4a00;
  --known-fg: #a11919;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141417; --panel: #1c1c20; --text: #e9e9ee; --muted: #9a9aa6;
    --border: #2e2e35; --hover: #25252b; --accent: #8aa8ff;
    --crit-bg: #4a1717; --crit-fg: #ffb3b3; --high-bg: #45290c; --high-fg: #ffc98f;
    --known-fg: #ff9a9a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
       background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.muted { color: var(--muted); }

header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
         flex-wrap: wrap; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
         background: var(--panel); }
h1 { font-size: 1.25rem; margin: 0 0 .2rem; }
header p { margin: 0; }
.src { font-size: 12px; }

#view-cves { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem 1.5rem; }
@media (max-width: 860px) { #view-cves { grid-template-columns: 1fr; } }

aside { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
        padding: 1rem; align-self: start; position: sticky; top: 1rem; }
.f { margin: 0 0 .9rem; border: 0; padding: 0; min-width: 0; }
.f > label, legend { display: block; font-weight: 600; font-size: 12px; text-transform: uppercase;
                     letter-spacing: .03em; color: var(--muted); margin-bottom: .3rem; padding: 0; }
input, select, button { font: inherit; color: inherit; }
input[type=search], input[type=number], input[type=date], select {
  width: 100%; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); min-width: 0; }
.row { display: flex; align-items: center; gap: .4rem; }
.chk { display: inline-flex; align-items: center; gap: .3rem; margin-right: .8rem; cursor: pointer; }
.presets { display: flex; gap: .3rem; margin-bottom: .4rem; }
button { border: 1px solid var(--border); background: var(--bg); border-radius: 6px;
         padding: .3rem .6rem; cursor: pointer; }
button:hover:not(:disabled) { background: var(--hover); }
button:disabled { opacity: .45; cursor: default; }
button.active { border-color: var(--accent); color: var(--accent); }
button.secondary { width: 100%; }

#results { min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.toolbar p { margin: 0; }
.toolbar select { width: auto; margin-left: .3rem; }
.tablewrap { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer;
     user-select: none; position: sticky; top: 0; background: var(--panel); }
th:hover { color: var(--text); }
th.sorted::after { content: " ▾"; }
th.sorted.asc::after { content: " ▴"; }
td { white-space: nowrap; }
td.wide { white-space: normal; min-width: 260px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.cve { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.empty { text-align: center; padding: 2rem; color: var(--muted); cursor: default; }

.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.CRITICAL { background: var(--crit-bg); color: var(--crit-fg); }
.badge.HIGH { background: var(--high-bg); color: var(--high-fg); }
.known { color: var(--known-fg); font-weight: 600; }
.overdue { color: var(--muted); }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .8rem; }

dialog { width: min(820px, 94vw); max-height: 88vh; border: 1px solid var(--border); border-radius: 12px;
         padding: 0; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.dhead { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem;
         border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.dhead h2 { margin: 0; font-size: 1.1rem; }
.close { font-size: 1.3rem; line-height: 1; border: 0; background: none; }
#d-body { padding: 1rem 1.2rem 1.4rem; }
#d-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 1.2rem 0 .4rem; }
#d-body p { margin: .3rem 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
ul.refs { padding-left: 1.1rem; margin: .3rem 0; }
ul.refs li { margin: .2rem 0; word-break: break-all; }
.tag { display: inline-block; font-size: 11px; border: 1px solid var(--border); border-radius: 4px;
       padding: 0 .3rem; margin-left: .3rem; color: var(--muted); word-break: normal; }

/* let vendor/product wrap so all columns fit on typical screens */
#view-cves td.vp { white-space: normal; min-width: 90px; max-width: 170px; }
td.wide { min-width: 220px; }

/* ------------------------------------------------------------ tabs */
.tabs { display: flex; gap: .25rem; align-self: flex-end; margin-bottom: -1rem; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
               padding: .55rem .9rem; font-weight: 600; color: var(--muted); }
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ analytics */
:root {
  --sev-crit: #1c5cab; --sev-high: #86b6ef;          /* ordinal blue, validated */
  --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b;
  --grid: #e1e0d9; --axis: #c3c2b7;
}
@media (prefers-color-scheme: dark) {
  :root { --sev-crit: #6da7ec; --sev-high: #184f95; --grid: #2c2c2a; --axis: #383835; }
}
#view-analytics { padding: 1.25rem 1.5rem; display: grid; gap: 1.25rem; max-width: 1200px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
.card h2, h2.sect { font-size: 15px; margin: 0; }
h2.sect { margin-bottom: .6rem; }
.sub { margin: .15rem 0 0; font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
             flex-wrap: wrap; margin-bottom: .8rem; }
.foot { font-size: 12px; margin: .5rem 0 0; }

.status { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: start; }
.status .icon { font-size: 18px; line-height: 1.3; font-weight: 700; }
.status .icon.good { color: var(--st-good); } .status .icon.warn { color: var(--st-warn); }
.status .icon.crit { color: var(--st-crit); }
.status .headline { font-size: 15px; font-weight: 600; margin: 0; }
.status .lines { grid-column: 2; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.status .lines li { margin: .15rem 0; }
.status .lines strong { color: var(--text); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem; }
.kpi .label { font-size: 13px; color: var(--muted); margin: 0; }
.kpi .value { font-size: 30px; font-weight: 600; margin: .15rem 0 .35rem; line-height: 1.1; }
.kpi .split { display: flex; gap: 1rem; font-size: 13px; color: var(--muted); margin: 0; }
.kpi .split strong { color: var(--text); font-weight: 600; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem;
      vertical-align: -1px; }
.sw.crit { background: var(--sev-crit); } .sw.high { background: var(--sev-high); }

.legend { display: flex; gap: 1rem; font-size: 13px; color: var(--muted); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .cap { fill: var(--text); font-size: 11px; font-weight: 600; }
.chart .seg-crit { fill: var(--sev-crit); } .chart .seg-high { fill: var(--sev-high); }
.chart .col { cursor: default; outline: none; }
.chart .col.link { cursor: pointer; }
.chart .col.link:hover .seg-crit, .chart .col.link:hover .seg-high { filter: brightness(1.12); }
.chart .col .hit { fill: transparent; }
.chart .col:hover .hit, .chart .col:focus .hit { fill: var(--hover); }
.chart .col:focus-visible .hit { stroke: var(--accent); stroke-width: 1; }
.tableview { margin-top: .6rem; font-size: 13px; }
.tableview summary { cursor: pointer; color: var(--accent); }
.tableview table { margin-top: .5rem; width: auto; min-width: 320px; }
.tableview td, .tableview th { padding: .3rem .8rem; cursor: default; }

.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--panel); color: var(--text);
       border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; font-size: 13px;
       box-shadow: 0 4px 16px rgb(0 0 0 / .15); min-width: 150px; }
.tip .t { color: var(--muted); margin-bottom: .25rem; }
.tip .r { display: flex; align-items: center; gap: .5rem; }
.tip .r b { min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.tip .key { width: 12px; height: 3px; border-radius: 2px; }

.tablewrap.flat { border: 0; border-radius: 0; }
table.runs th { cursor: default; }
table.runs tbody tr { cursor: default; }
table.runs td { font-variant-numeric: tabular-nums; }
table.runs td.det { white-space: normal; min-width: 220px; color: var(--muted); }
.res { font-weight: 600; } .res::before { margin-right: .3rem; }
.res.good::before { content: "✓"; color: var(--st-good); }
.res.crit::before { content: "✕"; color: var(--st-crit); }
.res.info::before { content: "↻"; color: var(--muted); }
.cvelink { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.status .visually-label { font-weight: 600; color: var(--muted); }

/* nicknames + enrichment */
.alias { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 4px; font: 600 11px/1.6 system-ui, sans-serif;
         border: 1px solid var(--accent); color: var(--accent); vertical-align: 1px; white-space: nowrap; }
.alias.big { font-size: 12px; vertical-align: 2px; }
.f.two { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.f.two label { display: block; font-weight: 600; font-size: 12px; text-transform: uppercase;
               letter-spacing: .03em; color: var(--muted); margin-bottom: .3rem; }
/* sticky sidebar must scroll on its own when taller than the window */
aside { max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 860px) { aside { position: static; max-height: none; } }
td.cve { white-space: nowrap; }
.aliases { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; max-width: 170px; white-space: normal; }
.aliases .alias { margin-left: 0; }

/* news + early warning */
.tabs .count { display: inline-block; min-width: 1.4em; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px;
               background: var(--crit-bg); color: var(--crit-fg); font-size: 11px; line-height: 1.6; text-align: center; }
.badge.MEDIUM, .badge.LOW, .badge.NONE { background: var(--hover); color: var(--muted); border: 1px solid var(--border); }
#view-early { padding: 1.25rem 1.5rem; display: grid; gap: .8rem; }
#view-early .intro h2 { font-size: 15px; margin: 0; }
#view-early .intro .sub { max-width: 900px; }
.toolbar.ew { flex-wrap: wrap; gap: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .2rem; }
table.ew td.wide { min-width: 240px; white-space: normal; }
td.headline a, .refs.news a { color: var(--text); text-decoration: none; }
td.headline a:hover, .refs.news a:hover { color: var(--accent); text-decoration: underline; }
.outlet { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); margin-right: .4rem;
          text-transform: uppercase; letter-spacing: .02em; }
.refs.news { list-style: none; padding-left: 0; }
.refs.news li { word-break: normal; margin: .35rem 0; }
.refs.news .when { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .5rem; font-size: 12px; }
.note { background: var(--hover); border-left: 3px solid var(--st-warn); padding: .5rem .7rem; border-radius: 4px; }
table.runs tr.click { cursor: pointer; }
table.runs tr.click:hover { background: var(--hover); }
.hotswitch { margin-right: 1rem; }
.hot { display: inline-block; margin-left: .3rem; padding: 0 .35rem; border-radius: 4px; font: 600 11px/1.6 system-ui, sans-serif;
       background: var(--crit-bg); color: var(--crit-fg); vertical-align: 1px; }
select:disabled { opacity: .5; }

/* logo */
.brand { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.brand .logo { height: 48px; width: auto; flex: none; }
@media (max-width: 860px) { .brand .logo { height: 30px; } }
header .src { margin-top: .15rem; }
aside { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* header right side: user in the top-right corner, tabs at the bottom */
header { position: relative; }
.hright { display: flex; flex-direction: column; align-items: flex-end; align-self: stretch; justify-content: flex-end; }
.session { position: absolute; top: .55rem; right: 1.5rem; font-size: 12px; display: flex; gap: .5rem; align-items: center;
           color: var(--muted); }
.session .user { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); }
.session .sep { color: var(--border); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; }
button.link:hover { text-decoration: underline; background: none; }

/* login page */
body.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
              padding: 2rem 1.8rem 1.6rem; box-shadow: 0 8px 30px rgb(0 0 0 / .08); }
.login-card .mark { display: block; margin: 0 auto .7rem; filter: drop-shadow(0 3px 8px rgb(28 79 174 / .3)); }
.login-card h1.wordmark { font-size: 2rem; text-align: center; margin: 0; }
.login-card .tagline { display: block; text-align: center; margin: .25rem 0 0; }
.login-card > p { text-align: center; margin: .2rem 0 1.4rem; }
.login-card input { width: 100%; padding: .55rem .6rem; border: 1px solid var(--border); border-radius: 6px;
                    background: var(--bg); font-size: 15px; }
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button.primary { width: 100%; padding: .6rem; margin-top: .4rem; border: 0; border-radius: 6px; font-weight: 600;
                 background: var(--accent); color: #fff; font-size: 15px; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
@media (prefers-color-scheme: dark) { button.primary { color: #0b0b0b; } }
.login-error { color: var(--crit-fg); background: var(--crit-bg); border-radius: 6px; padding: .5rem .7rem; margin: .2rem 0 .6rem; font-size: 13px; }
@media (max-width: 860px) { header { padding-top: 2.1rem; } .session { top: .6rem; right: 1rem; } }

/* software inventory tab */
#view-software { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem 1.5rem; }
#view-software .sw-status { grid-column: 1 / -1; }
@media (max-width: 860px) { #view-software { grid-template-columns: 1fr; } }
#view-software aside { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
#sw-results { min-width: 0; }
.sw-status .headline { font-size: 15px; font-weight: 600; margin: 0 0 .3rem; }
.sw-status .headline strong { font-weight: 700; }
.sw-status .lines { margin: 0 0 .6rem; padding: 0; list-style: none; color: var(--muted); }
.sw-status .lines li { margin: .15rem 0; }
.sw-status .lines strong { color: var(--text); font-weight: 600; }
.sw-status code, .note code { font-size: 12.5px; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg label { flex: 1; text-align: center; padding: .35rem .2rem; cursor: pointer; font-size: 13px; border-right: 1px solid var(--border); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg label:has(input:checked) { color: #0b0b0b; } }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.small { font-size: 12px; }
td.vcell { white-space: normal; min-width: 180px; max-width: 300px; }
td .vlist { margin-top: .1rem; }
td.ver { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
#sw-table tbody tr { cursor: pointer; }
.chip { display: inline-block; margin: .1rem .15rem .1rem 0; padding: 0 .4rem; border: 1px solid var(--border); border-radius: 4px;
        font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.stale { color: var(--muted); border-style: dashed; }
a.plink { color: var(--text); text-decoration: none; }
a.plink:hover { color: var(--accent); text-decoration: underline; }

/* early warning: update status + rules */
.ew-status { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; margin-top: .7rem; font-size: 13px; }
.ew-status .icon { font-weight: 700; }
.ew-status .icon.good { color: var(--st-good); } .ew-status .icon.warn { color: var(--st-warn); }
.ew-status > span:last-child:not(:nth-child(2)) { flex-basis: 100%; padding-left: 1.2rem; }
.ew-rules ul { margin: .4rem 0 0; padding-left: 1.2rem; max-width: 900px; }
.ew-rules li { margin: .25rem 0; }
.tip .hint { margin-top: .35rem; padding-top: .3rem; border-top: 1px solid var(--border); color: var(--accent); font-size: 12px; }
th .qm { display: inline-block; width: 13px; height: 13px; line-height: 13px; border-radius: 50%; border: 1px solid var(--border);
         font-size: 9px; text-align: center; color: var(--muted); vertical-align: 1px; margin-left: .15rem; }

/* footer */
.site-footer { text-align: center; font-size: 12px; color: var(--muted); padding: 1.6rem 1rem 1.4rem;
               border-top: 1px solid var(--border); margin-top: 1rem; }
.site-footer .wink { font-style: italic; }
body.login-page { grid-template-rows: 1fr auto; }
body.login-page .site-footer { border-top: 0; margin-top: 0; padding-bottom: .4rem; align-self: end; }

/* Lucide icons (icons.svg sprite). Presentation must be set here: <use> doesn't inherit from the sprite. */
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.17em; flex: none;
      fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button .ic { width: 16px; height: 16px; margin-right: .3rem; vertical-align: -3px; opacity: .85; }
.tabs button[aria-selected="true"] .ic { opacity: 1; color: var(--accent); }
.session .user .ic { width: 18px; height: 18px; color: var(--muted); }
button.link .ic { width: 14px; height: 14px; vertical-align: -2px; }
.status .icon .ic, .ew-status .icon .ic { width: 20px; height: 20px; vertical-align: -4px; }
.status .icon { line-height: 1; padding-top: 1px; }
.hot .ic, .stale-tag .ic { width: 11px; height: 11px; margin-right: .2rem; vertical-align: -1px; }
/* keep logo/title and tabs on one row on wide screens; the title side shrinks and wraps instead */
@media (min-width: 1100px) {
  header { flex-wrap: nowrap; }
  header .brand { flex: 1 1 auto; min-width: 0; }
  header .hright { flex: none; }
}

/* Systrust product brand */
.wordmark { font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.wordmark span { color: var(--brand); }
.tagline { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
:root { --brand: #2f6fe0; }
@media (prefers-color-scheme: dark) { :root { --brand: #7aa5f5; } }
header .product { display: flex; align-items: center; gap: .6rem; flex: none; text-decoration: none; color: inherit;
                  padding-right: 1.1rem; border-right: 1px solid var(--border); align-self: stretch; }
header .product .mark { width: 44px; height: 44px; }
header .wordmark-wrap { display: flex; flex-direction: column; gap: .3rem; }
header .wordmark { font-size: 1.65rem; }
header .brand-text { min-width: 0; }
@media (max-width: 860px) {
  header .product .mark { width: 32px; height: 32px; }
  header .wordmark { font-size: 1.3rem; }
  header .tagline { display: none; }
}
@media (max-width: 600px) { header .brand { flex-wrap: wrap; } header .product { border-right: 0; } }
.login-card .for-org { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.4rem;
                       padding-top: 1.1rem; border-top: 1px solid var(--border); font-size: 12px; }
.login-card .for-org img { height: 30px; width: auto; }
.site-footer strong { color: var(--text); font-weight: 700; }
