/* cicd-manager · Security Command Center design system.
   No build step. Dark-first with a full light theme (prefers-color-scheme + data-theme on <html>).
   CSP: style-src 'self' — no inline styles anywhere; widths come from .w-0…w-100 classes.
   Legacy class names (panel, cards, chip, pill, tone-*, sev-*, badge, kv, table-wrap, filters, tabs…) are kept
   and restyled here so every page picks up the design automatically. */

@font-face {
  font-family: "Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-wght-normal.b2c9031d9fd6.woff2") format("woff2");
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ------------------------------------------------------------------ tokens (dark default) */
:root {
  color-scheme: dark;
  /* surfaces: 0 = canvas, 1 = panels, 2 = raised (headers, inputs), 3 = hover, 4 = active */
  --bg-0: #0a0d12; --bg-1: #0f131a; --bg-2: #141a23; --bg-3: #1a212c; --bg-4: #232b39;
  --line: #1e2531; --line-2: #2a3341; --line-3: #3a4556;
  --text-1: #e8ebf1; --text-2: #aab3c2; --text-3: #8a94a6; --text-inv: #0a0d12;
  --accent: #3fd3e2; --accent-solid: #1cb7c8; --accent-ink: #02171a;
  --accent-soft: rgba(63, 211, 226, .12); --accent-line: rgba(63, 211, 226, .35);
  --link: #6fdfeb;
  --focus: #3fd3e2;

  --crit: #ff6b81; --crit-bg: rgba(255, 77, 106, .15); --crit-solid: #e5484d; --crit-ink: #ffffff;
  --high: #ff9a5c; --high-bg: rgba(255, 138, 61, .14); --high-solid: #f76b15;
  --med: #f2c451;  --med-bg: rgba(242, 196, 81, .13);  --med-solid: #e0a43a;
  --low: #93abff;  --low-bg: rgba(123, 156, 255, .15); --low-solid: #6e8cf5;
  --info: #a3acbb; --info-bg: rgba(163, 172, 187, .12); --info-solid: #6b7588;
  --ok: #4cd38f;   --ok-bg: rgba(76, 211, 143, .13);    --ok-solid: #2ea56b;
  --blue: #7cc4ff; --blue-bg: rgba(124, 196, 255, .13);

  --radius-xs: 4px; --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .6), 0 4px 16px rgba(0, 0, 0, .4);
  --ease: cubic-bezier(.2, .7, .2, 1); --t-fast: 120ms; --t: 180ms; --t-slow: 280ms;

  --font: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sb-w: 248px; --topbar-h: 56px;
  --grid-dot: rgba(255, 255, 255, .035);

  /* legacy aliases (older rules / other modules) */
  --bg: var(--bg-0); --panel: var(--bg-1); --panel-2: var(--bg-2); --border: var(--line); --text: var(--text-1);
  --muted: var(--text-3); --muted-bg: var(--info-bg); --good: var(--ok); --good-bg: var(--ok-bg);
  --warn: var(--med); --warn-bg: var(--med-bg); --bad: var(--crit); --bad-bg: var(--crit-bg); --shadow: var(--shadow-1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-0: #f4f6f9; --bg-1: #ffffff; --bg-2: #f7f8fa; --bg-3: #eff2f5; --bg-4: #e5e9ee;
    --line: #e4e8ee; --line-2: #d5dbe3; --line-3: #bcc4cf;
    --text-1: #0f1520; --text-2: #465061; --text-3: #626c7d; --text-inv: #ffffff;
    --accent: #077583; --accent-solid: #087785; --accent-ink: #ffffff;
    --accent-soft: rgba(8, 119, 133, .09); --accent-line: rgba(8, 119, 133, .35);
    --link: #066b78; --focus: #0a8a9a;
    --crit: #c11c3a; --crit-bg: #fde8ec; --crit-solid: #d92d47;
    --high: #a8450b; --high-bg: #fdecdf; --high-solid: #e5620f;
    --med: #845a00;  --med-bg: #fbf1d4;  --med-solid: #d6981b;
    --low: #2d52c4;  --low-bg: #e8edfd;  --low-solid: #4f72e3;
    --info: #586274; --info-bg: #eef0f4; --info-solid: #8a93a3;
    --ok: #16774a;   --ok-bg: #e2f5eb;   --ok-solid: #22a061;
    --blue: #1d5fb0; --blue-bg: #e5effb;
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-2: 0 8px 24px rgba(16, 24, 40, .1), 0 2px 6px rgba(16, 24, 40, .06);
    --shadow-3: 0 24px 64px rgba(16, 24, 40, .18), 0 4px 16px rgba(16, 24, 40, .08);
    --grid-dot: rgba(15, 21, 32, .05);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f4f6f9; --bg-1: #ffffff; --bg-2: #f7f8fa; --bg-3: #eff2f5; --bg-4: #e5e9ee;
  --line: #e4e8ee; --line-2: #d5dbe3; --line-3: #bcc4cf;
  --text-1: #0f1520; --text-2: #465061; --text-3: #626c7d; --text-inv: #ffffff;
  --accent: #077583; --accent-solid: #087785; --accent-ink: #ffffff;
  --accent-soft: rgba(8, 119, 133, .09); --accent-line: rgba(8, 119, 133, .35);
  --link: #066b78; --focus: #0a8a9a;
  --crit: #c11c3a; --crit-bg: #fde8ec; --crit-solid: #d92d47;
  --high: #a8450b; --high-bg: #fdecdf; --high-solid: #e5620f;
  --med: #845a00;  --med-bg: #fbf1d4;  --med-solid: #d6981b;
  --low: #2d52c4;  --low-bg: #e8edfd;  --low-solid: #4f72e3;
  --info: #586274; --info-bg: #eef0f4; --info-solid: #8a93a3;
  --ok: #16774a;   --ok-bg: #e2f5eb;   --ok-solid: #22a061;
  --blue: #1d5fb0; --blue-bg: #e5effb;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, .1), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-3: 0 24px 64px rgba(16, 24, 40, .18), 0 4px 16px rgba(16, 24, 40, .08);
  --grid-dot: rgba(15, 21, 32, .05);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0); color: var(--text-1);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--link); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
