/* Quality Intelligence dashboard. Colours are tokens so light and dark themes share one layout. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #d9dee6;
  --accent: #2f5bd3;
  --good: #1d7a46;
  --good-bg: #e3f4ea;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --neutral-bg: #eceff3;
  --focus: #2f5bd3;
  --radius: 10px;
  color-scheme: light;
}

/* Dark: by the system setting unless Light was chosen in the page, or chosen in the page */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e6eaf0;
    --muted: #a0abba;
    --border: #2d3644;
    --accent: #8fb0ff;
    --good: #6fd39b;
    --good-bg: #173326;
    --bad: #ff8f84;
    --bad-bg: #3a1d1b;
    --warn: #f2c35b;
    --warn-bg: #3a2f14;
    --neutral-bg: #252d39;
    --focus: #8fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161c;
  --surface: #1a2029;
  --text: #e6eaf0;
  --muted: #a0abba;
  --border: #2d3644;
  --accent: #8fb0ff;
  --good: #6fd39b;
  --good-bg: #173326;
  --bad: #ff8f84;
  --bad-bg: #3a1d1b;
  --warn: #f2c35b;
  --warn-bg: #3a2f14;
  --neutral-bg: #252d39;
  --focus: #8fb0ff;
  color-scheme: dark;
}

/* Compact tables (chosen in the page) */
body.compact td, body.compact th { padding-top: 3px; padding-bottom: 3px; }

* { box-sizing: border-box; }

/* The hidden attribute always wins over a display set by a class (pagers, notices) */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }

.top {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 650; }
.logo {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--surface); font-size: 13px; font-weight: 750;
}
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
nav a[aria-current="page"] { background: var(--neutral-bg); font-weight: 600; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
}
.filters label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
select, input[type="search"], input[type="text"] {
  min-width: 140px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
button {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
button.ghost { background: transparent; }

main { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.status { color: var(--muted); margin: 0 0 12px; }
.status:empty { display: none; }
/* The error message box only: "error" is also an outcome class (badges, dots, chart parts), and
   a bare .error gave those the box's padding, border and background */
.error[role="alert"] {
  padding: 12px 16px; border-radius: var(--radius); background: var(--bad-bg); color: var(--bad);
  border: 1px solid var(--bad);
}

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: inherit; display: block;
}
a.card:hover { border-color: var(--accent); }
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 26px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.card .detail { font-size: 13px; color: var(--muted); }
.card.group-title { grid-column: 1 / -1; padding: 0; border: 0; background: none; font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--accent); }

.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; background: var(--neutral-bg); color: var(--text);
}
.badge.passed, .badge.passing, .badge.automated { background: var(--good-bg); color: var(--good); }
.badge.failed, .badge.failing, .badge.error, .badge.no-tests { background: var(--bad-bg); color: var(--bad); }
.badge.skipped, .badge.not-run, .badge.not-automated, .badge.critical { background: var(--warn-bg); color: var(--warn); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.cards + .table-wrap { margin-top: 12px; }
h1.key { font-size: 17px; word-break: break-word; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; word-break: break-word; }
.key { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-word; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin: 0 0 12px; }
.toolbar label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }

.empty { padding: 24px; text-align: center; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips a { text-decoration: none; }
details summary { cursor: pointer; color: var(--accent); }
pre.trace { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--neutral-bg); padding: 8px; border-radius: 6px; }
dl.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 8px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

