/* QScope console — navigation rail + Dashboard (#/dashboard). Loaded after theme.css by index.html.
 *
 * Scoping: every selector is .rail* or .dash* (plus html[data-rail], body and [data-theme] where the
 * layout needs them), because index.html carries unscoped .card / .panel / .grid / .tag / td rules and
 * this file must not restyle #/fleet. There is deliberately no global .muted rule.
 * Colour: tokens from theme.css only — no literals here. The only green on the page is the outlined
 * .dash-pipe--up chip. Pipeline and collection states (the pipeline dots, the P-04 problem chips) stay out
 * of the risk hues: they are neutral-ink outlines told apart by border weight / style, a glyph and text.
 * Risk hues mark data only: --risk-vulnerable (Shor-class), --risk-broken (classically broken today),
 * --risk-hybrid (hybrid-PQ); unknown / not collected is the grey hatch (#dash-hatch, --cell-unknown).
 */

/* ---- rail width: saved choice (html[data-rail]) > width rule; a sheet below 760 px ---------------- */
html {
  --rail-w: 232px;
  /* the small type sizes, as tokens so a phone can raise them in one place (below) */
  --dash-fs-11: 11px;
  --dash-fs-10: 10px;
  --dash-fs-9: 9px;
}
@media (min-width: 760px) and (max-width: 1099px) {
  html {
    --rail-w: 56px;
  }
}
html[data-rail="expanded"] {
  --rail-w: 232px;
}
html[data-rail="collapsed"] {
  --rail-w: 56px;
}
@media (max-width: 759px) {
  html,
  html[data-rail] {
    --rail-w: 0px;
    /* nothing a person has to read is under 12 px on a phone; badges stay a step smaller */
    --dash-fs-11: 12px;
    --dash-fs-10: 12px;
    --dash-fs-9: 11px;
  }
}
body {
  padding-left: var(--rail-w);
  transition: padding-left 150ms ease;
}
html[data-rail="sheet"] body {
  padding-top: 56px;
}

/* the landing route, set by index.html's bootstrap before first paint (and kept by dashboard.js), so the
   fleet page never flashes before the dashboard; #/fleet itself is untouched */
html[data-route="dashboard"] #viewFleet,
html[data-route="dashboard"] #pageHeader {
  display: none;
}

/* `hidden` must win over the display values below */
.rail [hidden],
.rail-open[hidden],
.rail-scrim[hidden],
.dash[hidden],
.dash [hidden],
.dash-qv[hidden] {
  display: none !important;
}