::selection { background: var(--accent-soft); }
code, pre, kbd, .mono { font-family: var(--mono); font-size: 12.5px; font-feature-settings: "zero"; }
code { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 0 4px; }
pre code { background: none; border: 0; padding: 0; }
pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; line-height: 1.55; color: var(--text-1);
}
h1, h2, h3, h4 { color: var(--text-1); letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 14px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 11px; margin: 16px 0 8px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
     letter-spacing: .07em; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
img, svg { vertical-align: middle; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.tabular, .num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.trunc { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
         vertical-align: bottom; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.spacer { flex: 1; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
       stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 14px; height: 14px; }
.ico.xs { width: 12px; height: 12px; }
.ico.lg { width: 20px; height: 20px; }
.ico.xl { width: 28px; height: 28px; stroke-width: 1.6; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 11px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; line-height: 1;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent-solid);
  color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
html[data-sidebar="collapsed"] .shell { --sb-w: 68px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-1); border-right: 1px solid var(--line); z-index: 40;
}
.sb-head { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 12px 0 14px;
           border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-1); min-width: 0; flex: 1; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .bm-bg { fill: var(--accent-solid); }
.brand-mark .bm-fg { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .bm-dot { fill: var(--accent-ink); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-weight: 650; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em;
             white-space: nowrap; margin-top: 2px; }
.sb-collapse { flex: none; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-title, .nav .sep { font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .09em; padding: 4px 10px 6px; white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px;
  border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  overflow: hidden; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a .ico { color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.nav a:hover { background: var(--bg-3); color: var(--text-1); text-decoration: none; }
.nav a:hover .ico { color: var(--text-1); }
.nav a.active { background: var(--accent-soft); color: var(--text-1); }
.nav a.active .ico { color: var(--accent); }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-count { order: 2; margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 0 6px; height: 18px; line-height: 18px; border-radius: var(--radius-pill); background: var(--bg-4);
  color: var(--text-2); }
.nav-count.crit { background: var(--crit-bg); color: var(--crit); }

.sb-foot { flex: none; border-top: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.status-line { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px;
  font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
a.status-line:hover { background: var(--bg-3); text-decoration: none; color: var(--text-1); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok-solid); }
.pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--ok-solid);
  opacity: 0; animation: pulse 2.4s var(--ease) infinite; }
.pulse.warn { background: var(--med-solid); } .pulse.warn::after { border-color: var(--med-solid); }
.pulse.bad { background: var(--crit-solid); } .pulse.bad::after { border-color: var(--crit-solid); }
.pulse.idle { background: var(--info-solid); } .pulse.idle::after { display: none; }
@keyframes pulse { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }

/* collapsed sidebar: icons only (desktop) */
@media (min-width: 901px) {
  html[data-sidebar="collapsed"] .brand-text,
  html[data-sidebar="collapsed"] .nav-title,
  html[data-sidebar="collapsed"] .status-line .sl-text { display: none; }
  html[data-sidebar="collapsed"] .nav a { font-size: 0; justify-content: center; padding: 0; gap: 0; }
  html[data-sidebar="collapsed"] .nav a .ico { width: 18px; height: 18px; }
  html[data-sidebar="collapsed"] .nav-count { position: absolute; top: 4px; right: 8px; font-size: 0; width: 7px;
    height: 7px; padding: 0; }
  html[data-sidebar="collapsed"] .nav-group + .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  html[data-sidebar="collapsed"] .sb-head { flex-direction: column; height: auto; padding: 12px 0 10px; gap: 8px; }
  html[data-sidebar="collapsed"] .brand { flex: none; }
  html[data-sidebar="collapsed"] .status-line { justify-content: center; padding: 9px 0; }
}
html[data-sidebar="collapsed"] .sb-collapse .ico-close,
html:not([data-sidebar="collapsed"]) .sb-collapse .ico-open { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-0) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-3);
          white-space: nowrap; overflow: hidden; flex: 0 1 auto; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text-1); text-decoration: none; }
.crumbs .ico { color: var(--line-3); width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--text-1); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }

/* global search */
.gsearch { position: relative; width: min(400px, 34vw); margin-left: auto; min-width: 0; }
.gsearch > .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3);
  pointer-events: none; }
.gsearch input[type=search] { width: 100%; height: 34px; padding: 0 62px 0 32px; border-radius: 8px;
  background: var(--bg-2); }
.gsearch .gs-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 3px;
  pointer-events: none; }
.gsearch:focus-within .gs-kbd { opacity: 0; }
.gs-results { position: absolute; top: calc(100% + 6px); right: 0; width: max(100%, 440px); max-height: 70vh;
  overflow: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-3); padding: 6px; display: none; z-index: 50; }
.gsearch.open .gs-results:not(:empty) { display: block; animation: pop var(--t) var(--ease); }
.sr-group + .sr-group { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 4px; }
.sr-title { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
  padding: 6px 8px 4px; display: flex; justify-content: space-between; }
.sr-title a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; color: var(--text-1);
  min-width: 0; }
.sr-item:hover, .sr-item.is-active, .sr-item:focus-visible { background: var(--bg-3); text-decoration: none; }
.sr-item > .ico { color: var(--text-3); }
.sr-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sr-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-empty { padding: 14px; color: var(--text-3); text-align: center; font-size: 13px; }
.sr-all { display: block; text-align: center; font-size: 12px; padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }

/* menus (details/summary) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--bg-1);
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-3); padding: 6px; z-index: 60;
  animation: pop var(--t) var(--ease); }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 7px; color: var(--text-1); background: none; border: 0; font: inherit; font-size: 13px;
  cursor: pointer; text-align: left; height: auto; justify-content: flex-start; font-weight: 400; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg-3); text-decoration: none; }
.menu-pop .ico { color: var(--text-3); }
.menu-pop form { margin: 0; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.menu-head b { display: block; font-weight: 600; }
.menu-label { font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px 2px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 12px; text-transform: uppercase;
  border: 1px solid var(--accent-line); flex: none; }
.theme-seg { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; margin: 4px 4px 6px; }
.theme-seg button { flex: 1; justify-content: center; padding: 5px; height: 28px; border-radius: 6px; color: var(--text-2); }
.theme-seg button[aria-pressed="true"] { background: var(--bg-4); color: var(--text-1); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }

.main { padding: 24px 28px 64px; min-width: 0; width: 100%; max-width: 1640px; }
.userbox { display: none; } /* legacy */