ul.reasons { margin: 0; padding-left: 18px; }
.badge.flaky-candidate, .badge.new-failure, .badge.recovered { background: var(--warn-bg); color: var(--warn); }
.badge.consistently-failing { background: var(--bad-bg); color: var(--bad); }
.badge.stable { background: var(--good-bg); color: var(--good); }
ol.strip { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 10px 0 6px; padding: 0; }
ol.strip a { display: block; width: 24px; height: 24px; border-radius: 3px; } /* WCAG 2.2 target size: 24 px */
ol.strip a.good { background: var(--good); }
ol.strip a.bad { background: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--text); border: 1px solid var(--warn); margin: 0 0 12px; }
.notice ul { margin: 4px 0 0; padding-left: 20px; }
.charts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
figure.chart { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
figure.chart figcaption { display: grid; gap: 2px; margin-bottom: 6px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; }
.chart-svg .line { fill: none; stroke-width: 2.5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0 0 4px; padding: 0; font-size: 13px; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.s-passed, .s-passing { fill: var(--good); stroke: var(--good); background: var(--good); }
.s-failed, .s-failing { fill: var(--bad); stroke: var(--bad); background: var(--bad); }
.s-error { fill: var(--warn); stroke: var(--warn); background: var(--warn); }
.s-not-run { fill: var(--muted); stroke: var(--muted); background: var(--muted); }
.s-skipped, .s-not-automated { fill: var(--muted); stroke: var(--muted); background: var(--muted); opacity: .45; }
.s-rate { fill: var(--accent); stroke: var(--accent); background: var(--accent); }
.s-duration { fill: #8a5cd6; stroke: #8a5cd6; background: #8a5cd6; }
.chart-svg .dot { stroke: var(--surface); stroke-width: 1.5; }

.databar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 24px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); }
.databar .inline { display: inline-flex; align-items: center; gap: 6px; }
.databar button { padding: 4px 12px; }
#data-stale { margin: 12px 24px 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .top, .filters, main, .foot, .databar { padding-left: 16px; padding-right: 16px; }
  #data-stale { margin-left: 16px; margin-right: 16px; }
  .filters label, .filters select { width: 100%; }
  .filters label { flex: 1 1 140px; }
  .card .value { font-size: 22px; }
}
.badge.complete { background: var(--good-bg); color: var(--good); }
.badge.incomplete { background: var(--bad-bg); color: var(--bad); }
section.pipeline { margin: 0 0 24px; }
section.pipeline h2 .badge { vertical-align: middle; }
tr.missing td { color: var(--bad); font-weight: 600; }
.readiness { border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 20px; background: var(--surface); }
.readiness.ready { border-left-color: var(--good); }
.readiness.at-risk, .readiness.unknown { border-left-color: var(--warn); }
.readiness.blocked { border-left-color: var(--bad); }
.readiness h2 { margin-top: 0; }
.readiness details { margin: 8px 0 12px; }
.readiness summary { cursor: pointer; font-weight: 600; }
.badge.Ready { background: var(--good-bg); color: var(--good); }
.badge.At-risk, .badge.Unknown { background: var(--warn-bg); color: var(--warn); }
.badge.Blocked { background: var(--bad-bg); color: var(--bad); }
tr.failing-rule td { color: var(--bad); }
details.pipeline { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; background: var(--surface); }
details.pipeline > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
details.pipeline > summary .sub { flex-basis: 100%; }
.pipeline-title { font-weight: 600; }
p.links { font-size: 13px; color: var(--muted); }
.status-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.status-filter a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); }
.status-filter a[aria-current="true"] { border-color: var(--accent, var(--text)); font-weight: 600; }
.badge.success, .badge.complete, .badge.fresh { background: var(--good-bg); color: var(--good); }
.badge.failure, .badge.incomplete, .badge.overdue { background: var(--bad-bg); color: var(--bad); }
.badge.cancelled { background: var(--warn-bg); color: var(--warn); }
ol.pattern { display: inline-flex; flex-wrap: wrap; gap: 3px; list-style: none; padding: 0; margin: 0 8px 0 0; }
ol.pattern .dot { width: 18px; height: 18px; border-radius: 4px; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.dot.passed { background: var(--good-bg); color: var(--good); }
.dot.failed, .dot.error { background: var(--bad-bg); color: var(--bad); }
.dot.skipped { background: var(--warn-bg); color: var(--warn); }
.badge.newly-failing, .badge.still-failing { background: var(--bad-bg); color: var(--bad); }
.badge.recovered, .badge.new-test { background: var(--good-bg); color: var(--good); }
.badge.slower, .badge.newly-flaky, .badge.removed-test { background: var(--warn-bg); color: var(--warn); }
button.copy { margin-right: 8px; }
.table-tools { margin: 0 0 6px; }
th button.sort { all: unset; cursor: pointer; font-weight: inherit; }
th button.sort::after { content: " \2195"; opacity: 0.35; }
th[aria-sort="ascending"] button.sort::after { content: " \2191"; opacity: 1; }
th[aria-sort="descending"] button.sort::after { content: " \2193"; opacity: 1; }
th button.sort:focus-visible, a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.pagerbox { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
details.columns > div { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.quick-dates { display: inline-flex; gap: 4px; align-items: end; }
.active-filters { margin: 8px 24px 0; padding: 0; }
.active-filters .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.chip-remove { border: 0; background: none; padding: 0 6px; font-size: 16px; line-height: 1; cursor: pointer; color: var(--muted); }
@media (max-width: 640px) { .active-filters { margin-left: 16px; margin-right: 16px; } }
details.matrix { margin: 0 0 16px; }
details.matrix > summary { cursor: pointer; font-weight: 600; }
/* Owner groups of the prioritised gaps: stacked toggles, each a full 24 px touch target (WCAG 2.5.8) */
details.gap-owner { margin: 0 0 8px; }
details.gap-owner > summary { cursor: pointer; font-weight: 600; min-height: 24px; padding: 4px 0; }
/* Read-only issue draft (Stability page): full width, wraps long test names, follows the theme */
textarea.issue-body {
  display: block; width: 100%; box-sizing: border-box; font: 12.5px/1.5 ui-monospace, monospace;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px;
}
.badge.stale { background: var(--warn-bg); color: var(--warn); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.bar-link:focus-visible rect, a.bar-link:hover rect { stroke: var(--text); stroke-width: 2; }
a.bar-link:focus { outline: none; }
/* The page heading takes the focus after navigation (for screen readers); it is not a control */
h1[tabindex="-1"]:focus { outline: none; }
.prefs { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.prefs select { min-width: 0; padding: 2px 6px; }
@media (max-width: 640px) { .prefs { order: 3; width: 100%; } }
.catalog-notice { margin: 0; padding: 6px 24px; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-bottom: 1px solid var(--border); }
/* M12: global search, breadcrumbs, findings */
.global-search { display: flex; gap: 6px; align-items: center; }
.global-search input { width: 16rem; max-width: 100%; }
@media (max-width: 640px) { .global-search { order: 4; width: 100%; } .global-search input { flex: 1; width: auto; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--muted); }
.crumbs li { min-width: 0; overflow-wrap: anywhere; }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.hits { list-style: none; margin: 0 0 16px; padding: 0; }
.hits li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
mark { background: var(--warn-bg); color: inherit; padding: 0 1px; }
.badge.open { background: var(--bad-bg); color: var(--bad); }
.badge.suspected, .badge.unknown { background: var(--warn-bg); color: var(--warn); }
.badge.resolved { background: var(--neutral-bg); color: var(--muted); }
table.pair th[scope="row"] { text-align: left; white-space: nowrap; color: var(--muted); font-weight: 600; }

/* Shared interface tokens and enterprise layout refinements */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --surface-raised: #ffffff;
  --shadow-panel: 0 10px 30px rgb(17 24 39 / 14%);
  --content-width: 1400px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --surface-raised: #242d39; }
}
:root[data-theme="dark"] { --surface-raised: #242d39; }

body { font-family: var(--font-sans); }
main { max-width: var(--content-width); }
h1 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.025em; }
h2 { margin-top: var(--space-6); }

.top { gap: var(--space-3) var(--space-5); padding-top: var(--space-4); padding-bottom: var(--space-3); }
.mobile-nav { flex: 1 0 100%; min-width: 0; }
.mobile-nav > summary { display: none; }
.mobile-nav > summary::after { content: "Show menu"; float: right; color: var(--muted); font-size: 13px; font-weight: 400; }
.mobile-nav[open] > summary::after { content: "Hide menu"; }
.section-nav { flex: 1 0 100%; align-items: center; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.section-nav > a, .nav-group > summary { border-radius: 8px; color: var(--text); text-decoration: none; padding: 6px 10px; }
.section-nav a { text-decoration: none; }
.section-nav a:hover, .nav-group > summary:hover { background: var(--neutral-bg); }
.section-nav a[aria-current="page"] { background: var(--accent); color: var(--surface); font-weight: 650; }
.nav-group { position: relative; }
.nav-group > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; color: var(--muted); }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-group[open] { display: flex; align-items: center; gap: 2px; }

.preset-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 10px 24px 6px; background: var(--surface); }
.preset-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: var(--space-1); }
.preset-bar button { padding: 5px 10px; font-size: 13px; }
.preset-bar button:hover { border-color: var(--accent); color: var(--accent); }
.filter-panel { background: var(--surface); border-bottom: 1px solid var(--border); }
.filter-panel > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 24px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 650; list-style-position: inside; }
.filter-panel > summary::after { content: "Show filters"; color: var(--muted); font-size: 12px; font-weight: 400; }
.filter-panel[open] > summary::after { content: "Hide filters"; }
.filter-panel > summary:hover { background: var(--bg); }
.filter-panel > summary .sub { font-weight: 400; }
.filter-panel .filters { border: 0; padding-top: 8px; }
.filters label { min-width: 132px; }

.card-shell { position: relative; min-width: 0; }
.card-shell > .card { height: 100%; }
.card .label { padding-right: 26px; }
.help-tip { position: absolute; top: 9px; right: 10px; z-index: 3; }
.help-tip > summary { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 700; list-style: none; cursor: pointer; }
.help-tip > summary::-webkit-details-marker { display: none; }
.help-popover { position: absolute; top: 28px; right: 0; width: min(300px, calc(100vw - 40px)); padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-panel); font-size: 13px; }
.help-popover p { margin: 4px 0 0; color: var(--muted); }
.onboarding, .data-health, .action-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.onboarding { margin: 12px 0 18px; padding: 12px 16px; border-left: 4px solid var(--accent); }
.onboarding > summary, .action-group > summary { font-weight: 650; cursor: pointer; }
.onboarding ol { margin-bottom: 0; padding-left: 22px; }
.onboarding li + li { margin-top: 4px; }
.data-health { margin: 16px 0 20px; padding: 4px 16px 12px; }
.data-health h2 { margin-top: 12px; }
.data-health .notice { margin: 10px 0; }
.executive-actions { margin: 16px 0 22px; }
.executive-actions a { align-self: center; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.quick-actions a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.quick-actions a:hover { border-color: var(--accent); }
.quick-actions .sub { color: var(--muted); }
.action-group { margin: 0 0 14px; padding: 12px 14px; }
.action-group > summary { font-size: 16px; }
.action-group .table-block { margin-top: 10px; }
.copy-link { white-space: nowrap; padding: 4px 8px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; }
.badge.passed::before, .badge.passing::before, .badge.automated::before, .badge.fresh::before, .badge.Ready::before { background: var(--good); }
.badge.failed::before, .badge.failing::before, .badge.error::before, .badge.incomplete::before, .badge.Blocked::before { background: var(--bad); }
.badge.skipped::before, .badge.not-run::before, .badge.not-automated::before, .badge.suspected::before, .badge.unknown::before, .badge.overdue::before, .badge.At-risk::before { background: var(--warn); }
.badge.passed::before, .badge.passing::before, .badge.automated::before, .badge.fresh::before, .badge.Ready::before,
.badge.failed::before, .badge.failing::before, .badge.error::before, .badge.incomplete::before, .badge.Blocked::before,
.badge.skipped::before, .badge.not-run::before, .badge.not-automated::before, .badge.suspected::before, .badge.unknown::before, .badge.overdue::before, .badge.At-risk::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%;
}
.detail-back { margin: 0 0 10px; font-size: 13px; }
.detail-back a { font-weight: 600; text-decoration: none; }
.crumbs { margin-bottom: 10px; }
.crumbs ol { margin-bottom: 0; }