/* ---- rail -------------------------------------------------------------------------------------- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 45; /* above the device drawer (40), below .modal (50) */
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  color: var(--text);
  transition: width 150ms ease;
}
.rail-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 6px 12px;
}
.rail-brand {
  display: grid;
  flex: 1;
  grid-template-columns: 32px auto;
  grid-template-rows: 32px auto;
  align-items: center;
  column-gap: 1px;
  min-width: 0;
  padding: 2px 2px 2px 0;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.rail-logo {
  grid-row: 1;
  grid-column: 1;
  width: 32px;
  height: 32px;
}
.rail-logo--white {
  display: none;
}
[data-theme="dark"] .rail-logo--color {
  display: none;
}
[data-theme="dark"] .rail-logo--white {
  display: block;
}
.rail-word {
  display: contents;
}
.rail-word-name {
  grid-row: 1;
  grid-column: 2;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.01em;
}
.rail-word-sub {
  grid-row: 2;
  grid-column: 1 / span 2;
  margin-top: 11px; /* brand clear space: 1/3 of the 32 px icon (plan §4) */
  color: var(--muted);
  font-size: var(--dash-fs-10);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.rail-toggle,
.rail-close,
.rail-open {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rail-toggle:hover,
.rail-close:hover,
.rail-open:hover {
  background: var(--chip);
  color: var(--text);
}
.rail-close {
  display: none;
}
.rail-open {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 41;
  border-color: var(--line);
  background: var(--bg2);
  color: var(--text);
}
.rail-scrim {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: var(--scrim);
}
.rail-groups {
  flex: 1;
  padding: 2px 8px 8px;
}
.rail-group {
  margin-top: 10px;
}
.rail-group-h {
  display: block;
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: var(--dash-fs-10);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rail-row:hover {
  background: var(--chip);
}
.rail-ico {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--muted);
}
/* active row: a filled icon tile and a 3 px bar — shape, not colour alone */
.rail-row[aria-current="page"] .rail-ico {
  background: var(--accent);
  color: var(--bg2);
}
.rail-row[aria-current="page"]::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}
.rail-row[aria-current="page"] .rail-label {
  font-weight: 700;
}
.rail-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-ext-inline {
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.rail-ext {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  width: 10px;
  height: 10px;
}
.rail-tip {
  display: none;
}
/* Escape hides the tooltip until the pointer or focus moves to another row (WCAG 1.4.13) */
.rail.rail--tips-off .rail-tip {
  display: none !important;
}
.rail-foot {
  padding: 6px 8px 10px;
  border-top: 1px solid var(--line);
}
.rail-sr,
.dash-sr,
html[data-rail="collapsed"] .rail-label,
html[data-rail="collapsed"] .rail-word-name,
html[data-rail="collapsed"] .rail-word-sub,
html[data-rail="collapsed"] .rail-group-h {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* "All graph views (N)" popover: beside the rail on desktop, inline inside the sheet on phones */
.rail-pop {
  position: fixed;
  bottom: 12px;
  left: calc(var(--rail-w) + 8px);
  z-index: 46;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  width: 440px;
  max-width: calc(100vw - var(--rail-w) - 16px);
  max-height: calc(100vh - 24px);
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg2);
  box-shadow: 0 12px 34px var(--scrim);
}
.rail-pop-h {
  grid-row: 1;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: var(--dash-fs-10);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.rail-pop-list {
  grid-row: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail-pop-list a {
  display: block;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
}
.rail-pop-list a:hover {
  background: var(--chip);
}
.rail-pop-note {
  grid-row: 3;
  grid-column: 1 / span 2;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--dash-fs-11);
}

/* collapsed: icons only, 44 × 44 targets, headings become a 1 px separator, tooltips on hover + focus */
html[data-rail="collapsed"] .rail-head {
  flex-direction: column;
  gap: 11px; /* brand clear space, including the toggle's hover fill */
  padding: 12px 0 6px;
}
html[data-rail="collapsed"] .rail-brand {
  display: flex;
  flex: none;
  justify-content: center;
  padding: 2px;
}
html[data-rail="collapsed"] .rail-groups {
  padding: 2px 6px 8px;
}
html[data-rail="collapsed"] .rail-group + .rail-group {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
html[data-rail="collapsed"] .rail-row {
  justify-content: center;
  padding: 4px;
}
html[data-rail="collapsed"] .rail-row[aria-current="page"]::before {
  left: -6px;
}
html[data-rail="collapsed"] .rail-ext-inline {
  display: none;
}
html[data-rail="collapsed"] .rail-ext {
  display: block;
}
html[data-rail="collapsed"] .rail-foot {
  padding: 6px;
}
/* The tip is position:fixed with top:auto, so it keeps its static (row-centred) vertical position but
   escapes the rail's scroll clipping. */
html[data-rail="collapsed"] .rail-row:hover .rail-tip,
html[data-rail="collapsed"] .rail-row:focus-visible .rail-tip {
  position: fixed;
  left: calc(var(--rail-w) + 8px);
  z-index: 47;
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg2);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* focus is always visible */
.rail-row:focus-visible,
.rail-brand:focus-visible,
.rail-toggle:focus-visible,
.rail-close:focus-visible,
.rail-open:focus-visible,
.rail-pop-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- dashboard ------------------------------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 16px;
  align-content: start;
  padding: 0 22px 32px;
  font-variant-numeric: tabular-nums;
  container-type: inline-size; /* layouts count columns by the dashboard's own width, not the viewport's */
}
/* every block spans the page, except the single-row groups (Broken today, Is capture working?), which sit
   side by side on a wide dashboard until one of their rows is expanded */
.dash-region > * {
  grid-column: 1 / -1;
}
@container (min-width: 940px) {
  .dash-region > .dash-group--half {
    grid-column: auto;
  }
  .dash-region > .dash-group--half:has(.dash-prow--open) {
    grid-column: 1 / -1;
  }
}
.dash-ico {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-ico--sm {
  width: 14px;
  height: 14px;
}
/* the page is three regions rebuilt separately; they take no box of their own, so the strip stays sticky */
.dash-region {
  display: contents;
}
/* header strip: a compact sticky bar (title, analytics chip, Run collection) … */
.dash-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0 6px;
  background: var(--bg);
}
.dash-strip-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.dash-strip-bar .dash-title {
  margin: 0;
}
.dash-strip-bar .dash-btn {
  margin-left: auto;
}
/* … and the detail that scrolls with the page */
.dash-strip-more {
  display: grid;
  gap: 6px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.dash-strip-more .dash-scope-line {
  font-size: 12px;
}
.dash-strip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.dash-scope-line {
  margin: 0;
  font-size: 13px;
}
.dash-muted,
.dash-asof {
  color: var(--muted);
}
.dash-small {
  font-size: var(--dash-fs-11);
}
.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.dash-btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg2);
}
.dash-btn:hover {
  filter: brightness(1.08);
}
.dash-runmsg {
  margin: 0;
  font-size: 12px;
}
.dash-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.dash-link-btn[aria-expanded="true"] .dash-ico {
  transform: rotate(180deg);
}

/* pipeline dots: outlined chips, no overall rollup (D-13); state = outline shape + mark + text */
.dash-pipes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-pipe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px dotted var(--muted);
  border-radius: 999px;
  font-size: 12px;
}
.dash-pipe-name {
  font-weight: 600;
}
.dash-pipe-state {
  color: var(--muted);
}
.dash-pipe-mark {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.dash-pipe--up {
  border: 1px solid var(--ok-fg);
}
.dash-pipe--up .dash-pipe-mark {
  border-color: var(--ok-fg);
  background: var(--ok-fg);
}
.dash-pipe--stale {
  border: 1px dashed var(--text);
}
.dash-pipe--stale .dash-pipe-mark {
  border-color: var(--text);
}
.dash-pipe--down {
  border: 2px solid var(--text);
}
.dash-pipe--down .dash-pipe-mark {
  border-color: var(--text);
  border-radius: 1px;
  background: var(--text);
}
.dash-pipe--down .dash-pipe-state,
.dash-pipe--stale .dash-pipe-state {
  color: var(--text);
  font-weight: 600;
}

/* analytics chip + ⓘ */
.dash-achip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 2px 1px 10px;
  border: 1px dotted var(--muted);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}
.dash-achip--reachable {
  border: 1px solid var(--line);
  color: var(--text);
}
.dash-achip--unreachable,
.dash-achip--graph_unreachable {
  border: 2px solid var(--muted);
}
.dash-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.dash-info-btn:hover {
  background: var(--chip);
  color: var(--text);
}
.dash-info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg2);
  font-size: 12px;
}
.dash-info dt {
  color: var(--muted);
}
.dash-info dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* analytics banner (Stage 1: reachability and links only, never a risk figure) */
.dash-banner {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  background: var(--bg2);
}
.dash-banner-h {
  margin: 0 0 6px;
  font-size: 14px;
}
.dash-banner p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.dash-banner--reachable .dash-banner-h {
  color: var(--text);
}
.dash-banner--unreachable .dash-banner-h,
.dash-banner--not_linked .dash-banner-h,
.dash-banner--unknown .dash-banner-h,
.dash-banner--checking .dash-banner-h {
  color: var(--muted);
}
.dash-banner-links a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
}