/* ------------------------------------------------------------------ page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px; }
.page-head > div:first-child, .page-head > h1:first-child { min-width: 0; flex: 1 1 360px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 .chip, .page-head h1 .pill { font-size: 12px; }
.page-head > div > .muted.small:first-child, .eyebrow { font-size: 12px; color: var(--text-3); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-head > div > .muted:not(:first-child), .page-sub { color: var(--text-2); margin-top: 6px; font-size: 13.5px; }
.page-head h2 { margin: 0; }
.panel .page-head { margin-bottom: 12px; align-items: center; }
.page-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--text-2); font-size: 13px; }
.page-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.page-meta .ico { color: var(--text-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ panels & grids */
.panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-1); margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
  flex-wrap: wrap; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-head h2 .ico { color: var(--text-3); }
.panel-head .count, h2 .count { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.panel-link { font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.panel-link:hover { color: var(--accent); text-decoration: none; }
.panel > .table-wrap:last-child { margin: 0 -18px -16px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-width: 1px 0 0;
  box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: 16px; }
.grid > .panel, .grid > div > .panel:last-child { margin-bottom: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.grid-2 > .panel, .grid-3 > .panel { margin-bottom: 0; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-1); display: block; color: var(--text-1);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease); }
a.card:hover { text-decoration: none; border-color: var(--line-3); transform: translateY(-1px); }
.card .num { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--text-3); font-size: 12px; }
.card.sev-card-critical { border-left: 3px solid var(--crit-solid); }
.card.sev-card-high { border-left: 3px solid var(--high-solid); }
.card.sev-card-critical .num { color: var(--crit); }
.card.sev-card-high .num { color: var(--high); }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 20px; margin: 0; }
dl.kv dt { color: var(--text-3); font-size: 12.5px; padding-top: 1px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.kv.small dd { font-size: 12.5px; }

/* ------------------------------------------------------------------ KPI tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr)); margin-bottom: 16px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 12px; min-height: 116px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--text-1);
  box-shadow: var(--shadow-1); overflow: hidden;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), background var(--t) var(--ease); }
a.kpi:hover { text-decoration: none; border-color: var(--line-3); transform: translateY(-1px); background: var(--bg-2); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-label .ico { color: var(--text-3); width: 15px; height: 15px; }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi .spark { width: 92px; height: 26px; flex: none; }
.kpi { --spark: var(--accent-solid); }
.kpi.tone-crit .kpi-value { color: var(--crit); } .kpi.tone-crit { --spark: var(--crit-solid); }
.kpi.tone-high .kpi-value { color: var(--high); } .kpi.tone-high { --spark: var(--high-solid); }
.kpi.tone-kev .kpi-value { color: var(--crit); } .kpi.tone-kev { --spark: var(--crit-solid); }
.kpi.tone-kev .kpi-label .ico { color: var(--high); }
.kpi.is-zero .kpi-value { color: var(--text-1); }
.kpi::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.kpi.tone-crit:not(.is-zero)::after, .kpi.tone-kev:not(.is-zero)::after { background: var(--crit-solid); }
.kpi.tone-high:not(.is-zero)::after { background: var(--high-solid); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; padding: 0 6px; height: 20px; border-radius: var(--radius-pill); white-space: nowrap; }
.delta .ico { width: 12px; height: 12px; stroke-width: 2.5; }
.delta.up { color: var(--crit); background: var(--crit-bg); }
.delta.down { color: var(--ok); background: var(--ok-bg); }
.delta.flat { color: var(--text-3); background: var(--bg-3); }
.delta.good-up.up { color: var(--ok); background: var(--ok-bg); }
.delta-note { font-size: 11px; color: var(--text-3); }
.spark { overflow: visible; }
.spark .sp-line { fill: none; stroke: var(--spark, var(--accent-solid)); stroke-width: 1.6; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round; }
.spark .sp-area { fill: var(--spark, var(--accent-solid)); opacity: .14; stroke: none; }

/* ------------------------------------------------------------------ charts */
.gauge { width: 100%; max-width: 250px; height: auto; display: block; margin: 0 auto; }
.gauge .g-track { fill: none; stroke: var(--bg-4); stroke-width: 14; stroke-linecap: round; }
.gauge .g-val { fill: none; stroke: var(--accent-solid); stroke-width: 14; stroke-linecap: round; }
.gauge.good .g-val { stroke: var(--ok-solid); } .gauge.warn .g-val { stroke: var(--med-solid); }
.gauge.bad .g-val { stroke: var(--crit-solid); }
.gauge .g-num { fill: var(--text-1); font: 600 42px var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gauge .g-sub { fill: var(--text-3); font: 600 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; }
.gauge .g-tick { fill: var(--text-3); font: 500 10px var(--font); }
.donut { width: 120px; height: 120px; flex: none; }
.donut .d-track { fill: none; stroke: var(--bg-4); stroke-width: 14; }
.donut .d-seg { fill: none; stroke-width: 14; }
.donut .d-num { fill: var(--text-1); font: 600 22px var(--font); font-variant-numeric: tabular-nums; }
.donut .d-sub { fill: var(--text-3); font: 500 10px var(--font); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .c-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .c-axis { fill: var(--text-3); font: 500 10.5px var(--font); font-variant-numeric: tabular-nums; }
.chart .c-area { stroke-width: 1.5; stroke-linejoin: round; fill-opacity: .2; }
.c-critical { fill: var(--crit-solid); stroke: var(--crit-solid); }
.c-high { fill: var(--high-solid); stroke: var(--high-solid); }
.c-medium { fill: var(--med-solid); stroke: var(--med-solid); }
.c-low { fill: var(--low-solid); stroke: var(--low-solid); }
.c-info, .c-unknown { fill: var(--info-solid); stroke: var(--info-solid); }
.d-seg.c-critical, .d-seg.c-high, .d-seg.c-medium, .d-seg.c-low, .d-seg.c-info { fill: none; }
.chart .c-hit { fill: transparent; stroke: none; }
.chart .c-hit:hover { fill: var(--text-1); fill-opacity: .05; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); }
.legend a, .legend > span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.legend a:hover { color: var(--text-1); text-decoration: none; }
.legend b { color: var(--text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; background: var(--info-solid); }
.swatch.critical { background: var(--crit-solid); } .swatch.high { background: var(--high-solid); }
.swatch.medium { background: var(--med-solid); } .swatch.low { background: var(--low-solid); }
.swatch.ok { background: var(--ok-solid); }

/* bars (ranked lists, coverage) */
.bar { position: relative; height: 6px; border-radius: var(--radius-pill); background: var(--bg-4); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--accent-solid); }
.bar.stacked { display: flex; gap: 1px; }
.bar.stacked > span { position: static; border-radius: 0; }
.bar > span.critical { background: var(--crit-solid); } .bar > span.high { background: var(--high-solid); }
.bar > span.medium { background: var(--med-solid); } .bar > span.low { background: var(--low-solid); }
.bar > span.good, .bar > span.ok { background: var(--ok-solid); } .bar > span.warn { background: var(--med-solid); }
.bar > span.bad { background: var(--crit-solid); }
.bar.thin { height: 4px; }
.bar.thick { height: 8px; }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }
.w-100 { width: 100%; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rank li > a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 8px 10px;
  margin: 0 -10px; border-radius: 8px; color: var(--text-1); align-items: center; }
.rank li > a:hover { background: var(--bg-2); text-decoration: none; }
.rank .r-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank .r-meta { display: flex; gap: 4px; align-items: center; }
.rank .bar { grid-column: 1 / -1; }

/* coverage list */
.cov { list-style: none; margin: 0; padding: 0; }
.cov li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cov li:first-child { padding-top: 0; }
.cov li:last-child { border-bottom: 0; padding-bottom: 0; }
.cov-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.cov-top a { color: var(--text-1); min-width: 0; }
.cov-top a:hover { color: var(--link); }
.cov-pct { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.cov-pct small { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.cov-pct.good { color: var(--ok); } .cov-pct.warn { color: var(--med); } .cov-pct.bad { color: var(--crit); }
.cov-gap { margin-top: 6px; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-gap .mono { font-size: 11px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-1); box-shadow: var(--shadow-1); scrollbar-width: thin; }
.table-wrap.short { max-height: 440px; }
.table-wrap.free { max-height: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 9px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 2; background: var(--bg-2); font-weight: 600; font-size: 11px;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; height: 36px;
  padding-top: 0; padding-bottom: 0; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th a:hover { color: var(--text-1); text-decoration: none; }
th a.sorted { color: var(--text-1); }
th a .ico { width: 12px; height: 12px; }
tbody tr { transition: background var(--t-fast) var(--ease); }
tbody tr:hover { background: var(--bg-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub, .cell-sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
td a { color: var(--text-1); }
td a:hover { color: var(--link); }
td.title-cell { min-width: 260px; max-width: 620px; overflow-wrap: anywhere; }
td .entity-link > span { max-width: 300px; }
td.title-cell > a { font-weight: 500; }
td.mono, td .mono { color: var(--text-2); }
td a.mono, td .mono a { color: var(--text-1); }
.cell-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.empty { padding: 28px 18px; text-align: center; color: var(--text-3); }
td.empty { padding: 40px 18px; }

/* ------------------------------------------------------------------ chips & pills */
.chip, .pill, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 20px;
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; line-height: 20px; white-space: nowrap;
  vertical-align: middle; font-variant-numeric: tabular-nums; }
.chip[class*="sev-"]::before, .pill[class*="tone-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none; }
.sev-critical { background: var(--crit-solid); color: var(--crit-ink); }
.sev-high { background: var(--high-bg); color: var(--high); }
.sev-medium { background: var(--med-bg); color: var(--med); }
.sev-low { background: var(--low-bg); color: var(--low); }
.sev-info, .sev-unknown { background: var(--info-bg); color: var(--info); }
.tone-good { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--med-bg); color: var(--med); }
.tone-bad { background: var(--crit-bg); color: var(--crit); }
.tone-info { background: var(--blue-bg); color: var(--blue); }
.tone-muted { background: var(--info-bg); color: var(--info); }
span.tone-bad:not(.pill):not(.chip) { background: none; }
.badge { background: var(--bg-3); border: 1px solid var(--line-2); font-weight: 500; color: var(--text-2); height: 22px; }
.badge.framework { background: var(--blue-bg); color: var(--blue); border-color: transparent; }
.badge.runtime { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.ci { background: var(--bg-3); }
.badge.image { font-family: var(--mono); font-weight: 400; font-size: 11.5px; }
.chip.lg { height: 26px; padding: 0 11px; font-size: 12.5px; }
.chip.lg::before { width: 7px; height: 7px; }
.kev { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px 0 6px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, #e0451f 0%, #b3132f 100%);
  box-shadow: 0 0 0 1px rgba(255, 110, 70, .35), 0 0 14px rgba(255, 70, 50, .28); vertical-align: middle; }
.kev .ico { width: 13px; height: 13px; stroke-width: 2.2; fill: rgba(255, 214, 120, .55); }
.kev.lg { height: 26px; font-size: 12px; padding: 0 11px 0 8px; }
.kev.lg .ico { width: 15px; height: 15px; }
.level-major { color: var(--crit); font-weight: 600; }
.level-info { color: var(--muted, inherit); font-weight: 600; }
.level-minor { color: var(--med); font-weight: 600; }
.level-patch { color: var(--text-3); }
.sev-count { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.sev-count .chip { height: 18px; padding: 0 6px; font-size: 11px; }
.sev-count .chip::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.tag.mono { font-size: 11px; }

/* copyable monospace values */
.copyable { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; vertical-align: middle; }
.copyable > .mono, .copyable > code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.copyable > code { background: none; border: 0; padding: 0; color: inherit; }
.copy-btn, button.copy-btn { opacity: .5; height: 22px; width: 22px; padding: 0; justify-content: center; border: 0; background: none;
  color: var(--text-3); border-radius: 5px; flex: none; }
.copy-btn .ico { width: 13px; height: 13px; }
.copyable:hover .copy-btn, .copy-btn:focus-visible, tr:hover .copy-btn { opacity: 1; }
.copy-btn:hover, button.copy-btn:hover { background: var(--bg-4); color: var(--text-1); border: 0; }
.copy-btn.copied { color: var(--ok); opacity: 1; }

/* ------------------------------------------------------------------ forms & buttons */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=search],
input[type=date], input[type=datetime-local], select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text-1); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 10px; max-width: 100%; min-height: 34px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding-right: 10px; }
textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; min-height: 90px; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-solid); width: 15px; height: 15px; vertical-align: -2px; margin: 0; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: var(--text-1); }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email], .form-row input[type=url],
.form-row input[type=number], .form-row select, .form-row textarea { width: 100%; max-width: 560px; }
.form-row select[multiple] { min-height: 130px; }
.form-row .help { color: var(--text-3); font-size: 12px; margin-top: 6px; max-width: 640px; }
.form-row.check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-row.check label { display: inline; font-weight: 500; margin: 0; }
.form-row.check .help { flex-basis: 100%; margin-top: 0; padding-left: 23px; }
.form-row ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.form-row ul label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.form-card { max-width: 780px; }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.errorlist { color: var(--crit); margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 12.5px; }
.btn, button {
  font: inherit; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--text-1); cursor: pointer; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast),
              transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn:hover, button:hover { background: var(--bg-3); border-color: var(--line-3); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--accent-solid); color: var(--accent-ink); border-color: transparent;
  font-weight: 600; box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 1px 2px rgba(0, 0, 0, .2); }
