/* Quality Intelligence report (docs/report-ui.md).
   Slate surfaces and indigo as the report's colour, the portfolio's teal for its mark only, and
   green for success. Result labels and exact counts carry the meaning; colour only supports them. */

:root {
  --bg: #f6f7fc; --surface: #ffffff; --surface-2: #edf0f7; --surface-3: #f8f9fd;
  --ink: #24283d; --muted: #5d657b; --line: #dfe3ee;
  --accent: #5145b8; --accent-ink: #fff; --accent-soft: #eeecfc; --accent-line: #c3bdf1;
  --brand: #08665e; --brand-ink: #fff; --chart-passed: #6678c4; --cyan: #16748b; --purple: #7860bb; --amber: #a56a00;
  --section-tint: #eff1fb; --glow: rgba(99, 102, 241, .09); --texture: rgba(81, 69, 184, .035);
  --radius: 10px; --radius-lg: 14px; --gap: 18px; --pad: 20px;
  --shadow: 0 6px 24px rgba(40, 46, 83, .055); --shadow-hover: 0 10px 28px rgba(43, 47, 83, .09);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  /* Result colours: readable as text on --surface (WCAG AA) and distinct as chart fills */
  --passed: #237154; --failed: #b42335; --error: #895400; --skipped: #778095;
  --passed-soft: #e3f3ec; --failed-soft: #fdecea; --error-soft: #fbf1dc; --skipped-soft: #edf1f5;
  --cov-covered: #6678c4; --cov-not-run: #c48a1d; --cov-not-automated: #9aa3b8; --cov-no-tests: #c9cfdc;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141827; --surface: #1c2235; --surface-2: #293149; --surface-3: #20273c;
    --ink: #eef0fa; --muted: #b5bdd3; --line: #353e58;
    --accent: #b7adff; --accent-ink: #201a45; --accent-soft: #312d50; --accent-line: #62598f;
    --brand: #79dfc2; --brand-ink: #10241e; --chart-passed: #99a9ed; --cyan: #8acee1; --purple: #c6a7ef; --amber: #f2c35b;
    --section-tint: #1b2035; --glow: rgba(129, 140, 248, .10); --texture: rgba(183, 173, 255, .03);
    --shadow: 0 5px 20px rgba(0, 0, 0, .16); --shadow-hover: 0 10px 28px rgba(0, 0, 0, .28);
    --passed: #79dfb2; --failed: #ff9a91; --error: #f2c35b; --skipped: #a9b3c8;
    --passed-soft: #1d3a30; --failed-soft: #3d2422; --error-soft: #3a3120; --skipped-soft: #283043;
    --cov-covered: #99a9ed; --cov-not-run: #e0b04f; --cov-not-automated: #6e7892; --cov-no-tests: #454f68;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141827; --surface: #1c2235; --surface-2: #293149; --surface-3: #20273c;
  --ink: #eef0fa; --muted: #b5bdd3; --line: #353e58;
  --accent: #b7adff; --accent-ink: #201a45; --accent-soft: #312d50; --accent-line: #62598f;
  --brand: #79dfc2; --brand-ink: #10241e; --chart-passed: #99a9ed; --cyan: #8acee1; --purple: #c6a7ef; --amber: #f2c35b;
  --section-tint: #1b2035; --glow: rgba(129, 140, 248, .10); --texture: rgba(183, 173, 255, .03);
  --shadow: 0 5px 20px rgba(0, 0, 0, .16); --shadow-hover: 0 10px 28px rgba(0, 0, 0, .28);
  --passed: #79dfb2; --failed: #ff9a91; --error: #f2c35b; --skipped: #a9b3c8;
  --passed-soft: #1d3a30; --failed-soft: #3d2422; --error-soft: #3a3120; --skipped-soft: #283043;
  --cov-covered: #99a9ed; --cov-not-run: #e0b04f; --cov-not-automated: #6e7892; --cov-no-tests: #454f68;
  color-scheme: dark;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.55 var(--font);
  /* A soft glow and a faint dot texture behind the page; cards stay plain so data reads quietly */
  background:
    radial-gradient(ellipse at 90% 0, var(--glow), transparent 55%),
    radial-gradient(circle at 1px 1px, var(--texture) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg a:focus-visible { outline: none; }
svg a:focus-visible rect.hit, svg a:focus-visible circle { stroke: var(--accent); stroke-width: 2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 8px; }
h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 38px); line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
h1:focus { outline: none; } /* focus moves to the heading after navigation (screen readers) */
h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.01em; }
h3 { margin: 18px 0 8px; font-size: 15px; }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lead { margin: 0 0 20px; color: var(--muted); max-width: 76ch; }
.sub { color: var(--muted); font-size: 13px; }
.block { display: block; }
.section-title { margin: 24px 0 12px; }
small { font-size: 12px; }

