:root {
  color-scheme: light;
  --page: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --text: #1e2533;
  --muted: #667085;
  --quiet: #98a2b3;
  --line: #e1e5eb;
  --line-strong: #cbd2dc;
  --nav: #202632;
  --indigo: #5556d9;
  --indigo-dark: #4546b9;
  --indigo-soft: #f0efff;
  --red: #cf3f4f;
  --red-soft: #fff1f2;
  --amber: #a96710;
  --amber-soft: #fff7e6;
  --green: #18845f;
  --green-soft: #eaf8f2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--text); background: var(--page); font-size: 14px; line-height: 1.45; }
button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(85,86,217,.3); outline-offset: 2px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; color: white; background: #32339c; border-radius: 6px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.project-links { display: flex; gap: 12px; }
.project-links a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: inherit; font-size: 12px; }

.product-bar { min-height: 60px; display: grid; grid-template-columns: 210px minmax(0,1fr) auto; align-items: center; gap: 24px; padding: 0 clamp(18px,3vw,42px); color: #f7f8fb; background: var(--nav); border-bottom: 1px solid #303848; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 15px; font-weight: 720; letter-spacing: -.02em; text-decoration: none; }
.brand-sigil { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--indigo); font-size: 10px; font-weight: 750; }
.release-id { display: flex; align-items: center; gap: 10px; min-width: 0; color: #aeb7c6; font-size: 12px; }
.release-id span { color: #fff; font-weight: 600; }
.release-id b { overflow: hidden; font-weight: 450; text-overflow: ellipsis; white-space: nowrap; }
.export-button { min-height: 36px; padding: 7px 12px; color: #f7f8fb; border: 1px solid #5d6677; border-radius: 7px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; }
.export-button:hover { border-color: #8e98aa; background: #2a3140; }

.release-room { width: min(1480px,calc(100% - 40px)); margin: 24px auto 36px; }
.report-masthead { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(310px,.7fr) 210px; align-items: center; gap: 26px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 10px 10px 0 0; background: var(--surface); }
.folio, .section-number { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
h1 { margin: 0; font-size: clamp(24px,2.5vw,34px); line-height: 1.15; letter-spacing: -.03em; }
.standfirst { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.report-meta { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.report-meta div { min-width: 0; padding: 10px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.report-meta div:last-child { border-right: 0; }
.report-meta dt { color: var(--muted); font-size: 10px; font-weight: 600; }
.report-meta dd { margin: 3px 0 0; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.decision-block { padding: 13px 14px; border: 1px solid #f1b8be; border-radius: 8px; background: var(--red-soft); }
.decision-block > span, .decision-block small { display: block; color: var(--muted); font-size: 10px; }
.decision-block strong { display: block; margin: 4px 0 3px; color: var(--red); font-size: 15px; }
.decision-block strong[data-pass="true"] { color: var(--green); }
.decision-block:has(strong[data-pass="true"]) { border-color: #b3e1d1; background: var(--green-soft); }

.control-strip { display: grid; grid-template-columns: 220px 240px auto minmax(260px,1fr); align-items: end; gap: 12px; padding: 14px 18px; border-inline: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.control-strip label, .filter-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }
select { width: 100%; min-height: 38px; padding: 7px 30px 7px 10px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 12px; }
.primary-action, .retest-action { min-height: 38px; padding: 8px 14px; color: #fff; border: 1px solid var(--indigo); border-radius: 6px; background: var(--indigo); cursor: pointer; font-size: 12px; font-weight: 650; }
.primary-action:hover, .retest-action:hover { border-color: var(--indigo-dark); background: var(--indigo-dark); }
.boundary-note { align-self: center; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }

.report-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; border-inline: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.report-stat { min-width: 0; min-height: 72px; padding: 13px 18px; border-right: 1px solid var(--line); }
.report-stat:last-child { border-right: 0; }
.report-stat p, .report-stat small { display: block; margin: 0; color: var(--muted); font-size: 10px; }
.report-stat strong { display: block; margin: 4px 0 1px; font-size: 20px; letter-spacing: -.02em; }

.dossier-grid { display: grid; grid-template-columns: minmax(430px,.78fr) minmax(580px,1.22fr); align-items: start; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.findings-sheet { min-width: 0; border-right: 1px solid var(--line); }
.evidence-sheet { min-width: 0; padding-bottom: 18px; }
.sheet-heading { min-height: 70px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 15px 18px 13px; border-bottom: 1px solid var(--line); }
.sheet-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.sheet-heading > span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.filter-row { display: grid; grid-template-columns: 1fr 160px auto; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.filter-row label { display: block; }
.filter-row select { min-height: 34px; }
.filter-row > span { color: var(--muted); font-size: 10px; }

.issue-list { display: grid; }
.issue-row { width: 100%; min-height: 76px; display: grid; grid-template-columns: 60px minmax(0,1fr) auto; align-items: stretch; gap: 12px; padding: 0 14px 0 0; color: inherit; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.issue-row:hover { background: #fafbfc; }
.issue-row[data-active="true"] { background: var(--indigo-soft); box-shadow: inset 3px 0 var(--indigo); }
.issue-number { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 650; }
.issue-copy { min-width: 0; display: grid; align-content: center; gap: 4px; padding: 10px 0; }
.issue-copy strong { font-size: 12px; line-height: 1.3; }
.issue-copy small { overflow: hidden; color: var(--muted); font: 10px/1.35 ui-monospace, "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.severity { align-self: center; min-width: 62px; padding: 5px 7px; border-radius: 999px; text-align: center; font-size: 9px; font-weight: 700; }
.severity-high { color: var(--red); background: var(--red-soft); }
.severity-medium { color: var(--amber); background: var(--amber-soft); }
.severity-low { color: #2e639b; background: #edf5ff; }
.severity-resolved { color: var(--green); background: var(--green-soft); }

.fixture-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 18px 0; }
.capture-pane { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.fixed-pane { border-color: #bee2d4; background: #f4fbf8; }
.capture-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.capture-label b { color: var(--text); }
.capture-label span { color: var(--red); font-weight: 650; }
.fixed-pane .capture-label span { color: var(--green); }
.preview-window { width: min(100%,var(--fixture-width,520px)); min-height: 164px; margin: 0 auto; overflow: hidden; border: 1px solid #d7dce3; border-radius: 5px; background: #f8f4ea; box-shadow: 0 4px 12px rgba(20,25,26,.08); }
.preview-nav { min-height: 28px; display: flex; align-items: center; gap: 9px; padding: 0 10px; color: #66635d; border-bottom: 1px solid #d8d1c5; font-size: 6px; }
.preview-nav b { margin-right: auto; color: #171713; font-size: 8px; }
.preview-nav .fault { color: var(--red); }
.preview-nav .pass, .preview-form .pass { color: var(--green); }
.preview-art { min-height: 100px; position: relative; padding: 17px 16px; overflow: hidden; color: #fff; background: #243f37; }
.preview-art span { font-size: 5px; letter-spacing: .08em; opacity: .8; }
.preview-art strong { display: block; max-width: 150px; margin-top: 7px; font-size: 20px; line-height: .97; }
.preview-art i { width: 82px; height: 82px; position: absolute; right: 7%; bottom: -25px; border: 13px solid #f0a365; border-radius: 50% 50% 4% 50%; transform: rotate(20deg); }
.preview-form { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 10px; color: #5d5d5a; font-size: 5px; }
.preview-form b { color: var(--red); font-size: 6px; }

.detail { min-height: 286px; margin: 0 18px; padding: 18px 0 10px; border-bottom: 1px solid var(--line); }
.detail-top { display: grid; grid-template-columns: 105px minmax(0,1fr); align-items: start; gap: 14px; }
.detail-top span { padding-top: 3px; color: var(--red); font-size: 10px; font-weight: 650; }
.detail-top h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.25; }
.detail-block { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 14px; margin-top: 10px; }
.detail-block h4 { margin: 0; color: var(--muted); font-size: 10px; font-weight: 600; }
.detail-block p { margin: 0; font-size: 11px; }
.repro-list { margin: 0; padding-left: 17px; font-size: 11px; }
.evidence code { display: block; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 6px; background: #f0f2f5; font: 9px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; }
.empty-state { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 11px; }
.retest-action { margin: 13px 18px 0; }
.report-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 18px; color: var(--muted); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--surface); font-size: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: min(360px,calc(100% - 40px)); padding: 11px 14px; color: #fff; border-radius: 7px; background: #2d3442; box-shadow: 0 12px 30px rgba(0,0,0,.2); font-size: 11px; }
.toast[hidden] { display: none; }

@media (max-width: 1100px) {
  .report-masthead { grid-template-columns: minmax(0,1fr) 210px; }
  .report-meta { grid-column: 1 / -1; grid-row: 2; }
  .control-strip { grid-template-columns: 1fr 1fr auto; }
  .boundary-note { grid-column: 1 / -1; }
  .dossier-grid { grid-template-columns: 1fr; }
  .findings-sheet { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .product-bar { grid-template-columns: 1fr auto; gap: 12px; min-height: 56px; padding: 0 12px; }
  .release-id { display: none; }
  .release-room { width: calc(100% - 16px); margin: 8px auto 18px; }
  .report-masthead { grid-template-columns: 1fr; gap: 16px; padding: 19px 16px 16px; }
  .report-meta { display: none; }
  .decision-block { width: min(260px,100%); }
  h1 { font-size: 27px; }
  .standfirst { font-size: 13px; }
  .control-strip { grid-template-columns: 1fr; padding: 13px 16px; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .report-stat { min-height: 68px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
  .report-stat:nth-child(2) { border-right: 0; }
  .sheet-heading { min-height: 66px; padding: 14px; }
  .sheet-heading > span { display: none; }
  .filter-row { grid-template-columns: 1fr auto; padding: 10px 14px; }
  .filter-row label { grid-column: 1 / -1; }
  .issue-row { grid-template-columns: 50px minmax(0,1fr); padding-right: 10px; }
  .severity { grid-column: 2; justify-self: start; margin-bottom: 9px; }
  .fixture-preview { grid-template-columns: 1fr; margin: 14px 14px 0; }
  .detail { margin: 0 14px; }
  .detail-top, .detail-block { grid-template-columns: 1fr; gap: 4px; }
  .detail-top h3 { font-size: 17px; }
  .retest-action { width: calc(100% - 28px); margin: 13px 14px 0; }
}

@media (max-width: 420px) {
  .brand-sigil { width: 29px; height: 29px; }
  .export-button { padding-inline: 9px; }
  .preview-nav span:not(.fault):not(.pass) { display: none; }
  .report-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; padding-block: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