.btn.primary:hover, button.primary:hover { background: var(--accent); border-color: transparent; }
.btn.danger, button.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: transparent; }
.btn.danger:hover, button.danger:hover { background: var(--crit-bg); }
.btn.danger-solid, button.danger-solid { background: var(--crit-solid); color: #fff; border-color: transparent; font-weight: 600; }
.btn.danger-solid:hover, button.danger-solid:hover { background: var(--crit); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--bg-3); color: var(--text-1); }
.btn.small, button.small { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.small .ico, button.small .ico { width: 14px; height: 14px; }
.btn.icon, button.icon { width: 32px; padding: 0; }
.btn.icon.small, button.icon.small { width: 26px; }
button.link { border: 0; background: none; padding: 0; height: auto; color: var(--link); font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.toggle { min-width: 82px; }
.toggle.on { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.btn .pill, .btn .chip { height: 18px; font-size: 11px; }

/* ------------------------------------------------------------------ filter bar, facets, chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { min-width: 240px; }
.filters > label { font-size: 12.5px; color: var(--text-2); }
.panel .filters:last-child { margin-bottom: 0; margin-top: 12px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filterbar .search-field { position: relative; flex: 1 1 280px; max-width: 480px; }
.filterbar .search-field > .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3);
  pointer-events: none; }
.filterbar .search-field input { width: 100%; padding-left: 32px; }
.filterbar select { max-width: 230px; }
.filterbar .fb-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; min-height: 26px; }
.chipbar .cb-label { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 3px 0 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text-1); font-size: 12px; }
.fchip b { font-weight: 500; color: var(--text-3); }
.fchip a { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center;
  color: var(--text-2); }
.fchip a:hover { background: var(--bg-4); color: var(--text-1); text-decoration: none; }
.fchip a .ico { width: 12px; height: 12px; stroke-width: 2.5; }
.fchip.default { background: var(--bg-3); border-color: var(--line-2); }
.clear-all { font-size: 12px; color: var(--text-2); margin-left: 6px; }
.result-count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.result-count b { color: var(--text-1); font-weight: 600; }

.list-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 22px; align-items: start; }
.facets { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-y: auto; scrollbar-width: thin; padding-right: 6px; }
.facet { border-bottom: 1px solid var(--line); padding: 2px 0 10px; margin-bottom: 8px; }
.facet:last-child { border-bottom: 0; }
.facet > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; padding: 6px 2px; border-radius: 4px; }
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary .ico { transition: transform var(--t) var(--ease); width: 14px; height: 14px; }
.facet:not([open]) > summary .ico { transform: rotate(-90deg); }
.facet ul { list-style: none; margin: 0; padding: 0; }
.facet li a { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px;
  color: var(--text-2); font-size: 13px; min-width: 0; }
.facet li a:hover { background: var(--bg-3); color: var(--text-1); text-decoration: none; }
.facet .fc-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.facet .fc-n { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.facet .box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-3); flex: none;
  display: inline-flex; align-items: center; justify-content: center; transition: background var(--t-fast), border-color var(--t-fast); }
.facet .box .ico { width: 10px; height: 10px; stroke-width: 3.5; opacity: 0; color: var(--accent-ink); }
.facet li a.on { color: var(--text-1); }
.facet li a.on .box { background: var(--accent-solid); border-color: var(--accent-solid); }
.facet li a.on .box .ico { opacity: 1; }
.facet li a.radio .box { border-radius: 50%; }
.facet li a.zero { opacity: .45; }
.facet .more { font-size: 12px; padding: 4px 0 0; display: inline-block; }
.facet-toggle { display: none; }
.switch-link { display: flex; align-items: center; gap: 9px; padding: 5px 0; color: var(--text-2); font-size: 13px; }
.switch-link:hover { color: var(--text-1); text-decoration: none; }
.switch-link .fc-n { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.switch { width: 28px; height: 16px; border-radius: 99px; background: var(--bg-4); position: relative; flex: none;
  border: 1px solid var(--line-2); transition: background var(--t) var(--ease); }
.switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-3); transition: transform var(--t) var(--ease), background var(--t); }
.switch-link.on .switch { background: var(--accent-solid); border-color: transparent; }
.switch-link.on .switch::after { transform: translateX(12px); background: var(--accent-ink); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px; color: var(--text-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.seg a:hover { color: var(--text-1); text-decoration: none; background: var(--bg-3); }
.seg a.on { background: var(--bg-4); color: var(--text-1); box-shadow: var(--shadow-1); }
.seg a .n { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* list loading states */
.list-region { position: relative; }
.list-region.htmx-request .table-wrap, .list-region.htmx-request .facets, .list-region.htmx-request .results { opacity: .5;
  transition: opacity var(--t) var(--ease); }
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90; pointer-events: none; overflow: hidden; opacity: 0;
  transition: opacity var(--t); }
.loading-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--accent);
  animation: loading 1s var(--ease) infinite; }