/* bands + panels */
.dash-band-h {
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: var(--dash-fs-11);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.dash-panel {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg2);
}
.dash-panel-h {
  margin: 0 0 6px;
  font-size: 14px;
}
.dash-verdict {
  margin: 0 0 10px;
  font-size: 13px;
}
.dash-panel-foot {
  margin: 10px 0 0;
  font-size: var(--dash-fs-11);
}
.dash-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.dash-type-h {
  margin: 0 0 6px;
  font-size: 12px;
}
.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}
.dash-chip {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
/* a collection problem: neutral ink, heavier outline, a "!" glyph and its text label — never a risk hue */
.dash-chip--problem {
  border: 2px solid var(--text);
  font-weight: 600;
}
.dash-chip--problem::before {
  content: "!";
  content: "!" / "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 5px;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  font-size: var(--dash-fs-9);
  font-weight: 700;
  line-height: 11px;
  text-align: center;
  vertical-align: 1px;
}
.dash-chip--muted {
  border-style: dashed;
  color: var(--muted);
}
.dash-table {
  width: 100%;
  margin-top: 4px;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-table caption {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: var(--dash-fs-11);
  text-align: left;
}
.dash-table th,
.dash-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
  white-space: normal;
}
.dash-table thead th {
  color: var(--muted);
  font-size: var(--dash-fs-11);
}
.dash-table tbody th {
  color: var(--text);
}
.dash .dash-num {
  text-align: right;
}
.dash-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}
.dash-li {
  margin: 4px 0;
}
.dash-li--muted {
  color: var(--muted);
}
.dash-li--problem {
  font-weight: 600;
  list-style-type: "! ";
}
.dash-li--broken {
  font-weight: 600;
}
.dash-stale {
  opacity: 0.75;
  filter: saturate(0.3);
}
.dash-stale-tag {
  text-transform: none;
}
.dash-btn:focus-visible,
.dash-link-btn:focus-visible,
.dash-info-btn:focus-visible,
.dash-banner a:focus-visible,
.dash a:focus-visible,
.dash button:focus-visible,
.dash [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- analytics band (Stage 2) ----------------------------------------------------------------- */
.dash-title {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
}
.dash-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.dash-strip-row--gaps {
  justify-content: flex-start;
}
.dash-gapchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-gapchip {
  min-height: 28px;
  padding: 2px 10px;
  border: 1px dashed var(--muted);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.dash-gapchip:hover {
  background: var(--chip);
}
.dash-lens {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}
.dash-achip--ok {
  border: 1px solid var(--line);
  color: var(--text);
}
.dash-achip--stale,
.dash-achip--fetch_failed {
  border: 1px dashed var(--text);
  color: var(--text);
}
.dash-achip--misconfigured {
  border: 2px solid var(--muted);
}
.dash-nr {
  color: var(--muted);
}

/* KPI row: six tiles on a 6-column grid when the dashboard is at least 1100 px wide; 3 × 2 below that
   (a tablet, or a laptop with the rail expanded); one column on a phone */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}
@container (min-width: 940px) {
  .dash-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
/* the four headline charts, 2 × 2; one column below 760 px of dashboard width */
.dash-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 10px 0 0;
}
@container (min-width: 760px) {
  .dash-headline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.dash-hl {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 8px 12px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg2);
}
.dash-hl .dash-fig {
  margin: 0;
}
.dash-hl .dash-legend,
.dash-hl .dash-fig-note {
  font-size: max(10.5px, var(--dash-fs-10));
}
.dash-hl .dash-rows {
  gap: 3px;
}
.dash-hl .dash-src {
  flex: 1;
}
/* "Details →" shares the last line with the chart's "Show data" */
.dash-details {
  position: absolute;
  right: 12px;
  bottom: 6px;
}
/* on a narrow card the two labels do not fit one line and "Details →" lay across "Show data" (a tap on
   Show data's lower half opened Details); there it takes its own line, right-aligned */
@container (max-width: 420px) {
  .dash-details {
    position: static;
    align-self: flex-end;
  }
}
/* collapsed panel rows: two columns on a wide dashboard; an expanded row takes the full width */
.dash-prows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
@container (min-width: 940px) {
  .dash-prows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-group--half .dash-prows {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dash-prow {
  padding: 6px 12px 8px;
}
.dash-prow--open {
  grid-column: 1 / -1;
}
.dash-prow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.dash-prow-head .dash-panel-h {
  flex: 1 1 260px;
  margin: 0;
}
.dash-prow-toggle {
  display: inline-flex;
  width: 100%;
  min-height: 32px;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.dash-prow-toggle .dash-ico {
  margin-top: 2px;
  transform: rotate(-90deg);
  transition: transform 120ms ease;
}
.dash-prow-toggle[aria-expanded="true"] .dash-ico {
  transform: none;
}
.dash-prow-line {
  margin: 1px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
}
.dash-prow-line .dash-verdict {
  display: inline;
  margin: 0;
}
.dash-prow-foot {
  margin-left: 8px;
  font-size: var(--dash-fs-11);
}
.dash-prow-foot .dash-view {
  white-space: nowrap;
}
.dash-prow-foot .dash-view {
  margin-left: 0;
}
.dash-prow-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
/* a panel's data status: neutral outlined chips (never a risk hue, never green) */
.dash-status {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--dash-fs-11);
  white-space: nowrap;
}
.dash-status--muted {
  border-style: dotted;
  color: var(--muted);
}
.dash-status--failed {
  border: 1px dashed var(--text);
  font-weight: 600;
}
.dash-kpi {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg2);
}
.dash-kpi .dash-src {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}
.dash-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}
.dash-kpi-q {
  margin: 0;
  color: var(--muted);
  font-size: max(11.5px, var(--dash-fs-11));
  font-weight: 600;
  line-height: 1.35;
}
.dash-kpi-v {
  font-size: 20px;
  font-variant-numeric: normal; /* proportional figures for a standalone value */
  font-weight: 600;
  line-height: 1.2;
}
.dash-kpi-split {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.dash-kpi-split .dash-v {
  font-size: 16px;
  font-weight: 600;
}
/* several figures in one tile (never added): one per line */
.dash-kpi-split .dash-kpi-fig {
  display: block;
}
.dash-kpi-split .dash-sep {
  display: none;
}
.dash-kpi-unit {
  font-size: 12px;
  font-weight: 400;
}
.dash-kpi-honest {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}
.dash-kpi-sub {
  margin: 0;
  padding: 0;
  font-size: var(--dash-fs-11);
  list-style: none;
}
.dash-kpi-sub li {
  margin: 2px 0;
}
.dash-kpi-cp {
  margin: 0;
  font-size: 12px;
}
.dash-kpi-foot {
  margin: auto 0 0;
  padding-top: 4px;
  font-size: max(10.5px, var(--dash-fs-10));
}
.dash-tiers {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 400;
  list-style: none;
}
.dash-tier .dash-v {
  font-weight: 600;
}
.dash-tier-l {
  font-weight: 600;
}

/* bands and panels */
.dash-band-src {
  font-weight: 400;
  text-transform: none;
}
.dash-panel--line .dash-verdict {
  margin: 0;
  color: var(--muted);
}
.dash-verdict--honest {
  color: var(--muted);
}
.dash-sub-h {
  margin: 12px 0 4px;
  font-size: 12px;
}
.dash-callout {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12px;
}
.dash-callout-h {
  margin: 0 0 2px;
  font-size: 13px;
}
.dash-callout p {
  margin: 0;
}
.dash-caveats {
  margin: 4px 0 0;
  color: var(--muted);
}
.dash-view {
  margin-left: 6px;
  color: var(--accent);
  white-space: nowrap;
}
.dash-failnote {
  margin: 0 0 6px;
  padding: 4px 8px;
  border: 1px dashed var(--muted);
  border-radius: 6px;
  font-size: 12px;
}
.dash-chip-line {
  margin: 0 0 8px;
}
.dash-chip-line .dash-chip {
  display: inline-block;
}
.dash-cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.dash-matrix td {
  text-align: left;
}
.dash-row-sensitive th {
  font-weight: 600;
}
.dash-broken-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 1px;
  background: var(--risk-broken);
}

/* charts: one figure = caption (title, n, unit, as-of), the marks, a text legend, "Show data" */
.dash-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 20px;
  margin: 8px 0;
}
.dash-fig {
  min-width: 0;
  margin: 10px 0;
}
.dash-fig-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-bottom: 4px;
}
.dash-fig-t {
  font-size: 12px;
  font-weight: 600;
}
.dash-fig-n,
.dash-fig-note {
  color: var(--muted);
  font-size: var(--dash-fs-11);
}
.dash-fig-note {
  margin: 4px 0 0;
}
.dash-fig--compact {
  margin: 6px 0;
}
.dash-fig--compact .dash-fig-t {
  font-size: var(--dash-fs-11);
}
.dash-fig--muted .dash-stack,
.dash-fig--muted .dash-donut,
.dash-fig--muted .dash-bars {
  opacity: 0.6;
}
.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 4px 0 0;
  padding: 0;
  font-size: var(--dash-fs-11);
  list-style: none;
}
.dash-leg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dash-leg-v {
  color: var(--muted);
}
.dash-sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 2px;
}
.dash-sw--vulnerable {
  background: var(--risk-vulnerable);
}
.dash-sw--broken {
  background: var(--risk-broken);
}
.dash-sw--hybrid {
  background: var(--risk-hybrid);
}
.dash-sw--count {
  background: var(--chart-count);
}
.dash-sw--count2,
.dash-sw--muted {
  background: var(--chart-count-2);
}
.dash-sw--unknown {
  background: var(--cell-unknown);
  box-shadow: inset 0 0 0 1px var(--risk-unknown);
}
.dash-sw--inferred {
  background: var(--cell-inferred);
  box-shadow: inset 0 0 0 1px var(--risk-vulnerable);
}
/* marks: fills and rings by meaning; unknown / inferred are pattern references set as attributes */
.dash-fill--vulnerable {
  fill: var(--risk-vulnerable);
}
.dash-fill--broken {
  fill: var(--risk-broken);
}
.dash-fill--hybrid {
  fill: var(--risk-hybrid);
}
.dash-fill--count {
  fill: var(--chart-count);
}
.dash-fill--count2 {
  fill: var(--chart-count-2);
}
.dash-fill--muted {
  fill: var(--chart-count-2);
  fill-opacity: 0.6;
}
.dash-ring--vulnerable {
  stroke: var(--risk-vulnerable);
}
.dash-ring--broken {
  stroke: var(--risk-broken);
}
.dash-ring--hybrid {
  stroke: var(--risk-hybrid);
}
.dash-ring--count {
  stroke: var(--chart-count);
}
.dash-ring--count2,
.dash-ring--muted {
  stroke: var(--chart-count-2);
}
/* categorical identity hues (the algorithm donut): theme.css --cat-1..6, never a risk hue; every segment also
   has its text label in the legend and the Show data table */