dialog { width: min(700px, calc(100vw - 32px)); max-height: min(80vh, 760px); overflow: auto; padding: 22px 24px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-panel); }
dialog::backdrop { background: rgb(10 15 25 / 58%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-head h2 { margin: 0; }
.glossary { display: grid; grid-template-columns: minmax(130px, .5fr) 1.5fr; gap: 10px 16px; margin: 18px 0 0; }
.glossary dt { font-weight: 650; }
.glossary dd { margin: 0; color: var(--muted); }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.skeleton { height: 108px; border-radius: var(--radius); background: linear-gradient(100deg, var(--neutral-bg) 30%, var(--surface) 50%, var(--neutral-bg) 70%); background-size: 220% 100%; animation: skeleton-shimmer 1.6s ease-in-out infinite; }
@keyframes skeleton-shimmer { to { background-position-x: -220%; } }

@media (max-width: 720px) {
  .top, .filters, main, .foot, .databar { padding-left: 16px; padding-right: 16px; }
  .mobile-nav > summary { display: block; padding: 8px 0; cursor: pointer; font-weight: 650; }
  .mobile-nav:not([open]) .section-nav { display: none; }
  .mobile-nav[open] .section-nav { border-top: 0; padding-top: 0; }
  .preset-bar { padding-left: 16px; padding-right: 16px; }
  .filter-panel > summary { padding-left: 16px; padding-right: 16px; }
  .section-nav { align-items: flex-start; }
  .nav-group[open] { align-items: flex-start; flex-direction: column; }
  .nav-links { padding-left: 8px; }
  .section-nav > a, .nav-group > summary { padding: 5px 8px; }
  .filter-panel .filters { padding-top: 10px; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}



/* Historical execution analytics: overview cards and responsive investigation panels. */
.execution-panel { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-block: 16px; }
.execution-panel h2 { margin-top: 0; }
.execution-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.execution-grid > .execution-panel { margin-block: 0; }
.execution-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.execution-cards .value { overflow-wrap: anywhere; }
.execution-donut { display: block; width: min(100%, 210px); margin: 16px auto; transform: rotate(-90deg); }
.execution-ring, .execution-slice { fill: none; stroke-width: 18; }
.execution-ring { stroke: var(--neutral-bg); }
/* Outcome modifiers carry their own prefix: a bare "error" class also gets the page-wide .error
   message box (padding, border, background) */
.execution-slice-passed { stroke: var(--good); }
.execution-slice-failed { stroke: var(--bad); }
.execution-slice-error { stroke: var(--warn); }
.execution-slice-skipped { stroke: var(--muted); }
.execution-panel .sub, .execution-panel .key { overflow-wrap: anywhere; }
@media (max-width: 1000px) { .execution-grid, .execution-equal { grid-template-columns: minmax(0, 1fr); } }

.execution-ranking table { min-width: 620px; }
.execution-ranking td:first-child, .execution-ranking th:first-child { min-width: 260px; }
.execution-scroll-hint { display: none; }
@media (max-width: 720px) { .execution-scroll-hint { display: block; } }

/* Shared visual language with niranjankagri.github.io: warm paper, teal, soft surfaces. */
:root {
  --bg: #fbfaf7; --surface: #fffefa; --text: #172c28; --muted: #4c625d; --border: #d8e2dd;
  --accent: #08665e; --focus: #08665e; --accent-ink: #ffffff; --accent-soft: #e5f2ed;
  --neutral-bg: #eef2ef; --glow: rgba(66, 192, 162, .12); --radius: 14px;
  --good: #16744e; --bad: #b42318; --warn: #895600;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111918; --surface: #1a2422; --text: #eff7f3; --muted: #b6c8c1; --border: #344640;
    --accent: #79dfc2; --focus: #79dfc2; --accent-ink: #10241e; --accent-soft: #203b34;
    --neutral-bg: #222e2b; --glow: rgba(93, 220, 185, .10);
    --good: #79dfb2; --bad: #ff9a91; --warn: #f2c35b;
  }
}
:root[data-theme="dark"] {
  --bg: #111918; --surface: #1a2422; --text: #eff7f3; --muted: #b6c8c1; --border: #344640;
  --accent: #79dfc2; --focus: #79dfc2; --accent-ink: #10241e; --accent-soft: #203b34;
  --neutral-bg: #222e2b; --glow: rgba(93, 220, 185, .10);
  --good: #79dfb2; --bad: #ff9a91; --warn: #f2c35b;
}
body { background: radial-gradient(ellipse at 95% 10%, var(--glow), transparent 55%), var(--bg); }
button, input, select { min-height: 36px; }
button { transition: background-color .16s, border-color .16s; }
button:hover { border-color: var(--accent); }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.logo, .section-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.portfolio-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .05em; }
.primary-nav { font-size: 14px; }
.primary-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.top { background: var(--surface); }
.dashboard-mode .top { gap: 10px 20px; padding-block: 14px; }
.dashboard-mode .global-search, .dashboard-mode .preset-bar { display: none; }
.dashboard-mode .mobile-nav { flex-basis: auto; }
.dashboard-mode .mobile-nav > summary { display: block; padding: 6px 0; font-size: 13px; }
.dashboard-mode .mobile-nav > summary::after { content: " +"; padding-left: 8px; }
.dashboard-mode .mobile-nav[open] { flex-basis: 100%; }
.dashboard-mode .mobile-nav[open] > summary::after { content: " −"; }
.dashboard-mode .filter-panel { display: none; }
.dashboard-mode.dashboard-advanced .filter-panel { display: block; }
.dashboard-mode .active-filters:empty { display: none; }
.dashboard-mode .databar { font-size: 11px; padding-block: 8px; background: var(--bg); }
.dashboard-mode .catalog-notice { font-size: 11px; padding-block: 6px; }
.dashboard-mode main { max-width: 1500px; padding-top: 24px; }
.dashboard-hero { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; padding: 26px 30px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(115deg, var(--surface) 50%, var(--accent-soft)); }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.dashboard-hero h1 { font-size: clamp(26px, 3vw, 38px); font-weight: 750; line-height: 1.15; }
.dashboard-hero .lead { margin: 10px 0 0; font-size: 16px; }
.portfolio-return { font-size: 13px; font-weight: 600; text-decoration: none; }
.execution-navigator { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 20px 0 28px; overflow: hidden; }
.scope-step { min-width: 0; padding: 15px 20px; }
.scope-step + .scope-step { border-top: 1px solid var(--border); }
.scope-step-heading { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.scope-step h2 { margin: 0; font-size: 13px; font-weight: 650; }
.step-number { font-size: 10px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-weight: 700; }
.scope-choices { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 4px 4px 10px; scrollbar-width: thin; scrollbar-color: var(--accent) var(--neutral-bg); }
.scope-choice { flex: 0 0 auto; max-width: 290px; white-space: normal; text-align: left; min-height: 40px; padding: 8px 14px; font-size: 13px; border-radius: 9px; text-transform: none; background: var(--bg); }
.scope-choice[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scope-step .sub { margin: 3px 0 0; font-size: 11px; }
.dashboard-heading, .panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.dashboard-heading { margin: 20px 0 16px; }
.dashboard-heading h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.dashboard-heading .sub { margin: 4px 0 0; font-size: 12px; }
.dashboard-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.dashboard-actions button { font-size: 12px; }
.execution-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.execution-cards .card { min-width: 0; box-shadow: 0 4px 18px rgba(22, 48, 41, .035); border-radius: 12px; border-top: 3px solid var(--accent); }
.execution-cards .value { font-size: clamp(22px, 2vw, 30px); letter-spacing: -.03em; }
.execution-cards .detail { font-size: 11px; }
.execution-cards .outcome-passed { border-top-color: var(--good); }
.execution-cards .outcome-failed { border-top-color: var(--bad); }
.execution-cards .outcome-error { border-top-color: var(--warn); }
.execution-cards .outcome-skipped { border-top-color: var(--muted); }
.execution-panel { box-shadow: 0 5px 18px rgba(22, 48, 41, .035); }
.execution-panel h2 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.chart-overview { margin-top: 20px; align-items: stretch; }
.chart-overview .execution-panel { margin: 0; }
.panel-heading h2 { margin: 0; }
.panel-heading button { font-size: 11px; }
.donut-layout { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(190px, 1fr); align-items: center; gap: 16px; }
.donut-visual { position: relative; min-width: 0; }
.execution-donut { width: min(100%, 240px); margin: 20px auto; }
.donut-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; pointer-events: none; }
.donut-center strong { font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -.04em; }
.donut-center span { color: var(--muted); font-size: 11px; }
.execution-slice { cursor: pointer; transition: opacity .18s, stroke-width .18s; }
.execution-slice:hover { stroke-width: 22; }
.execution-slice.slice-muted { opacity: .22; }
.donut-legend { display: grid; gap: 8px; }
.legend-choice { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 6px 10px; text-align: left; padding: 10px; background: var(--bg); border-radius: 10px; font-size: 12px; }
.legend-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.legend-choice .sub { grid-column: 2 / -1; margin: 0; font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot-passed { background: var(--good); }
.status-dot-failed { background: var(--bad); }
.status-dot-error { background: var(--warn); }
.donut-selection { color: var(--accent); font-size: 12px; min-height: 36px; }
.status-panel > .sub { font-size: 11px; }
.ranking-options { margin: 28px 0 12px; }
.ranking-options select { max-width: 100%; }
.ranking-options label:first-child { min-width: 0; max-width: 100%; width: min(100%, 400px); }
.ranking-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ranking-grid > .execution-panel { margin: 0; }
.ranking-bars { display: grid; gap: 17px; margin-block: 20px; }
.ranking-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 5px 12px; }
.ranking-label.key { font-family: inherit; font-size: 12px; line-height: 1.4; color: var(--text); text-decoration: none; font-weight: 600; }
.ranking-label:hover { color: var(--accent); text-decoration: underline; }
.ranking-bar strong { font-size: 12px; color: var(--accent); white-space: nowrap; }
.ranking-track { display: block; grid-column: 1 / -1; height: 6px; border-radius: 8px; overflow: hidden; background: var(--neutral-bg); }
.ranking-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; min-width: 1px; }
/* Own modifier names: a bare "error" class would also get the page-wide .error message box
   (padding + border), which made the fill overflow behind the bar's caption */
.ranking-fill-failed { background: var(--bad); }
.ranking-fill-error { background: var(--warn); }
.ranking-bar > .sub { grid-column: 1 / -1; font-size: 10px; margin: 0; overflow-wrap: anywhere; }
.ranking-details { border-top: 1px solid var(--border); padding-top: 12px; }
.ranking-details > summary { font-size: 12px; font-weight: 600; }
.ranking-details[open] > summary { margin-bottom: 12px; }
.ranking-details .toolbar label { min-width: 0; max-width: 100%; }
.ranking-details input { min-width: 0; max-width: 100%; }
.dashboard-notes { margin: 24px 0 10px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; font-size: 12px; color: var(--muted); background: var(--surface); }
.dashboard-notes > summary { font-weight: 600; }
@media (max-width: 1200px) {
  .execution-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ranking-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .dashboard-mode .top { padding: 12px 16px; }
  .primary-nav { flex-basis: 100%; gap: 2px; font-size: 12px; }
  .primary-nav a { padding: 6px 8px; }
  .dashboard-hero { padding: 22px 20px; }
  .dashboard-hero h1 { font-size: 28px; }
  .dashboard-hero .lead { font-size: 14px; }
  .execution-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .execution-cards .card { padding: 12px; }
  .execution-cards .value { font-size: 24px; }
  .scope-step { padding: 12px; }
  .scope-choice { max-width: 240px; }
  .donut-layout { grid-template-columns: minmax(0, 1fr); }
  .execution-donut { width: 210px; }
  .donut-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-choice { grid-template-columns: 8px minmax(0, 1fr); }
  .legend-choice strong { grid-column: 2; }
  .execution-panel { padding: 16px; }
  .ranking-grid { grid-template-columns: minmax(0, 1fr); }
  .prefs { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  button, .execution-slice { transition: none; }
}
/* Catalog dimensions do not filter recorded execution history. */
.dashboard-mode .filters label:has(select[name="feature"]),
.dashboard-mode .filters label:has(select[name="owner"]),
.dashboard-mode .filters label:has(select[name="criticality"]),
.dashboard-mode .filters label:has(select[name="test_type"]) { display: none; }

.report-home-link { display: inline-block; padding: 8px 16px; font-weight: 600; }