.htmx-request.loading-bar, .htmx-request .loading-bar, html.is-loading .loading-bar { opacity: 1; }
@keyframes loading { from { left: -40%; } to { left: 100%; } }
.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-4) 50%, var(--bg-3) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; height: 12px; width: 100%; }
.skeleton + .skeleton { margin-top: 10px; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.htmx-request .spin, .htmx-request.spin { opacity: .55; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tab, .tabs .tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--text-2); font-weight: 500;
  font-size: 13px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 0; background: none; }
.tab:hover, .tabs .tab:hover { color: var(--text-1); text-decoration: none; }
.tab.active, .tabs .tab.active { color: var(--text-1); border-bottom-color: var(--accent); background: none; font-weight: 600; }
.tab .badge { height: 18px; font-size: 10.5px; }

/* ------------------------------------------------------------------ callouts, toasts */
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li, .callout { display: block; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-1); }
.callout.good, .messages .success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok-solid) 45%, transparent); }
.callout.bad, .messages .error { background: var(--crit-bg); border-color: color-mix(in srgb, var(--crit-solid) 45%, transparent); }
.callout.warn, .messages .warning { background: var(--med-bg); border-color: color-mix(in srgb, var(--med-solid) 45%, transparent); }
.callout.info, .messages .info { background: var(--blue-bg); border-color: color-mix(in srgb, var(--low-solid) 45%, transparent); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout.small, span.callout { display: inline-block; padding: 3px 10px; margin: 0; font-size: 12px; }
.callout.has-icon { display: flex; gap: 10px; align-items: flex-start; }
.callout.has-icon > .ico { margin-top: 2px; }
.callout.has-icon > div { flex: 1; min-width: 0; }
.callout.good > .ico { color: var(--ok); } .callout.bad > .ico { color: var(--crit); }
.callout.warn > .ico { color: var(--med); } .callout.info > .ico { color: var(--low); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px;
  width: min(400px, calc(100vw - 32px)); list-style: none; margin: 0; padding: 0; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 14px; border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text-1); font-size: 13px;
  animation: toast-in var(--t-slow) var(--ease); }