.dash-ring--cat1 {
  stroke: var(--cat-1);
}
.dash-fill--cat1 {
  fill: var(--cat-1);
}
.dash-sw--cat1 {
  background: var(--cat-1);
}
.dash-ring--cat2 {
  stroke: var(--cat-2);
}
.dash-fill--cat2 {
  fill: var(--cat-2);
}
.dash-sw--cat2 {
  background: var(--cat-2);
}
.dash-ring--cat3 {
  stroke: var(--cat-3);
}
.dash-fill--cat3 {
  fill: var(--cat-3);
}
.dash-sw--cat3 {
  background: var(--cat-3);
}
.dash-ring--cat4 {
  stroke: var(--cat-4);
}
.dash-fill--cat4 {
  fill: var(--cat-4);
}
.dash-sw--cat4 {
  background: var(--cat-4);
}
.dash-ring--cat5 {
  stroke: var(--cat-5);
}
.dash-fill--cat5 {
  fill: var(--cat-5);
}
.dash-sw--cat5 {
  background: var(--cat-5);
}
.dash-ring--cat6 {
  stroke: var(--cat-6);
}
.dash-fill--cat6 {
  fill: var(--cat-6);
}
.dash-sw--cat6 {
  background: var(--cat-6);
}
.dash-hatch-bg {
  fill: var(--risk-unknown);
  fill-opacity: 0.18;
}
.dash-hatch-ln {
  fill: var(--risk-unknown);
}
.dash-inf-bg {
  fill: var(--risk-vulnerable);
  fill-opacity: 0.14;
}
.dash-inf-ln {
  fill: var(--risk-vulnerable);
}
.dash-gap {
  fill: var(--bg2);
}
.dash-rule {
  fill: var(--text);
}
.dash-axis {
  fill: var(--line);
}
.dash-stack,
.dash-bar,
.dash-cols {
  display: block;
  overflow: visible;
}
.dash-cols {
  max-width: 100%;
  height: auto;
}
.dash-rows {
  display: grid;
  gap: 6px;
}
.dash-rowbar,
.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(84px, 26%) minmax(0, 1fr) minmax(64px, auto);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.dash-rowbar-v,
.dash-bar-v {
  text-align: right;
  white-space: nowrap;
}
.dash-rowbar--muted {
  color: var(--muted);
}
.dash-bars {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.dash-donut {
  flex: none;
}
.dash-donut-n {
  fill: var(--text);
  font-size: 20px;
  font-weight: 600;
}
.dash-donut-u,
.dash-col-l,
.dash-col-y {
  fill: var(--muted);
  font-size: var(--dash-fs-10);
}
.dash-col-v {
  fill: var(--text);
  font-size: var(--dash-fs-10);
}
.dash-donut-c {
  max-width: 260px;
  margin: 0;
  font-size: 12px;
}
/* the headline donuts: the ring (with its caption beneath) beside a one-column legend once the cell is wide
   enough; stacked below that */
.dash-hl {
  container-type: inline-size;
}
@container (min-width: 380px) {
  .dash-hl .dash-fig--donut {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
  }
  .dash-hl .dash-fig--donut > * {
    grid-column: 1 / -1;
  }
  .dash-hl .dash-fig--donut > .dash-donut-wrap {
    grid-column: 1;
    flex-direction: column;
    align-items: flex-start;
    max-width: 180px;
  }
  .dash-hl .dash-fig--donut > .dash-legend {
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    align-self: center;
  }
}
.dash-legend--chips .dash-leg {
  flex-wrap: wrap;
}
/* a risk chip in words beside a legend entry (only where the payload carries it); the outline is the only hue */
.dash-legchip {
  padding: 0 5px;
  border: 1px solid var(--risk-vulnerable);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--dash-fs-10);
  line-height: 14px;
  white-space: nowrap;
}
.dash-sub-row th {
  padding-left: 18px;
  color: var(--muted);
  font-weight: 400;
}
/* segmented Owned | Trust store switch (aria-pressed buttons) */
.dash-seg {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  margin: 0 0 4px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--chip);
}
.dash-seg-btn {
  min-height: 28px;
  padding: 2px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.dash-seg-btn[aria-pressed="true"] {
  background: var(--bg2);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
  font-weight: 600;
}
.dash-seg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---- the in-shell QPA view (#/view/<id>, --qpa-embed): a fixed pane beside the rail, so the frame takes the
   remaining height and the page never scrolls twice -------------------------------------------------------- */
.dash-qv {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--rail-w);
  z-index: 42; /* over the closed device drawer's edge shadow (40) and the menu button (41); under the rail
                  sheet (44–46) and every modal (50) */
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  transition: left 150ms ease;
}
html[data-rail="sheet"] .dash-qv {
  top: 56px;
}
.dash-qv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 2px 22px;
}
.dash-qv-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-qv-title:focus {
  outline: none;
}
.dash-qv-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dash-qv-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.dash-qv-open:hover {
  text-decoration: underline;
}
.dash-qv-reload {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}
.dash-qv-reload:hover {
  background: var(--chip);
}
.dash-qv-open:focus-visible,
.dash-qv-reload:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dash-qv-hint {
  margin: 0;
  padding: 0 16px 8px 22px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--dash-fs-11);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-qv-wait {
  margin: 0;
  padding: 12px 22px;
  color: var(--muted);
}
.dash-qv-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
@media (max-width: 759px) {
  .dash-qv-bar,
  .dash-qv-hint {
    padding-left: 16px;
  }
  .dash-qv-hint {
    white-space: normal;
  }
}
.dash-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.dash-stat-v {
  font-size: 22px;
  font-variant-numeric: normal;
  font-weight: 600;
}
.dash-stat-l {
  color: var(--muted);
  font-size: 12px;
}
.dash-table--data {
  margin-top: 6px;
}
.dash-total th,
.dash-total td {
  font-weight: 600;
}

