/* Vestigit web profile (design system snapshot 1.0, 2026-10-28): dark surface, Inter,
   thin separators, no shadows or gradients. The logo keeps its own #2DAAE2; the UI
   accent is the separate web accent #27AAE2. Dependency-free; extend as screens grow. */
@font-face {
  font-family: "Inter";
  src: url("vendor/inter/InterVariable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #03090e; --panel: #09131c; --raised: #0e1b26;
  --fg: #ffffff; --text: #cad3dd; --muted: #8b96a1;
  --rule: #1b2d3a; --outline: #1b3b4b; --control: #5a7686;
  --accent: #27aae2; --on-accent: #03090e;
  --ok: #6fd8a4; --ok-bg: #0f2b1f; --warn: #f0b070; --warn-bg: #33230f;
  --bad: #ff9a8f; --bad-bg: #3a1418; --neutral: #b8c2cc; --neutral-bg: #18232d;
  --info: #7fcdf0; --info-bg: #0c2a3a;
  --overlay: rgba(3, 9, 14, .6);
  --radius: 12px;
  /* Categorical series of the overview charts, distinct on the dark panels. */
  --series-1: #27aae2; --series-2: #6fd8a4; --series-3: #f0b070; --series-4: #c49cf2;
  --series-5: #ff9a8f; --series-6: #f2d56b; --series-7: #5fd0d0; --series-8: #e888c8;
  /* Node kinds of the incident graph. */
  --node-incident: #ff9a8f; --node-signal: #f0b070; --node-token: #27aae2;
  --node-session: #7fcdf0; --node-network: #6fd8a4; --node-agent: #c49cf2;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
header.top { display: flex; gap: 1.5rem; align-items: center; padding: .75rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
header.top a { color: var(--text); text-decoration: none; }
header.top .brand { display: flex; gap: .75rem; align-items: center; color: var(--fg); font-weight: 600; letter-spacing: .01em; }
header.top .brand img { display: block; height: 28px; width: auto; }
header.top .brand span { padding-left: .75rem; border-left: 1px solid var(--outline); }
header.top nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; flex: 1; }
header.top nav a { padding: .25rem 0; border-bottom: 2px solid transparent; }
header.top nav a:hover { color: var(--fg); }
header.top nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
header.top .who { display: flex; gap: .75rem; align-items: center; margin: 0; color: var(--muted); font-size: .9rem; }
main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
h1, h2, h3 { color: var(--fg); font-weight: 600; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
strong, dt { color: var(--fg); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--outline); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:hover { background: var(--raised); }
table.evidence th { width: 40%; font-weight: 500; color: var(--muted); }
th.num, td.num { text-align: right; white-space: nowrap; }
dl.stats, dl.facts { display: grid; grid-template-columns: auto auto; gap: .35rem 1rem; margin: 0; }
dl.stats dt { color: var(--text); }
dl.stats dd { color: var(--fg); font-weight: 700; margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
dl.facts dd { margin: 0; }
form { display: grid; gap: .5rem; max-width: 520px; }
form.inline, form.filters, header.top form { display: flex; gap: .5rem; align-items: center; max-width: none; }
label { color: var(--fg); font-size: .9rem; }
input, select, textarea, button { font: inherit; padding: .4rem .65rem; border: 1px solid var(--control); border-radius: 6px; }
input, select, textarea { background: var(--bg); color: var(--fg); }
input[type="file"] { padding: .3rem; }
button { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; cursor: pointer; transition: filter .15s; }
button:hover { filter: brightness(1.12); }
a.button { display: inline-block; background: var(--accent); color: var(--on-accent); padding: .5rem .9rem; border-radius: 6px; font-weight: 600; text-decoration: none; transition: filter .15s; }
a.button:hover { filter: brightness(1.12); }
header.top button { background: transparent; color: var(--text); border-color: var(--control); font-weight: 500; }
header.top button:hover { color: var(--fg); border-color: var(--accent); }
.alert { color: var(--bad); }
.status, .job { padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 500; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.status-new, .job-failed { background: var(--bad-bg); color: var(--bad); }
.status-acknowledged, .status-investigating { background: var(--warn-bg); color: var(--warn); }
.job-running { background: var(--info-bg); color: var(--info); }
.status-resolved, .job-completed { background: var(--ok-bg); color: var(--ok); }
/* Window ledger (ADR 0023): states of a window and the coverage strip. */
.job-queued { background: var(--info-bg); color: var(--info); }
.job-analyzed, .job-no_data { background: var(--ok-bg); color: var(--ok); }
.job-skipped { background: var(--warn-bg); color: var(--warn); }
.coverage { display: flex; flex-wrap: wrap; gap: 2px; margin: .5rem 0; }
.cell { display: inline-block; width: 10px; height: 18px; border-radius: 2px; background: var(--neutral-bg); vertical-align: middle; }
.cell-analyzed { background: var(--ok); }
.cell-no_data { background: var(--ok-bg); outline: 1px solid var(--ok); outline-offset: -1px; }
.cell-queued { background: var(--info-bg); outline: 1px solid var(--info); outline-offset: -1px; }
.cell-running { background: var(--info); }
.cell-skipped { background: var(--warn); }
.cell-failed { background: var(--bad); }
.legend { font-size: .8rem; color: var(--muted); }
.legend .cell { margin-left: .6rem; }
.status-false_positive { background: var(--neutral-bg); color: var(--neutral); }
.history { padding-left: 1.2rem; }
.signal { border-top: 1px solid var(--rule); padding-top: .75rem; }
code { font-family: "Liberation Mono", "Nimbus Mono PS", ui-monospace, monospace; font-size: .85em; color: var(--fg); }
/* ClickHouse window selection (ADR 0014); htmx's own indicator styles are disabled by the CSP. */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
button.secondary { background: transparent; color: var(--text); border-color: var(--control); font-weight: 500; }
button.secondary:hover { color: var(--fg); border-color: var(--accent); }
form.windows, form.range { max-width: none; margin-top: 1rem; }
.scroll { overflow-x: auto; }
table.availability th, table.availability td { padding: .25rem; text-align: center; }
table.availability tbody th { color: var(--muted); font-weight: 500; }
table.availability button { width: 100%; min-width: 3.2rem; padding: .25rem .3rem; font-size: .8rem; font-weight: 500; }
table.availability button.over { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* Triage view (ADR 0024): processing strip, histogram, grid with a preview pane. */
.pipeline { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; margin: 0 0 1rem; padding: .6rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); font-size: .88rem; }
.pipeline .warn { color: var(--warn); }
.lag { padding: .1rem .55rem; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); }
.lag-ok { background: var(--ok-bg); color: var(--ok); }
.lag-warn { background: var(--warn-bg); color: var(--warn); }
.lag-bad { background: var(--bad-bg); color: var(--bad); }
.range { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.spans a { margin-left: .6rem; }
.spans a[aria-current] { color: var(--fg); font-weight: 600; text-decoration: none; }
.counts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.counts a.status { text-decoration: none; }
.chip { padding: .1rem .5rem; border-radius: 999px; background: var(--raised); font-size: .8rem; }
.histogram { display: block; width: 100%; height: 120px; margin-top: .5rem; }
.histogram .slot { fill: transparent; }
.histogram a:hover .slot, .histogram a:focus .slot { fill: var(--raised); }
.seg-new { fill: var(--bad); }
.seg-acknowledged, .seg-investigating { fill: var(--warn); }
.seg-resolved { fill: var(--ok); }
.seg-false_positive { fill: var(--neutral); }
.axis { display: flex; justify-content: space-between; gap: .5rem; margin: .2rem 0 0; font-size: .78rem; color: var(--muted); }
.triage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.triage aside { position: sticky; top: 1rem; }
@media (max-width: 900px) { .triage { grid-template-columns: minmax(0, 1fr); } .triage aside { position: relative; } }
table.incident-grid tr.selected td { background: var(--raised); }
.risk-high { color: var(--bad); font-weight: 600; }
.signals { padding-left: 1.1rem; }
.signals li { margin-bottom: .4rem; }
#preview { min-width: 0; overflow-wrap: anywhere; }
/* ECharts island (static/triage.js): the chart replaces the SVG bars once it is drawn. */
.chart { display: none; width: 100%; height: 170px; margin-top: .5rem; }
#histogram.charted .chart { display: block; }
#histogram.charted .histogram { display: none; }
/* Overview (ADR 0024): key figures, trend charts with table fallbacks, hourly coverage. */
.figures { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.figure { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; }
a.figure:hover { border-color: var(--accent); }
.figure .label { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.figure .value { font-size: 1.8rem; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.2; }
.figure .sub { font-size: .8rem; color: var(--muted); }
.figure-bad { border-color: var(--bad-bg); }
.figure-bad .value { color: var(--bad); }
.overview-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 1rem; align-items: start; }
#signals-chart, #incidents-chart { height: 210px; }
@media (max-width: 480px) { .overview-charts { grid-template-columns: minmax(0, 1fr); } }
.chart-frame.charted .chart { display: block; }
.chart-frame.charted .fallback { display: none; }
table.heatmap { width: auto; border-collapse: separate; border-spacing: 2px; font-size: .75rem; }
table.heatmap th, table.heatmap td { padding: 0; border: 0; }
table.heatmap thead th { min-width: 14px; text-align: left; letter-spacing: 0; }
table.heatmap tbody th { padding-right: .4rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.heat { display: inline-block; width: 14px; height: 14px; border-radius: 2px; vertical-align: middle; }
td.heat { display: table-cell; }
.heat-out { background: transparent; }
.heat-empty { background: var(--neutral-bg); }
.heat-done { background: var(--ok); }
.heat-wait { background: var(--info); }
.heat-bad { background: var(--bad); }
.legend .heat { margin-left: .6rem; }
/* Saved views (ADR 0024): a strip of the owner's views and a form to save the current one. */
.saved-views { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin: -.4rem 0 1rem; font-size: .88rem; }
.saved-views a.chip { color: var(--text); text-decoration: none; }
.saved-views a.chip:hover { color: var(--fg); }
.chip-start { outline: 1px solid var(--accent); outline-offset: -1px; }
.saved-views details { flex-basis: 100%; }
.saved-views summary { cursor: pointer; color: var(--accent); }
form.wrap { flex-wrap: wrap; margin-top: .5rem; }
/* Incident graph (ADR 0024): Cytoscape.js island over the tables of its nodes. */
/* position: relative is the one rule Cytoscape.js would otherwise inject inline. */
.graph { display: none; position: relative; width: 100%; height: 420px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); }
.graph-frame.charted .graph { display: block; }
.graph-frame:not(.charted) .graph-legend { display: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: .6rem; vertical-align: middle; }
.dot-incident { background: var(--node-incident); }
.dot-signal { background: var(--node-signal); }
.dot-token { background: var(--node-token); }
.dot-session { background: var(--node-session); }
.dot-network { background: var(--node-network); }
.dot-agent { background: var(--node-agent); }
.graph-tables { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.graph-tables h3 { margin: .5rem 0; }
/* Incident clients (ADR 0030): digests, User-Agents and record handles wrap anywhere. */
.client-tables > section { min-width: 0; }
.client-tables td:first-child { overflow-wrap: anywhere; }
/* Data table (partials/table.html): order by a column header, the filter row and the
   selection shown by the toggles at the right of the header (static/table.js), pager. */
th a.sort { color: inherit; text-decoration: none; }
th a.sort:hover { color: var(--fg); }
th[aria-sort="ascending"] a.sort, th[aria-sort="descending"] a.sort { color: var(--fg); }
/* In a narrow table (the grid of triage beside its preview) the bounds stack. */
.filter-row td { padding-top: .25rem; white-space: normal; }
.filter-row input[type="number"] { width: 4.4rem; padding: .25rem .4rem; margin-bottom: .2rem; }
.filter-row select, .filter-row button { padding: .25rem .5rem; }
.filter-row select { max-width: 8.5rem; }
table.incident-list td:first-child a, table.incident-grid td:first-child a { white-space: nowrap; }
th.pick, td.pick { width: 1.5rem; padding-right: 0; }
th.tools, td.tools { width: 1%; padding-left: 0; text-align: right; white-space: nowrap; }
button.icon { display: inline-flex; padding: .2rem .3rem; background: transparent; color: var(--muted); border-color: transparent; font-weight: 500; vertical-align: middle; }
button.icon:hover { color: var(--fg); border-color: var(--control); }
button.icon[aria-pressed="true"] { color: var(--fg); border-color: var(--control); }
button.icon.active { color: var(--accent); }
.data-table:not([data-show-filters]) .filter-row,
.data-table:not([data-show-select]) .pick,
.data-table:not([data-show-select]) .table-select { display: none; }
form.bulk { margin-bottom: .75rem; flex-wrap: wrap; }
.pager { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; margin-top: .75rem; font-size: .9rem; }
.pager .pages { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.pager .pages a[aria-current] { color: var(--fg); font-weight: 600; text-decoration: none; }
.pager .gap { color: var(--muted); }
.pager .page-size { margin-left: auto; color: var(--muted); }
.pager .page-size select { margin-left: .4rem; padding: .2rem .4rem; }
.notice { color: var(--info); }
/* The error of an htmx request inside the element that asked (static/page.js). */
.problem { padding: .6rem .9rem; border: 1px solid var(--bad-bg); border-radius: 8px; background: var(--bad-bg); color: var(--bad); }
.problem p { margin: .2rem 0; }
.problem button { margin-right: .4rem; }
/* Loading overlay: an element marked data-loading is covered by a translucent layer with a
   spinner while htmx (re)loads it (htmx sets htmx-request on it, or on the element its
   hx-indicator names). It appears after 200 ms, so quick answers do not flash. */
[data-loading] { position: relative; }
[data-loading].htmx-request::before { content: ""; position: absolute; inset: 0; z-index: 10; background: var(--overlay); border-radius: inherit; opacity: 0; animation: ott-appear 0s linear .2s forwards; }
[data-loading].htmx-request::after { content: ""; position: absolute; z-index: 11; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid var(--outline); border-top-color: var(--accent); border-radius: 50%; opacity: 0; animation: ott-appear 0s linear .2s forwards, ott-spin .8s linear .2s infinite; }
@keyframes ott-appear { to { opacity: 1; } }
@keyframes ott-spin { to { transform: rotate(360deg); } }
/* Without motion the layer and a still spinner show at once. */
@media (prefers-reduced-motion: reduce) {
  [data-loading].htmx-request::before, [data-loading].htmx-request::after { opacity: 1; }
}