.toast::before { content: ""; width: 3px; align-self: stretch; border-radius: 3px; background: var(--accent); flex: none; margin: -2px 2px -2px -4px; }
.toast.success::before { background: var(--ok-solid); } .toast.error::before { background: var(--crit-solid); }
.toast.warning::before { background: var(--med-solid); }
.theme-moon { display: none; }
html.is-light .theme-sun { display: none; } html.is-light .theme-moon { display: inline-block; }
.toast > .ico { margin-top: 2px; color: var(--accent); }
.toast.success > .ico { color: var(--ok); }
.toast.error > .ico { color: var(--crit); }
.toast.warning > .ico { color: var(--med); }
.toast .t-msg { flex: 1; padding-top: 1px; min-width: 0; overflow-wrap: anywhere; }
.toast button { height: 22px; width: 22px; padding: 0; border: 0; background: none; color: var(--text-3); }
.toast button:hover { background: var(--bg-3); color: var(--text-1); }
.toast.leaving { animation: toast-out var(--t) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 20px; }
.es-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text-2); margin-bottom: 6px; }
.es-icon .ico { width: 20px; height: 20px; }
.es-icon.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.es-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-1); }
.empty-state p { margin: 0; color: var(--text-3); max-width: 460px; font-size: 13px; }
.empty-state .actions { margin-top: 10px; justify-content: center; }
.empty-state.compact { padding: 18px 12px; }
td .empty-state { padding: 28px 12px; }

/* ------------------------------------------------------------------ dialogs & command palette */
dialog { color: var(--text-1); }
dialog::backdrop { background: rgba(5, 8, 12, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog { border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--bg-1); padding: 0; width: min(460px, calc(100vw - 32px));
  box-shadow: var(--shadow-3); }
.dialog[open] { animation: pop var(--t) var(--ease); }
.dialog .dl-body { padding: 20px 20px 8px; display: flex; gap: 14px; }
.dialog .dl-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--crit-bg); color: var(--crit); }
.dialog .dl-title { margin: 4px 0 6px; font-size: 15px; font-weight: 600; }
.dialog p { color: var(--text-2); margin: 0; }
.dialog .dl-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

.palette { border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); padding: 0; width: min(640px, calc(100vw - 24px));
  margin-top: 12vh; box-shadow: var(--shadow-3); overflow: hidden; }
.palette[open] { animation: pop var(--t) var(--ease); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-input > .ico { color: var(--text-3); width: 18px; height: 18px; }
.pal-input input, .pal-input input:focus, .pal-input input:hover { flex: 1; border: 0; background: none; height: 54px; font-size: 15px; box-shadow: none; padding: 0; }
.pal-list { max-height: min(56vh, 460px); overflow: auto; padding: 6px; scrollbar-width: thin; }
.pal-group { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 8px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-1); cursor: pointer; min-width: 0; }
.pal-item > .ico { color: var(--text-3); }
.pal-item .pi-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pi-sub { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.pal-item .pi-keys { display: flex; gap: 3px; }
.pal-item[aria-selected="true"] { background: var(--accent-soft); }
.pal-item[aria-selected="true"] > .ico { color: var(--accent); }
.pal-item:hover { text-decoration: none; background: var(--bg-3); }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3);
  background: var(--bg-2); }
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.pal-empty { padding: 26px; text-align: center; color: var(--text-3); }

/* ------------------------------------------------------------------ code blocks */
.code-block { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.code-block .cb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px 5px 12px;
  border-bottom: 1px solid var(--line); background: var(--bg-3); font-size: 11.5px; color: var(--text-3); }
.code-block .cb-head > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.code-block pre { border: 0; border-radius: 0; background: none; }
.code-block + .code-block { margin-top: 10px; }
.prompt-box { max-height: 420px; }