/* ---- widths ----------------------------------------------------------------------------------- */
@media (max-width: 1099px) {
  .dash-cols3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 759px) {
  /* the menu button sits on a bar the page scrolls under, instead of floating over card headings */
  html[data-rail="sheet"] body::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 39; /* under the menu button (41) and the device drawer (40) */
    height: 56px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  /* the rail is a sheet: off-canvas until opened, labels visible, its own close button */
  .rail {
    width: 232px;
    max-width: 85vw;
    visibility: hidden;
    transform: translateX(-100%);
    transition:
      transform 150ms ease,
      visibility 0s linear 150ms;
  }
  .rail.rail--sheet-open {
    visibility: visible;
    transform: none;
    box-shadow: 8px 0 24px var(--scrim);
    transition: transform 150ms ease;
  }
  .rail-toggle {
    display: none;
  }
  .rail-close {
    display: inline-flex;
  }
  .rail-pop {
    position: static;
    grid-template-columns: 1fr;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 4px 0 0;
    box-shadow: none;
  }
  .rail-pop-h,
  .rail-pop-list,
  .rail-pop-note {
    grid-row: auto;
    grid-column: auto;
  }
  .dash {
    padding: 0 16px 24px;
  }
  .dash-strip {
    position: static;
  }
  .dash-types,
  .dash-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .dash-rowbar,
  .dash-bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .dash-rowbar > svg,
  .dash-bar-row > svg {
    grid-row: 2;
    grid-column: 1 / span 2;
  }
  /* data tables become stacked cards: each cell prints its column name */
  .dash-table--cards,
  .dash-table--cards tbody,
  .dash-table--cards caption {
    display: block;
  }
  .dash-table--cards thead {
    display: none;
  }
  .dash-table--cards tr {
    display: block;
    margin: 0 0 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
  }
  .dash-table--cards th,
  .dash-table--cards td {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 0;
    text-align: left;
  }
  .dash-table--cards td::before {
    content: attr(data-label);
    color: var(--muted);
  }
}
/* ---- touch: every control is at least 44 px to a finger ------------------------------------------ */
/* The controls themselves grow (rows get a little taller on a touch screen). An invisible ::after halo was
   tried first and rejected: on a <button> Chrome does not hit-test it outside the border box, and where
   two controls sit close (Show data / Details →) one halo swallowed the other's taps. */