/* ---- Top bar: the portfolio's header ---- */
.topbar {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 66px; padding: 12px clamp(16px, 3vw, 32px); background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-mark { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); font-size: 14px; letter-spacing: .02em; }
.brand-text { display: grid; line-height: 1.2; }
.brand-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.topbar-tools { display: flex; align-items: center; gap: 10px; }

/* ---- Controls: one look for selects, inputs, buttons and chips ---- */
.pill-link, .round, .field select, .field input, .search, .button-quiet {
  min-height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); font: inherit; font-size: 14px;
}
.pill-link { display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; font-weight: 600; text-decoration: none; }
.round { width: 40px; display: grid; place-items: center; cursor: pointer; font-size: 17px; }
.button-quiet { display: inline-flex; align-items: center; padding: 0 14px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; }
.button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.pill-link:hover, .round:hover, .button-quiet:hover, .field select:hover { border-color: var(--accent-line); background: var(--accent-soft); }
button:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
.search { width: 100%; padding: 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--accent-line); }
.chip[aria-pressed="true"], .chip-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip-count { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.chip-key { font-weight: 500; color: var(--muted); }

/* ---- Layout: sidebar + content (filter bar above each section) ---- */
.layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 66px);
  background: linear-gradient(to right, var(--surface) 235px, var(--line) 235px, var(--line) 236px, transparent 236px);
}
.sidebar { position: sticky; top: 66px; align-self: start; display: grid; align-content: start; gap: 2px; padding: 20px 12px; height: calc(100vh - 66px); }
.sidebar a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { width: 18px; text-align: center; color: var(--muted); }
.sidebar a[aria-current="page"] .nav-icon { color: var(--accent); }
.sidebar-rule { height: 1px; background: var(--line); margin: 12px 8px; }
.sidebar .sidebar-quiet { color: var(--muted); font-weight: 500; }
.content { min-width: 0; }
main { padding: 8px clamp(16px, 3vw, 40px) 48px; min-width: 0; }
main:focus { outline: none; }
.footer { padding: 18px clamp(16px, 3vw, 32px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; background: var(--surface); }

/* ---- Filter bar ---- */
.filterbar { display: grid; gap: 10px; padding: 18px clamp(16px, 3vw, 40px) 14px; }
.filter-body { display: grid; gap: 10px; }
.filter-toggle { display: none; justify-self: start; }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.field select { padding: 0 32px 0 12px; max-width: min(100%, 300px); cursor: pointer; font-weight: 600; }
.field input { padding: 0 10px; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.freshness-box { display: grid; gap: 8px; }
.freshness { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.freshness .button-quiet { min-height: 32px; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--section-tint); color: var(--muted); font-size: 13.5px; border: 1px solid var(--line); }
.notice-warning { margin: 0; background: var(--error-soft); color: var(--ink); border-color: color-mix(in srgb, var(--error) 35%, var(--line)); }
.notice-warning > summary { cursor: pointer; font-weight: 600; }
.notice-warning ul { margin: 6px 0; padding-left: 18px; }

/* ---- Page heading and back link ---- */
.report-heading { margin: 4px 0 18px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(ellipse at 100% 0, var(--accent-soft), transparent 65%), var(--surface); box-shadow: var(--shadow); }
.report-heading .lead { margin: 8px 0 0; }
.back-link { display: inline-flex; margin: 6px 0 12px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.detail-key code { font: 12.5px var(--mono); color: var(--muted); overflow-wrap: anywhere; }

/* ---- Headline figures (clickable) ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: var(--gap); }
.kpi {
  position: relative; display: grid; gap: 4px; align-content: start; padding: 16px 18px 16px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.kpi::before { content: ""; position: absolute; left: 10px; top: 18px; width: 5px; height: 22px; border-radius: 3px; background: var(--tone, var(--accent)); }
.kpi:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); }
.kpi-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi-value { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-change { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-change.up { color: var(--passed); } .kpi-change.down { color: var(--failed); }
.kpi-passed { --tone: var(--passed); } .kpi-failed { --tone: var(--failed); } .kpi-error { --tone: var(--error); }
.kpi-skipped { --tone: var(--skipped); } .kpi-accent { --tone: var(--accent); }

/* ---- Cards ---- */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.card { position: relative; min-width: 0; padding: var(--pad); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.section-card { margin-bottom: var(--gap); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-head h2::before { content: ""; width: 6px; height: 16px; border-radius: 3px; background: var(--widget, var(--accent)); }
.card-head .meta { font-size: 12px; color: var(--muted); padding: 3px 8px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 7px; }
.accent-indigo { --widget: var(--accent); } .accent-cyan { --widget: var(--cyan); } .accent-purple { --widget: var(--purple); } .accent-amber { --widget: var(--amber); }

/* ---- Results donut ---- */
.summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.ring { width: 168px; height: 168px; }
.ring circle { fill: none; stroke-width: 11; }
.ring .track { stroke: var(--surface-2); }
.ring a circle { cursor: pointer; }
.ring a:hover circle { stroke-width: 14; }
.ring .seg-passed { stroke: var(--chart-passed); } .ring .seg-failed { stroke: var(--failed); }
.ring .seg-error { stroke: var(--error); } .ring .seg-skipped { stroke: var(--skipped); }
.ring-value { font-size: 26px; font-weight: 800; fill: var(--ink); letter-spacing: -.02em; }
.ring-label { font-size: 11px; fill: var(--muted); }
.big-number { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.big-label { color: var(--muted); font-size: 12.5px; margin: 4px 0 12px; }
.pass-rate-text { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.legend { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.legend li a, .legend li { font-size: 13px; }
.legend li a { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink); text-decoration: none; }
.legend li a:hover { background: var(--accent-soft); }
.legend .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.legend-inline li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot-passed { background: var(--chart-passed); } .dot-failed { background: var(--failed); }
.dot-error { background: var(--error); } .dot-skipped { background: var(--skipped); }

/* ---- Charts ---- */
.chart { width: 100%; height: 190px; display: block; }
.chart .axis { fill: var(--muted); font-size: 10.5px; }
.chart .not-recorded { font-size: 14px; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.chart a:hover .hit { fill: var(--accent-soft); }
.fill-passed { fill: var(--chart-passed); } .fill-failed { fill: var(--failed); }
.fill-error { fill: var(--error); } .fill-skipped { fill: var(--skipped); } .fill-accent { fill: var(--accent); }
.line-accent { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.dot-accent { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
details.numbers { margin-top: 10px; }
details.numbers > summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 600; min-height: 24px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
th { color: var(--muted); font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.selected td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
/* A minimum width: on a phone a table scrolls inside its card instead of squeezing the names */
.table-wrap table { min-width: 520px; }
.meter { display: inline-block; vertical-align: middle; width: 80px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--chart-passed); }

/* ---- Stacked bars: suites and feature coverage ---- */
.stack { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.stack span { display: block; height: 100%; }
.s-passed { background: var(--chart-passed); } .s-failed { background: var(--failed); }
.s-error { background: var(--error); } .s-skipped { background: var(--skipped); }
.cov-covered { background: var(--cov-covered); } .cov-not-run { background: var(--cov-not-run); }
.cov-not-automated { background: var(--cov-not-automated); } .cov-no-tests { background: var(--cov-no-tests); }
.feature-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.feature-bars li { display: grid; gap: 6px; }
.feature-name { font-weight: 650; font-size: 14px; color: var(--ink); text-decoration: none; }
.feature-name:hover { color: var(--accent); text-decoration: underline; }
.suites { display: grid; gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.suite-row { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.suite-row:last-child { border-bottom: 0; padding-bottom: 0; }
.suite-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13.5px; }
.suite-name { font-weight: 650; overflow-wrap: anywhere; }
.suite-meta { font-size: 12.5px; color: var(--muted); }

/* ---- Lists on the overview ---- */
.attention { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.attention li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-3); font-size: 14px; }
.readiness-state { margin: 0 0 8px; }
.reasons { margin: 0 0 6px; padding-left: 18px; font-size: 14px; }
.env, .facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 18px; margin: 0; font-size: 13.5px; }
.env dt, .facts dt { color: var(--muted); }
.env dt, .env dd, .facts dt, .facts dd { padding-block: 7px; border-bottom: 1px solid var(--line); }
.env dd, .facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Badges, stats, empty and loading states ---- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-passed { background: var(--passed-soft); color: var(--passed); }
.badge-failed { background: var(--failed-soft); color: var(--failed); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-skipped { background: var(--skipped-soft); color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: var(--gap); }
.stat { position: relative; display: grid; gap: 2px; padding: 14px 16px 14px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; left: 10px; top: 16px; width: 5px; height: 20px; border-radius: 3px; background: var(--tone, var(--line)); }
a.stat:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); }
.stat strong { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat-passed { --tone: var(--passed); } .stat-failed { --tone: var(--failed); } .stat-error { --tone: var(--error); } .stat-quiet { --tone: var(--line); }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 22px 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-3); margin-bottom: var(--gap); }
.card .empty-state { margin-bottom: 0; }
.empty-state p { margin: 0; font-size: 13.5px; color: var(--muted); }
.empty-state .empty-title { color: var(--ink); font-weight: 650; font-size: 14.5px; }
.loading { color: var(--muted); }
.error-box[role="alert"] { padding: 14px 16px; border-radius: var(--radius); background: var(--failed-soft); color: var(--failed); border: 1px solid var(--failed); }
.load-more { display: grid; gap: 8px; }
.list-status { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.load-more .button-quiet { justify-self: start; min-height: 34px; }
.load-more[hidden], .button-quiet[hidden] { display: none; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.skeleton { border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; }
.skeleton-tile { height: 96px; }
.skeleton-wide { grid-column: span 2; height: 220px; }

/* ---- Test Results ---- */
.results-card { padding: 16px; }
.toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.tree { display: grid; gap: 2px; }
.node > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 4px 8px;
  border-radius: 8px; cursor: pointer; font-weight: 650; font-size: 14px; list-style: none;
}
.node > summary::-webkit-details-marker { display: none; }
.node > summary::before, .cat > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg);
}
.node[open] > summary::before, .cat[open] > summary::before { transform: rotate(45deg); }
.node > summary:hover { background: var(--surface-2); }
.node .node { margin-left: 16px; }
.node-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.node-label small { display: block; color: var(--muted); font-weight: 500; }
.node-counts { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.count-passed { color: var(--passed); } .count-failed { color: var(--failed); }
.count-error { color: var(--error); } .count-skipped { color: var(--muted); } /* --skipped is too light for small text */
.flat-list, .tree .test-item { list-style: none; margin: 0; padding: 0; }
.flat-list { display: grid; gap: 2px; }
.node .test-item { margin-left: 16px; }
.test-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 36px; padding: 5px 8px;
  border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px;
}
.test-row:hover { background: var(--accent-soft); }
.test-name { min-width: 0; overflow-wrap: anywhere; }
.test-name small { display: block; color: var(--muted); }
.test-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Test details ---- */
.test-title { font-size: clamp(22px, 3vw, 30px); }
.execution-head { display: grid; gap: 10px; margin: 12px 0 16px; }
.detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs [role="tab"] { flex: none; min-height: 42px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { padding: 4px 2px; }
.failure { margin: 0 0 14px; border: 1px solid var(--failed); border-radius: var(--radius); background: var(--failed-soft); overflow: hidden; }
.failure-title { margin: 0; padding: 8px 12px; font-weight: 700; color: var(--failed); }
.failure pre, pre.evidence { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); color: var(--ink); background: var(--surface); }
pre.evidence { border: 1px solid var(--line); border-radius: var(--radius); }
.pattern { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.pattern .dot { width: 14px; height: 14px; border-radius: 4px; }
.pattern .current { outline: 2px solid var(--ink); outline-offset: 1px; }
.test-case { margin-bottom: 14px; }

/* ---- Failures & Stability ---- */
.cat { border-top: 1px solid var(--line); }
.cat > summary { display: grid; grid-template-columns: 12px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; list-style: none; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary:hover { background: var(--surface-2); }
.cat > summary .badge { justify-self: start; }
.cat-signature { min-width: 0; overflow-wrap: anywhere; font: 13px/1.45 var(--mono); }
.cat-what { color: var(--muted); font-size: 14px; }
.cat-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cat-tests { margin: 0 0 6px; padding-left: 22px; font-size: 14px; display: grid; gap: 4px; }
.cat-tests a { overflow-wrap: anywhere; }
.cat > .sub, .cat > p, .cat > .load-more { margin: 0 4px 10px; }

/* ---- Trends ---- */
.rank { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.rank a { overflow-wrap: anywhere; }
.rank-value, .spread-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.spread li { display: grid; grid-template-columns: 72px minmax(0, 1fr) 48px; align-items: center; gap: 10px; font-size: 13.5px; }
.spread-bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.spread-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.spread-count { text-align: right; }
.gate-days { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gate-day { display: grid; gap: 2px; min-width: 64px; padding: 6px 8px; border-radius: 8px; font-size: 12px; text-align: center; }
.gate-passed { background: var(--passed-soft); color: var(--passed); }
.gate-failed { background: var(--failed-soft); color: var(--failed); }
.gate-skipped { background: var(--skipped-soft); color: var(--muted); }

/* ---- Coverage & Requirements ---- */
.req-list { list-style: none; margin: 4px 0 8px 22px; padding: 0; display: grid; gap: 2px; }
.req-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; }
.req-row:hover { background: var(--surface-2); }
.req-row .badge { justify-self: start; }
.req-text { overflow-wrap: anywhere; }
.req-meta { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.owner + .owner { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.owner h3 { margin: 0 0 8px; }

/* ---- Tablet and phone ---- */
@media (max-width: 1100px) {
  .span-5, .span-6, .span-7 { grid-column: span 12; }
  .kpis, .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: sticky; top: 66px; z-index: 5; height: auto; display: flex; overflow-x: auto; gap: 4px; padding: 8px 12px;
    border-bottom: 1px solid var(--line); background: var(--surface);
  }
  .sidebar a { flex: 0 0 auto; }
  .sidebar-rule { display: none; }
  .brand-sub { display: none; }
  .summary { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .summary > div { width: 100%; }
  .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .filter-toggle { display: inline-flex; }
  .filter-toggle[aria-expanded="false"] + .filter-body { display: none; }
  .kpis, .stat-row { grid-template-columns: minmax(0, 1fr); }
  .filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field select { max-width: none; width: 100%; }
  .field input { width: 100%; }
  .field:first-child { grid-column: span 2; }
  .cat > summary { grid-template-columns: 12px minmax(0, 1fr); gap: 6px 10px; }
  .cat > summary > :not(:nth-child(1)) { grid-column: 2; }
  .coverage-tree .node > summary { flex-wrap: wrap; }
  .coverage-tree .node-counts { flex-basis: 100%; justify-content: flex-start; padding-left: 21px; }
  .rank li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .report-heading { padding: 18px; }
  .card { padding: 16px; }
  .env, .facts { grid-template-columns: minmax(0, 1fr); }
  .env dt, .facts dt { border-bottom: 0; padding-bottom: 0; }
}

/* ---- Motion only when wanted ---- */
@media (prefers-reduced-motion: no-preference) {
  .sidebar a, .pill-link, .round, .chip, .kpi, .stat, .card, .test-row { transition: background-color .15s, border-color .15s, box-shadow .18s; }
  .node > summary::before, .cat > summary::before { transition: transform .15s ease; }
  .skeleton { animation: shimmer 1.2s linear infinite; }
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Workspace design: quiet surfaces, a navy rail and a clear reading order ---- */
:root {
  --bg: #f4f6fa; --ink: #19283d; --muted: #59687b; --line: #dce3ed;
  --accent: #315bd6; --accent-soft: #edf2ff; --accent-line: #acbff5;
  --chart-passed: #5379db; --cov-covered: #5379db;
  --radius: 11px; --radius-lg: 20px; --gap: 22px; --pad: 24px;
  --shadow: 0 4px 18px rgba(25, 40, 61, .035);
  --rail: #15243b; --rail-ink: #e1e8f4; --rail-muted: #aabbd2;
}
body { background: radial-gradient(ellipse at 100% 0, var(--glow), transparent 45%), var(--bg); }
.topbar { min-height: 74px; padding-block: 16px; }
.brand { letter-spacing: -.02em; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; }
.brand-sub { margin-top: 3px; letter-spacing: .01em; }
.layout { grid-template-columns: 252px minmax(0, 1fr); background: linear-gradient(to right, var(--rail) 252px, transparent 252px); min-height: calc(100vh - 74px); }
.sidebar { top: 74px; height: calc(100vh - 74px); padding: 26px 16px; gap: 6px; }
.nav-caption { color: var(--rail-muted); font-size: 10px; letter-spacing: .16em; font-weight: 750; padding: 0 14px 10px; }
.sidebar a { color: var(--rail-ink); padding: 10px 14px; min-height: 46px; font-size: 13px; line-height: 1.4; }
.sidebar a:hover { background: #223650; }
.sidebar a[aria-current="page"] { color: #fff; background: #315bd6; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.sidebar .nav-icon { color: var(--rail-muted); font-size: 18px; }
.sidebar a[aria-current="page"] .nav-icon { color: #fff; }
.sidebar .sidebar-quiet { color: var(--rail-muted); }
.sidebar-rule { background: #34465f; margin-block: 16px 10px; }
.sidebar-note { margin: auto 8px 0; padding: 20px 0 0; border-top: 1px solid #34465f; display: grid; gap: 8px; color: var(--rail-muted); font-size: 12px; }
.sidebar-note strong { color: var(--rail-ink); font-size: 12px; }
.sidebar-note-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #52617a; border-radius: 10px; font-size: 11px; font-weight: 750; color: #fff; }
.sidebar { grid-template-rows: auto repeat(5, min-content) auto auto auto 1fr; }
.sidebar-note { align-self: end; }
.filterbar { margin: 24px clamp(16px, 3vw, 40px) 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.field-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.field select, .field input { background: var(--surface-3); border-color: transparent; min-height: 42px; }
.field select:focus-visible, .field input:focus-visible { border-color: var(--accent); }
.freshness { font-size: 11.5px; }
.freshness .button-quiet { min-height: 28px; font-size: 11.5px; border: 0; background: var(--surface-3); }
.report-heading { box-shadow: none; border: 0; background: none; padding: 8px 0 18px; margin-bottom: 4px; }
.eyebrow { font-size: 10px; letter-spacing: .12em; margin-bottom: 12px; }
h1 { font-size: clamp(28px, 3.1vw, 42px); letter-spacing: -.045em; }
.report-heading .lead { font-size: 13px; line-height: 1.7; max-width: 70ch; }
.overview-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions .button, .hero-actions .button-quiet { min-height: 42px; font-size: 12px; }
.hero-actions .button { gap: 10px; }
.snapshot-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 24px; padding-bottom: 14px; color: var(--muted); font-size: 12px; }
.snapshot-strip strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.kpis { gap: 16px; margin-bottom: 24px; }
.kpi { padding: 22px; gap: 10px; border-radius: 16px; box-shadow: none; border-top: 3px solid var(--tone, var(--accent)); }
.kpi::before { display: none; }
.kpi-value { font-size: clamp(26px, 2.5vw, 36px); letter-spacing: -.04em; }
.kpi-label { font-size: 11px; letter-spacing: .025em; }
.kpi-sub { font-size: 11.5px; line-height: 1.6; }
.kpi-change { font-size: 11px; }
.card-head { align-items: center; margin-bottom: 22px; }
.card-head h2 { font-size: 15px; }
.card-head h2::before { display: none; }
.card-head .meta { font-size: 10.5px; background: var(--surface-3); border: 0; border-radius: 999px; padding: 5px 10px; }
.summary { gap: 24px; }
.ring { width: 178px; height: 178px; }
.ring circle { stroke-width: 9; }
.legend li a { background: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 7px 0; }
.legend li a:hover { background: var(--accent-soft); }
.browser-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.browser-card { display: grid; gap: 12px; align-content: start; padding: 16px; border: 1px solid var(--line); background: var(--surface-3); border-radius: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
a.browser-card:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.browser-card-top, .browser-card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.browser-card-top { font-size: 13px; }
.browser-rate { font-weight: 750; color: var(--accent); }
.browser-card-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.browser-progress { display: block; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.browser-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--chart-passed); }
details.numbers { padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--line); }
details.numbers > summary { font-size: 12px; }
.feature-bars { gap: 20px; }
.feature-bars .stack { height: 10px; }
.legend-inline { margin-top: 22px; }
.legend-inline li { font-size: 11px; }
.attention li { padding: 12px; font-size: 12.5px; }
.suites { max-height: 360px; overflow-y: auto; scrollbar-gutter: stable; padding-right: 8px; }
.suite-name { font-size: 13px; }
.footer { font-size: 11px; line-height: 1.8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #111b2b; --ink: #eef3fb; --muted: #b5c2d7; --line: #34445d; --accent: #adc4ff; --accent-soft: #273958; --accent-line: #657da6; --chart-passed: #91b4ff; --cov-covered: #91b4ff; --rail: #0c1524; }
}
:root[data-theme="dark"] { --bg: #111b2b; --ink: #eef3fb; --muted: #b5c2d7; --line: #34445d; --accent: #adc4ff; --accent-soft: #273958; --accent-line: #657da6; --chart-passed: #91b4ff; --cov-covered: #91b4ff; --rail: #0c1524; }
@media (max-width: 1250px) {
  .overview-heading { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 1100px) {
  .summary { grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { top: 74px; height: auto; display: flex; padding: 8px 12px; background: var(--rail); border-bottom: 0; }
  .sidebar a { min-height: 40px; padding: 8px 12px; }
  .sidebar-note, .nav-caption { display: none; }
  .filterbar { margin-top: 16px; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 12px 16px; min-height: 74px; }
  .brand { font-size: 12px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
  .topbar-tools { gap: 6px; }
  .pill-link { padding: 0 8px; font-size: 11px; }
  .round { width: 36px; min-height: 36px; }
  .filterbar { padding: 12px; margin-bottom: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; gap: 8px; }
  .kpi-value { font-size: 24px; overflow-wrap: anywhere; }
  .kpi-label { font-size: 10px; }
  .kpi-sub { font-size: 10.5px; }
  .kpi-change { font-size: 10px; }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .ring { width: 160px; height: 160px; }
  .snapshot-strip { gap: 8px 16px; font-size: 11px; }
  .browser-cards { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .report-heading { padding: 8px 0 14px; }
  .card-head { margin-bottom: 18px; }
}

/* Approved hybrid: Light Studio data panels + Portfolio Canvas navigation. */
:root { --bg: #f8fafc; --chart-passed: #159968; --cov-covered: #4773df; --glow: rgba(115, 177, 226, .09); }
body { background: radial-gradient(ellipse at 15% 12%, var(--glow), transparent 40%), radial-gradient(ellipse at 100% 0, #fff3e833, transparent 35%), var(--bg); }
.layout { display: block; background: none; min-height: calc(100vh - 74px); }
.sidebar { display: flex; position: sticky; top: 74px; z-index: 5; height: auto; gap: 8px; padding: 10px clamp(16px, 4vw, 64px); background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.sidebar a { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; color: var(--muted); font-size: 13px; }
.sidebar a:hover { background: var(--surface-3); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.sidebar a[aria-current="page"] .nav-icon { color: var(--accent); }
.sidebar .nav-icon { color: var(--muted); }
.sidebar .sidebar-quiet { margin-left: auto; color: var(--muted); font-size: 12px; }
.nav-caption, .sidebar-note, .sidebar-rule { display: none; }
.content { max-width: 1600px; margin-inline: auto; }
.filterbar { background: linear-gradient(110deg, var(--surface), var(--surface-3)); border-radius: 16px; }
.filter-row .field:first-child { flex: 1; }
.filter-row .field:first-child select { width: 100%; max-width: 100%; }
.overview-heading { position: relative; padding: 20px 24px; border-radius: 18px; margin-bottom: 22px; overflow: hidden; background: linear-gradient(110deg, var(--accent-soft), var(--surface-3)); border: 1px solid var(--line); }
.overview-heading::after { content: ""; position: absolute; width: 170px; height: 170px; border: 24px solid var(--accent-line); border-radius: 50%; right: -65px; top: -100px; opacity: .18; pointer-events: none; }
.overview-heading h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.035em; }
.overview-heading .snapshot-strip { padding-bottom: 0; }
.kpi { border-top: 1px solid var(--line); padding: 22px 22px 22px 62px; }
.kpi::before { display: block; left: 20px; top: 24px; width: 28px; height: 28px; border-radius: 50%; background: var(--tone, var(--accent)); opacity: .16; }
.kpi::after { content: "↗"; position: absolute; left: 28px; top: 25px; color: var(--tone, var(--accent)); font-size: 16px; font-weight: 800; }
.kpi-passed .kpi-value { color: var(--passed); }
.browser-card { background: var(--surface); }
.browser-progress-fill { background: var(--chart-passed); }
.summary { grid-template-columns: auto minmax(0, 1fr); }
.footer { text-align: center; }
@media (min-width: 1250px) {
  .grid > .span-5:has(#results-title) { grid-column: span 4; }
  .grid > .span-7:has(#trend-title) { grid-column: span 5; }
  .grid > .span-6:has(#browsers-title) { grid-column: span 3; }
  .grid > .span-6:has(#features-title) { grid-column: span 7; }
  .grid > .span-5:has(#attention-title) { grid-column: span 5; }
  .browser-cards { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .summary > div { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --chart-passed: #6bd4ac; --passed: #81dfb8; }
}
:root[data-theme="dark"] { --chart-passed: #6bd4ac; --passed: #81dfb8; }
@media (max-width: 600px) {
  .sidebar { padding: 6px 12px; gap: 4px; }
  .sidebar a { padding: 8px 10px; font-size: 12px; }
  .overview-heading { padding: 18px; }
  .kpi { padding: 14px; padding-top: 40px; }
  .kpi::before { left: 14px; top: 12px; width: 20px; height: 20px; }
  .kpi::after { left: 18px; top: 10px; font-size: 14px; }
  .summary { grid-template-columns: minmax(0, 1fr); }
}

.browser-rate { color: var(--passed); }
.kpi-passed::after { content: "✓"; }
.kpi-failed::after, .kpi-error::after { content: "!"; }
.kpi-accent::after { content: "◷"; }
.card:has(#readiness-title) { grid-column: span 12; }
@media (min-width: 1250px) {
  .summary { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .summary .ring { width: 140px; height: 140px; }
  .summary .big-number { font-size: 28px; }
  .browser-card { padding: 12px; gap: 8px; }
}

/* Neutral hierarchy: headings and repository names use ink, status charts retain their meaning. */
:root { --heading-ink: #171717; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --heading-ink: #f1f3f7; }
}
:root[data-theme="dark"] { --heading-ink: #f1f3f7; }
h1, h2, h3, .eyebrow, .kpi-label, .feature-name, .browser-card-top strong, .suite-name, .suite-name a {
  color: var(--heading-ink);
}
.suite-name a { text-decoration: none; }
.suite-name a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.suite-name a:focus-visible { text-decoration: underline; }
.suite-meta a { color: var(--muted); }
.suite-outcomes { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; }
.suite-outcome { padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.suite-outcome-failed { color: var(--failed); background: var(--failed-soft); }
.suite-outcome-error { color: var(--error); background: var(--error-soft); }
.suite-row { gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.suite-row:last-child { border: 1px solid var(--line); padding-bottom: 12px; }
.suite-row:hover { background: var(--surface-3); }
.suites { gap: 8px; }