/* ------------------------------------------------------------------ detail headers */
.hero { position: relative; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 22px 18px 24px; margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow-1); }
.hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--info-solid); }
.hero.edge-critical::before { background: var(--crit-solid); }
.hero.edge-high::before { background: var(--high-solid); }
.hero.edge-medium::before { background: var(--med-solid); }
.hero.edge-low::before { background: var(--low-solid); }
.hero.edge-ok::before { background: var(--ok-solid); }
.hero.edge-accent::before { background: var(--accent-solid); }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-row > div:first-child { min-width: 0; flex: 1 1 420px; }
.hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hero h1 { font-size: 22px; margin-bottom: 2px; overflow-wrap: anywhere; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px 24px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--line); }
.hg-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 5px; }
.hg-value { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.version-jump { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; flex-wrap: wrap; }
.version-jump .from { color: var(--crit); }
.version-jump .to { color: var(--ok); font-weight: 600; }
.version-jump .ico { color: var(--text-3); width: 14px; height: 14px; }
.entity-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-1); min-width: 0; max-width: 100%; }
.entity-link > .ico { color: var(--text-3); }
.entity-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.entity-link:hover { color: var(--link); text-decoration: none; }
a.entity-link:hover > span { text-decoration: underline; text-underline-offset: 2px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 2px; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: var(--line-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-1); border: 2px solid var(--line-3); }
.timeline li.t-bad::after { border-color: var(--crit-solid); } .timeline li.t-ok::after { border-color: var(--ok-solid); }
.timeline li.t-accent::after { border-color: var(--accent); } .timeline li.t-warn::after { border-color: var(--med-solid); }
.tl-when { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-what { font-size: 13px; }

/* advisory cards */
.advisory { padding: 14px 0; border-bottom: 1px solid var(--line); }
.advisory:first-of-type { padding-top: 0; }
.advisory:last-of-type { border-bottom: 0; padding-bottom: 0; }
.adv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.adv-id { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.adv-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.adv-links a { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.feed li:first-child { padding-top: 0; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.f-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-3); color: var(--text-2); display: flex;
  align-items: center; justify-content: center; }
.f-ico .ico { width: 14px; height: 14px; }
.f-ico.ok { background: var(--ok-bg); color: var(--ok); } .f-ico.bad { background: var(--crit-bg); color: var(--crit); }
.f-ico.warn { background: var(--med-bg); color: var(--med); } .f-ico.info { background: var(--blue-bg); color: var(--blue); }
.f-main { min-width: 0; font-size: 13px; }
.f-main a { color: var(--text-1); }
.f-main .sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.f-when { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
time[title] { cursor: default; }

/* risk list */
.risks { list-style: none; margin: 0; padding: 0; }
.risks li > a { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 10px 12px;
  margin: 0 -12px; border-radius: 9px; color: var(--text-1); }
.risks li > a:hover { background: var(--bg-2); text-decoration: none; }
.risks li + li { border-top: 1px solid var(--line); }
.rk-sev { grid-row: span 2; align-self: start; padding-top: 1px; }
.rk-title { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; min-width: 0; }
.rk-title > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.rk-sub { grid-column: 2 / 4; font-size: 11.5px; color: var(--text-3); display: flex; gap: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.rk-sub > span { display: inline-flex; gap: 5px; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rk-sub .ico { width: 12px; height: 12px; }
.rk-fix { grid-row: 1; grid-column: 3; font-family: var(--mono); font-size: 11.5px; color: var(--ok); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.rk-fix .ico { width: 12px; height: 12px; }
.rk-fix.none { color: var(--text-3); font-family: var(--font); }

/* dashboard */
.cc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cc-head .eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.dash { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: 16px; }
.dash > * { margin-bottom: 0; min-width: 0; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
.posture { display: flex; flex-direction: column; gap: 14px; }
.posture-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.posture-split > a, .posture-split > div { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); }
.posture-split > a:hover { border-color: var(--line-3); text-decoration: none; }
.ps-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ps-val { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ps-val small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.posture-note { font-size: 12px; color: var(--text-3); text-align: center; margin: 0; }
.ops-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); padding: 0; overflow: hidden; }
.ops-strip > * { padding: 14px 18px; border-right: 1px solid var(--line); color: var(--text-1); min-width: 0; }
.ops-strip > *:last-child { border-right: 0; }
.ops-strip > a:hover { background: var(--bg-2); text-decoration: none; }
.os-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.os-label .ico { width: 13px; height: 13px; }
.os-val { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; }
.os-val small { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.os-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-tier { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* ------------------------------------------------------------------ auth pages */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: var(--bg-1); border-right: 1px solid var(--line); padding: 40px 52px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-art::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-dot) 1px, transparent 1px), linear-gradient(90deg, var(--grid-dot) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 75%); }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; right: -170px; bottom: -190px; border-radius: 50%;
  border: 1px solid var(--accent-line); box-shadow: 0 0 0 70px var(--accent-soft), 0 0 0 140px color-mix(in srgb, var(--accent) 5%, transparent),
  0 0 0 210px color-mix(in srgb, var(--accent) 3%, transparent); }
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 36px; height: 36px; }
.auth-brand b { font-size: 16px; font-weight: 650; display: block; line-height: 1.2; }
.auth-brand span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.auth-pitch .eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; margin-bottom: 14px; }
.auth-pitch .pitch-title { font-size: 34px; line-height: 1.12; letter-spacing: -.035em; font-weight: 600; max-width: 480px; margin: 0 0 14px; }
.auth-pitch p { color: var(--text-2); max-width: 440px; font-size: 14.5px; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 11px; max-width: 460px; }
.auth-points li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.auth-points li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); flex: none; }
.auth-foot { font-size: 12px; color: var(--text-3); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; min-width: 0; }
.auth { width: 100%; max-width: 400px; margin: 10vh auto; padding: 0 16px; }
.auth-main .auth { margin: 0 auto; padding: 0; }
.auth-main .auth.wide { max-width: 560px; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-mobile-brand img { width: 30px; height: 30px; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }
.auth > p.muted, .auth .auth-lead { color: var(--text-2); margin-bottom: 22px; }
.auth .panel { padding: 24px; border-radius: 16px; box-shadow: var(--shadow-2); }
.auth input[type=text], .auth input[type=password] { width: 100%; height: 40px; font-size: 14px; }
.auth .form-row input { max-width: none; }
.auth form > button.primary, .auth form > .btn.primary { height: 40px; width: 100%; font-size: 14px; margin-top: 4px; }
.auth-secure { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 18px; font-size: 12px; color: var(--text-3); }
.auth-secure::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok-solid); box-shadow: 0 0 0 3px var(--ok-bg); }
.auth .link-row { display: flex; justify-content: center; margin-top: 14px; }
.otp-input { letter-spacing: .4em; font-family: var(--mono); text-align: center; font-size: 18px !important; }
.qr { display: flex; justify-content: center; margin: 8px 0 14px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 12px; }
.codes { columns: 2; font-family: var(--mono); font-size: 14px; list-style: none; padding: 14px 18px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); }
.codes li { padding: 3px 0; }
.secret { font-family: var(--mono); letter-spacing: .08em; word-break: break-all; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--bg-4); }
.steps span.on { background: var(--accent-solid); }

