:root {
  color-scheme: light;
  --ink: #223c52;
  --muted: #526579;
  --teal: #00796f;
  --teal-soft: #e2f2ef;
  --line: #d4dfe7;
  --ground: #edf2f5;
  --white: #fff;
  --amber: #875712;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--ink); padding: 8px 13px; }
button:hover { border-color: var(--teal); background: var(--teal-soft); }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid #168fcd; outline-offset: 3px; }
.view-nav { display: flex; gap: 24px; padding: 10px max(28px, calc((100vw - 1624px) / 2)); background: white; border-bottom: 1px solid var(--line); }
.view-nav a { color: var(--muted); text-decoration: none; padding: 3px 0; }
.view-nav a[aria-current] { color: var(--teal); font-weight: 650; border-bottom: 2px solid var(--teal); }
.view-nav a:hover { text-decoration: underline; }
.check-scope { color: var(--muted); max-width: 850px; margin-bottom: 18px; }
.check-picker { align-items: end; }
.check-picker label { flex: 1; max-width: 700px; }
.check-picker select { width: 100%; }
.check-verdict { border-left: 5px solid; padding: 15px 20px; margin: 20px 0; }
.check-verdict.fail { background: #fff0d9; border-color: var(--amber); }
.check-verdict.pass { background: var(--teal-soft); border-color: var(--teal); }
.check-verdict h2 { font-size: 21px; margin-bottom: 4px; }
.rule-panel { padding: 17px 20px; margin-bottom: 20px; }
.rule-results { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 30px; }
.rule-results li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.check-status { font-size: 12px; white-space: nowrap; font-weight: 650; }
.check-status.fail { color: var(--amber); }
.check-status.pass { color: var(--teal); }
.bom-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.bom-panel, .findings-panel { padding: 20px; min-width: 0; }
.bom-tree, .bom-tree ul { list-style: none; margin: 0; padding: 0; }
.bom-tree ul { padding-left: 20px; border-left: 1px solid var(--line); margin-left: 10px; }
.bom-node { margin: 10px 0; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 4px; padding: 12px 14px; overflow-wrap: anywhere; }
.bom-node.has-problems { border-left-color: var(--amber); background: #fffbf3; }
.bom-node-heading { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bom-node p { margin-top: 4px; font-size: 12px; }
.bom-meta, .bom-document { color: var(--muted); }
.bom-problem, .blocked-document { color: #80500c; }
.bom-document { padding-top: 5px; border-top: 1px solid var(--line); }
.check-finding { border-top: 1px solid var(--line); padding: 16px 0; }
.check-finding:first-child { margin-top: 12px; }
.check-finding p { font-size: 13px; max-width: 80ch; }
.check-finding h3 { margin-bottom: 5px; }
.check-finding h4 { font-size: 12px; margin: 11px 0 4px; color: var(--teal); }
.finding-path { color: var(--muted); overflow-wrap: anywhere; margin-bottom: 8px; }
.finding-evidence { padding: 8px 10px; background: #f1f5f8; margin-bottom: 8px; overflow-wrap: anywhere; }
.prevented-cause { font-weight: 600; }
.check-empty { margin: 15px 0; }
@media (max-width: 950px) { .bom-workspace { grid-template-columns: 1fr; } .rule-results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .view-nav { padding: 10px 16px; } .check-picker label { flex-basis: 100%; min-width: 0; } .rule-results { grid-template-columns: 1fr; } .bom-panel, .findings-panel { padding: 15px; } .bom-tree ul { padding-left: 10px; margin-left: 5px; } }
.skip { position: fixed; top: -80px; left: 20px; z-index: 10; padding: 12px; background: white; color: var(--ink); }
.skip:focus { top: 8px; }
.topbar { background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; padding: 17px max(28px, calc((100vw - 1624px) / 2)); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 650; }
.brand-mark { color: #79d5c9; font-size: 28px; line-height: 1; }
.brand-divider { height: 22px; border-left: 1px solid #63788b; margin: 0 4px; }
.brand-sub { font-size: 14px; font-weight: 400; color: #d6e2eb; }
.demo-badge { font-size: 12px; padding: 3px 10px; border: 1px solid #69879c; border-radius: 4px; color: #e4edf4; }
main { max-width: 1680px; margin: 0 auto; padding: 25px 28px 20px; }
h1 { font-family: Bahnschrift, "Segoe UI", Arial, sans-serif; font-size: 34px; font-weight: 600; letter-spacing: -.7px; line-height: 1.2; margin: 0 0 7px; }
h2 { font-size: 17px; font-weight: 650; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.pipeline { display: flex; gap: 13px; align-items: center; font-size: 14px; color: var(--muted); }
.pipeline span { color: var(--teal); }
.snapshot-label { font-size: 12px; color: var(--muted); text-align: right; }
.snapshot-label strong { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.snapshot-label span { display: block; font-size: 11px; margin-top: 2px; }
.totals { display: flex; background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 15px 0; margin-bottom: 20px; }
.totals > div { flex: 1; padding: 0 24px; border-right: 1px solid var(--line); }
.totals > div:last-child { border: 0; }
.totals strong { display: block; font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 29px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals span { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }
.open-dot { background: #b37b21; }
.investigating-dot { background: #367cc0; }
.resolved-dot { background: var(--teal); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; align-items: start; }
.causes-panel, .trend-panel { padding: 20px 22px; min-height: 341px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 13px; }
.panel-heading p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.count-label { font-size: 12px; white-space: nowrap; color: var(--muted); }
.cause-bars { display: flex; flex-direction: column; gap: 3px; }
.cause-bar { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(90px, 1fr) 26px; gap: 12px; align-items: center; border: 0; background: transparent; padding: 4px 0; text-align: left; font-size: 12px; width: 100%; border-radius: 3px; }
.cause-bar:hover { background: #f1f7f7; }
.cause-bar[aria-pressed="true"] .cause-name { font-weight: 700; color: var(--teal); }
.bar-track { height: 11px; background: #edf3f5; border-radius: 2px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--teal); border-radius: 2px; }
.cause-bar.unknown .bar-fill { background: #8b9baa; }
.cause-value { text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 20px; color: var(--muted); font-size: 11px; margin-top: 15px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.line-key { display: inline-block; width: 18px; height: 3px; background: var(--teal); }
.unresolved-key { background: #7890a5; }
#trend-chart svg { display: block; width: 100%; height: 195px; overflow: visible; margin: 7px 0 0; }
.trend-data { font-size: 11px; color: var(--muted); }
.trend-data summary { cursor: pointer; width: fit-content; }
.trend-data table { margin-top: 12px; }
.trend-data td, .trend-data th { padding: 4px 8px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#results-count { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 12px; align-items: end; margin-bottom: 18px; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; gap: 5px; }
.filters select, .filters input { height: 37px; background: white; color: var(--ink); border: 1px solid #b7c7d4; border-radius: 5px; padding: 6px 9px; font-size: 13px; min-width: 137px; }
#cause { width: 249px; }
.primary { background: var(--teal); color: white; border-color: var(--teal); }
.primary:hover { background: #005e56; color: white; }
.quiet { background: transparent; }
.workspace { display: grid; grid-template-columns: minmax(580px, 1.5fr) minmax(360px, 1fr); gap: 20px; align-items: start; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); background: #f7fafb; font-weight: 600; font-size: 11px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.failure-table td { padding: 11px 13px; border-bottom: 1px solid #e5ecf1; font-size: 12px; vertical-align: middle; }
.failure-table tr.selected td { background: #eaf5f2; }
.failure-table td:first-child { border-left: 3px solid transparent; }
.failure-table tr.selected td:first-child { border-left-color: var(--teal); }
.part-link { display: inline; border: 0; padding: 0; background: none; color: var(--teal); font-weight: 650; border-radius: 1px; white-space: nowrap; }
.part-link:hover { text-decoration: underline; background: none; }
.part-name { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; max-width: 165px; }
.revision { color: var(--muted); margin-left: 4px; font-weight: 400; }
.cad-cell { white-space: nowrap; font-size: 10px !important; }
.status { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status.open { background: #fff0d9; color: #78500f; }
.status.investigating { background: #e9f1ff; color: #295f8c; }
.status.resolved { background: #e4f4ed; color: #286f53; }
.date-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.date-cell span { display: block; font-size: 10px; color: var(--muted); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; font-size: 11px; color: var(--muted); gap: 10px; }
.pagination > div { display: flex; gap: 6px; }
.pagination button { font-size: 12px; padding: 5px 11px; }
.detail-panel { padding: 21px 23px; border-top: 3px solid var(--teal); scroll-margin-top: 20px; }
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.detail-panel h2 { font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 22px; margin-bottom: 1px; }
.detail-part-name { color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 11px; margin: 0 0 16px; }
.detail-meta dt { color: var(--muted); margin-bottom: 1px; }
.detail-meta dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.detail-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.raw-message { font: 11px/1.6 Consolas, "Cascadia Mono", monospace; background: #f1f5f8; padding: 12px; border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: #304960; }
.confidence { font-size: 10px; font-weight: 500; color: var(--muted); background: #edf3f6; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.detail-section p { font-size: 12px; line-height: 1.65; }
.diagnosis-label { font-weight: 650; font-size: 14px !important; margin-bottom: 5px; }
.evidence { color: var(--muted); background: #f5f8fa; padding: 8px 10px; margin-top: 9px; overflow-wrap: anywhere; }
.owner { color: var(--teal); font-size: 11px !important; font-weight: 650; margin-bottom: 5px; }
.empty { padding: 26px 20px; color: var(--muted); }
.empty p { font-size: 12px; }
.error { margin: 0 0 16px; color: #8b302e; background: #fff0ee; border: 1px solid #e9c5c0; padding: 12px 16px; border-radius: 5px; }
footer { color: var(--muted); font-size: 11px; margin: 24px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .detail-panel { max-width: none; }
  .charts { gap: 14px; }
  .cause-bar { grid-template-columns: minmax(155px, 1.6fr) minmax(40px, 1fr) 22px; gap: 8px; font-size: 11px; }
}
@media (max-width: 760px) {
  main { padding: 20px 16px; }
  .topbar { padding: 14px 16px; }
  .brand { gap: 8px; font-size: 16px; }
  .brand-sub, .brand-divider { display: none; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 18px; }
  .snapshot-label { text-align: left; }
  .snapshot-label span { display: none; }
  h1 { font-size: 30px; }
  .totals { flex-wrap: wrap; row-gap: 15px; }
  .totals > div { flex: 1 0 30%; padding: 0 15px; }
  .totals > div:nth-child(3) { border: 0; }
  .totals strong { font-size: 25px; }
  .charts { grid-template-columns: 1fr; }
  .causes-panel, .trend-panel { min-height: 0; padding: 17px; }
  .filters { gap: 10px; }
  .filters label { flex: 1 1 130px; }
  .filters label:first-child { flex-basis: 100%; }
  #cause { width: 100%; }
  .filters select, .filters input { width: 100%; min-width: 0; }
  .workspace { min-width: 0; }
  .history-panel { min-width: 0; }
  .failure-table { min-width: 660px; }
  .detail-panel { padding: 18px; }
  .list-heading { gap: 10px; align-items: start; }
}