@media (pointer: coarse) {
  .dash-info-btn {
    width: 44px;
    height: 44px;
  }
  .dash-btn,
  .dash-gapchip,
  .dash-seg-btn,
  .dash-link-btn,
  .dash-prow-toggle {
    min-height: 44px;
  }
  .dash-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    vertical-align: middle;
  }
}
@media (prefers-reduced-motion: reduce) {
  body,
  .rail,
  .rail.rail--sheet-open,
  .dash-link-btn .dash-ico,
  .dash-prow-toggle .dash-ico,
  .dash-qv {
    transition: none;
  }
}
/* forced colours: data marks, donut segments, swatches, gaps and the hatch / stripe patterns keep their own
   colours (forced-color-adjust: none) so the meaning-bearing hue and pattern survive; every bar segment and
   swatch also gets a CanvasText outline, and every donut segment a thin CanvasText halo on top of its 2 px
   gap, so adjacent segments stay distinguishable even where two hues look alike. Identity is also in the
   legend text and the Show data table. */
@media (forced-colors: active) {
  .dash-mark,
  .dash-ring,
  .dash-sw,
  .dash-gap,
  .dash-rule,
  .dash-hatch-bg,
  .dash-hatch-ln,
  .dash-inf-bg,
  .dash-inf-ln,
  .dash-fc-bg,
  .dash-fc-ln {
    forced-color-adjust: none;
  }
  .dash-mark {
    stroke: CanvasText;
    stroke-width: 1px;
  }
  .dash-ring {
    stroke-linecap: butt;
    filter: drop-shadow(0 0 0.5px CanvasText);
  }
  .dash-sw {
    outline: 1px solid CanvasText;
  }
  /* the categorical hues carry identity only, so under forced colours each slot becomes its own CanvasText
     pattern (solid, vertical, horizontal, dots, grid, checker — never the 45° / 135° hatch of unknown and
     inferred), on the ring, on any bar and on its legend swatch */
  .dash-fc-bg {
    fill: Canvas;
  }
  .dash-fc-ln {
    fill: CanvasText;
  }
  .dash-ring--cat1 {
    stroke: CanvasText;
  }
  .dash-fill--cat1 {
    fill: CanvasText;
  }
  .dash-sw--cat1 {
    background: CanvasText;
  }
  .dash-ring--cat2 {
    stroke: url(#dash-fc-2);
  }
  .dash-fill--cat2 {
    fill: url(#dash-fc-2);
  }
  .dash-sw--cat2 {
    background: repeating-linear-gradient(90deg, CanvasText 0 2px, Canvas 2px 4px);
  }
  .dash-ring--cat3 {
    stroke: url(#dash-fc-3);
  }
  .dash-fill--cat3 {
    fill: url(#dash-fc-3);
  }
  .dash-sw--cat3 {
    background: repeating-linear-gradient(0deg, CanvasText 0 2px, Canvas 2px 4px);
  }
  .dash-ring--cat4 {
    stroke: url(#dash-fc-4);
  }
  .dash-fill--cat4 {
    fill: url(#dash-fc-4);
  }
  .dash-sw--cat4 {
    background: radial-gradient(circle, CanvasText 1px, Canvas 1.5px) 0 0 / 4px 4px;
  }
  .dash-ring--cat5 {
    stroke: url(#dash-fc-5);
  }
  .dash-fill--cat5 {
    fill: url(#dash-fc-5);
  }
  .dash-sw--cat5 {
    background:
      repeating-linear-gradient(90deg, CanvasText 0 1px, transparent 1px 4px),
      repeating-linear-gradient(0deg, CanvasText 0 1px, Canvas 1px 4px);
  }
  .dash-ring--cat6 {
    stroke: url(#dash-fc-6);
  }
  .dash-fill--cat6 {
    fill: url(#dash-fc-6);
  }
  .dash-sw--cat6 {
    background: repeating-conic-gradient(CanvasText 0 25%, Canvas 0 50%) 0 0 / 4px 4px;
  }
  .dash-seg-btn[aria-pressed="true"] {
    outline: 2px solid CanvasText;
  }
  .dash-legchip {
    border-color: CanvasText;
  }
}