/* ------------------------------------------------------------------ misc */
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pager .pg-links { display: flex; gap: 6px; align-items: center; }
.countdown { font-variant-numeric: tabular-nums; }
.status-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.status-box form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.triage { display: flex; flex-direction: column; gap: 12px; }
.triage-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.triage-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.triage-actions form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.triage-actions input[type=text] { min-width: 200px; }
.fingerprint { font-family: var(--mono); font-size: 14px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); word-break: break-all; margin: 10px 0 14px; }
.panel-slot:empty { display: none; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }
.kv-inline b { color: var(--text-1); font-weight: 500; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; min-width: 0; }
.link-list li:first-child { padding-top: 0; }
.link-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.scrim { display: none; }
.section-gap { margin-top: 24px; }
.panel.where { border-color: var(--accent-line); }
.where-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.where-summary .tag { height: 24px; font-size: 12px; color: var(--text-1); }
.where-block { padding: 12px 0; border-top: 1px solid var(--line); }
.where-block:first-of-type { border-top: 0; padding-top: 0; }
.where-summary + .where-block { border-top: 1px solid var(--line); padding-top: 12px; }
.wb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.where-block .table-wrap { box-shadow: none; }
.where-line { display: flex; align-items: center; gap: 5px; color: var(--text-2); }
.where-line .ico { color: var(--accent); }
.code-inline { margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.code-inline code { white-space: pre-wrap; word-break: break-all; }
.form-row.has-error input, .form-row.has-error select, .form-row.has-error textarea { border-color: var(--crit); }
.results { min-width: 0; }
.stat-inline { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.stat-inline b { font-size: 15px; font-weight: 600; }

@media (max-width: 1280px) {
  .span-3, .span-4 { grid-column: span 6; } .span-5, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 1100px) {
  .list-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facets { position: static; max-height: none; display: none; padding: 12px 14px; background: var(--bg-1);
    border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 12px; }
  .facets.open { display: block; }
  .facet-toggle { display: inline-flex; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell, html[data-sidebar="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); visibility: hidden;
    transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); box-shadow: var(--shadow-3); }
  .drawer-open .sidebar { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease); }
  .sb-collapse { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5, 8, 12, .55); opacity: 0; pointer-events: none;
    transition: opacity var(--t-slow) var(--ease); }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .crumbs { display: none; }
  .gsearch { width: auto; flex: 1; }
  .gs-results { position: fixed; left: 8px; right: 8px; width: auto; top: calc(var(--topbar-h) + 4px); }
  .main { padding: 18px 16px 48px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .dash > * { grid-column: 1 / -1; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 560px) {
  .gsearch .gs-kbd { display: none; }
  .gsearch input[type=search] { padding-right: 10px; }
  .page-head h1, .hero h1 { font-size: 19px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; min-height: 104px; }
  .kpi-value { font-size: 24px; }
  .kpi .spark { width: 56px; }
  .filters input[type=search], .filterbar .search-field { min-width: 0; flex-basis: 100%; max-width: none; }
  .filterbar .fb-right { margin-left: 0; }
  .hero { padding: 16px 16px 16px 20px; }
  .topbar-actions .hide-sm { display: none; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .risks li > a { grid-template-columns: minmax(0, 1fr) auto; }
  .rk-sev { grid-row: auto; grid-column: 1 / -1; }
  .rk-sub { grid-column: 1 / -1; }
  .rk-fix { grid-row: auto; grid-column: 2; }
  .ops-strip > * { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .toasts, .facets { display: none !important; }
  .shell { display: block; }
}

/* ------------------------------------------------------------------ module additions
   Page-specific rules added by other modules go below; use the tokens above (var(--bg-1), var(--line), …). */

/* T15: several locked versions of one package in the repository dependency table */
tr.dep-extra td:first-child { padding-left: 28px; }
tr.dep-extra td:first-child::before { content: "↳ "; color: var(--muted, #888); }
details.dep-via { margin-top: 2px; }
details.dep-via summary { cursor: pointer; }
details.dep-via ul { margin: 2px 0 0 16px; padding: 0; }

/* ------------------------------------------------------------------ runtime readiness (N12) */
.rr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.rr { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rr-grid .rr { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-1); }
.rr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rr-name { font-weight: 600; font-size: 14px; }
.rr-arrow { color: var(--text-3); display: inline-flex; }
.rr-target { font-size: 12.5px; }
.rr .cov-top { margin-bottom: 0; }
.rr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rr-list li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 4px 8px;
  border-radius: 6px; background: var(--crit-bg); }
.rr-pkg { font-size: 12.5px; font-weight: 600; }
.rr-unknown summary { cursor: pointer; }
.rr-advice { margin-bottom: 0; }

/* ---- sortable table headers (T23): client-side (th.is-sortable) and server-side (th a.sort-link) */
th.is-sortable { cursor: pointer; user-select: none; }
th.is-sortable:hover, th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--text-1); }
th.is-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
th.is-sortable::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0;
  transition: opacity var(--t-fast) var(--ease); }
th.is-sortable:hover::after { opacity: .35; }
th.is-sortable[aria-sort="ascending"]::after { border-top: 0; border-bottom: 5px solid var(--accent); opacity: 1; }
th.is-sortable[aria-sort="descending"]::after { border-top: 5px solid var(--accent); opacity: 1; }
th a.sort-link .ico { opacity: .45; }
th a.sort-link.sorted .ico { opacity: 1; color: var(--accent); }
