:root {
  --bg: #f2f1ed;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #efede7;
  --ink: #1b1d21;
  --ink-2: #464b53;
  --ink-3: #636871;
  --line: #e4e1da;
  --line-strong: #cdc8bd;
  --accent: #2a4fd4;
  --accent-ink: #1f3fb2;
  --accent-soft: #e9eefd;
  --ok: #1d7347;
  --ok-soft: #e3f2e9;
  --warn: #9a4c00;
  --warn-soft: #fcefdd;
  --err: #b42318;
  --err-soft: #fdeceb;
  --info: #49505b;
  --info-soft: #eef0f3;
  --edge-open: #e0382b;
  --edge-fin: #e89a12;
  --edge-flip: #8b3fd9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(27, 29, 33, 0.05), 0 8px 24px -12px rgba(27, 29, 33, 0.12);
  --font: "Inter Variable", system-ui, sans-serif;
  --display: "Space Grotesk Variable", "Inter Variable", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 16px/1 var(--display);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
}
.bm-bg {
  fill: var(--ink);
}
.bm-back {
  fill: none;
  stroke: #8fa6ff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.bm-front {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bm-tri {
  fill: #8fa6ff;
  opacity: 0.55;
}

.privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 0 auto;
  color: var(--ink-2);
  font-size: 13px;
}
.privacy svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.sample-note {
  margin: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- layout */

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font: 600 15px/1.3 var(--display);
  letter-spacing: -0.005em;
}

.card-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
  text-align: right;
}

.sub-title {
  margin: 22px 0 10px;
  font: 600 13px/1.3 var(--font);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.mini-label {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- verdict */

.verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 16px 20px 16px 24px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.verdict::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--level, var(--line-strong));
}
.verdict[data-level="ready"] {
  --level: var(--ok);
  --level-soft: var(--ok-soft);
}
.verdict[data-level="warnings"] {
  --level: #c26a00;
  --level-soft: var(--warn-soft);
}
.verdict[data-level="attention"],
.verdict[data-level="failed"] {
  --level: var(--err);
  --level-soft: var(--err-soft);
}

.kicker {
  margin: 0 0 4px;
  color: var(--ink-3);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.kicker .file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.kicker .arrow {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}
.kicker .to {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
}

.verdict-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font: 600 27px/1.15 var(--display);
  letter-spacing: -0.02em;
}
.verdict-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--level, var(--line-strong));
  box-shadow: 0 0 0 5px var(--level-soft, var(--surface-3));
}

.verdict-line {
  margin: 6px 0 0;
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 13.5px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, auto));
  gap: 10px;
  margin: 0;
}
.metric {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.metric dt {
  color: var(--ink-3);
  font-size: 12px;
}
.metric dd {
  margin: 2px 0 0;
  font: 600 20px/1.2 var(--display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric .sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font: 400 12px/1.3 var(--font);
  letter-spacing: 0;
  white-space: nowrap;
}
.metric .sub.warn {
  color: var(--warn);
}
.metric .sub.err {
  color: var(--err);
}

.input-problem {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #f3c7c2;
  border-radius: var(--radius-sm);
  background: var(--err-soft);
  color: #7a1a12;
}
.input-problem strong {
  font-weight: 600;
}

/* ---------------------------------------------------------------- workspace */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas:
    "viewer side"
    "details side";
  gap: 14px;
  align-items: start;
}
.workspace > .viewer-card {
  grid-area: viewer;
}
.workspace > .side {
  grid-area: side;
}
.workspace > .details {
  grid-area: details;
}
/* The controls and downloads stay in view while the report scrolls by. */
@media (min-width: 1001px) and (min-height: 840px) {
  .workspace > .side {
    position: sticky;
    top: 14px;
  }
}

.viewer-card {
  padding: 12px;
  min-width: 0;
}

.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.viewer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--surface-3);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button:hover {
  color: var(--ink);
}
.segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(27, 29, 33, 0.12);
}

.select-wrap select,
.field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23464b53' stroke-width='1.4'/%3E%3C/svg%3E")
    no-repeat right 9px center / 12px 12px;
  font-size: 13px;
  cursor: pointer;
}
.select-wrap.compact select {
  padding-top: 6px;
  padding-bottom: 6px;
}

.chip-toggle {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.chip-toggle[aria-pressed="true"] {
  border-color: #b9c6f5;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button svg {
  width: 14px;
  height: 14px;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  fill: none;
}
.icon-button .i-play {
  display: none;
  fill: var(--ink);
  stroke: none;
}
.icon-button[aria-pressed="false"] .i-pause {
  display: none;
}
.icon-button[aria-pressed="false"] .i-play {
  display: block;
}

.stage {
  position: relative;
  height: clamp(360px, calc(100vh - 334px), 720px);
  border-radius: 11px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 38%, #fbfaf7 0%, #efece6 52%, #e1ddd4 100%);
  outline-offset: 3px;
  touch-action: none;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.stage canvas:active {
  cursor: grabbing;
}

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.dim-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 29, 33, 0.14);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px -4px rgba(27, 29, 33, 0.3);
}
.dim-label span {
  color: var(--ink-3);
  font-weight: 500;
  margin-right: 4px;
}

.stage-badge {
  position: absolute;
  left: 14px;
  top: 12px;
  margin: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
}
.stage-badge span {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(27, 29, 33, 0.78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.triad {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 64px;
  height: 64px;
  pointer-events: none;
}
.triad line {
  stroke-width: 2.2;
  stroke-linecap: round;
}
.triad text {
  font: 700 9.5px var(--font);
  text-anchor: middle;
  dominant-baseline: central;
}

.stage-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  max-width: min(330px, calc(100% - 100px));
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(27, 29, 33, 0.1);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
  pointer-events: none;
}
.stage-legend:empty {
  display: none;
}
.stage-legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-legend .row + .row {
  margin-top: 3px;
}
.stage-legend .swatch-line {
  flex: none;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.stage-legend b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fallback {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.fallback p {
  margin: 0;
}
.fallback .fallback-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.drop-veil {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  background: rgba(42, 79, 212, 0.1);
  border: 2px dashed var(--accent);
  border-radius: 11px;
  color: var(--accent-ink);
  font: 600 18px var(--display);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.dragging .drop-veil {
  opacity: 1;
}

.materials-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 11px 4px 1px;
  min-height: 20px;
}
.mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.mat-chip i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(27, 29, 33, 0.18);
  flex: none;
}
.mat-chip b {
  color: var(--ink);
  font-weight: 600;
}
.mat-chip .num {
  font-variant-numeric: tabular-nums;
}
.mat-chip .flag {
  color: var(--warn);
  font-weight: 600;
}

/* ---------------------------------------------------------------- side */

.side {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.side .card {
  padding: 14px 16px 16px;
}

.dropzone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.dropzone svg {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dropzone p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.dz-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dragging .dropzone,
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover {
  border-color: #b5afa3;
}
.button.small {
  padding: 5px 11px;
  font-size: 13px;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button.primary:hover {
  background: var(--accent-ink);
}
.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
input[type="file"]:focus-visible + .button,
label.button:has(+ input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.file-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.file-list .name {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.file-list .meta {
  flex: none;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.samples {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sample-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sample-buttons button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.sample-buttons button span {
  color: var(--ink-3);
  margin-left: 5px;
}
.sample-buttons button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.sample-buttons button[aria-pressed="true"] span {
  color: #c9ccd3;
}

.sample-story {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.paste-card textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  font: 12px/1.5 var(--mono);
}
.paste-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.targets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.targets button {
  display: grid;
  gap: 1px;
  padding: 8px 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}
.targets b {
  font: 600 15px/1.2 var(--display);
}
.targets span {
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}
.targets button[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.targets button[aria-checked="true"] b {
  color: var(--accent-ink);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 12px;
}
.field {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.field > span {
  color: var(--ink-3);
  font-size: 12px;
}
.field[hidden] {
  display: none;
}

.downloads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.downloads li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.downloads .name {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.downloads .meta {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.downloads .empty {
  display: block;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-3);
}

.report-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.roundtrip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.roundtrip svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.roundtrip.ok svg {
  stroke: var(--ok);
}
.roundtrip.bad svg {
  stroke: var(--err);
}
.roundtrip svg path {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- details */

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.detail-card {
  padding: 16px 18px 18px;
  min-width: 0;
}
.detail-card > .card-title {
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
caption {
  text-align: left;
  color: var(--ink-3);
  font-size: 12px;
  padding-bottom: 6px;
}
.kv th {
  width: 34%;
  padding: 7px 12px 7px 0;
  text-align: left;
  vertical-align: top;
  color: var(--ink-3);
  font-weight: 500;
}
.kv td {
  padding: 7px 0;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.kv tr + tr th,
.kv tr + tr td {
  border-top: 1px solid var(--line);
}
.data th,
.data td {
  padding: 7px 10px 7px 0;
  text-align: left;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.data thead th {
  border-top: 0;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 12px;
}
.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data .swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
  border: 1px solid rgba(27, 29, 33, 0.2);
}
.data .muted {
  color: var(--ink-3);
}
.data .wrap {
  white-space: normal;
}
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
}

.changes,
.dropped {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.changes li {
  position: relative;
  padding-left: 26px;
  counter-increment: step;
}
.changes {
  counter-reset: step;
}
.changes li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.changes b,
.dropped b {
  display: block;
  font-weight: 600;
}
.changes p,
.dropped p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}
.dropped li {
  padding-left: 14px;
  border-left: 3px solid var(--line-strong);
}
.empty-note {
  color: var(--ink-3);
  font-size: 13px;
  margin: 0;
}

.count {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 13px;
  margin-left: 4px;
}

.problem-group + .problem-group {
  margin-top: 14px;
}
.problem {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sev-soft);
  border: 1px solid var(--sev-line);
}
.problem + .problem {
  margin-top: 8px;
}
.problem[data-severity="error"] {
  --sev: var(--err);
  --sev-soft: var(--err-soft);
  --sev-line: #f3cbc6;
}
.problem[data-severity="warning"] {
  --sev: var(--warn);
  --sev-soft: var(--warn-soft);
  --sev-line: #f2d7b3;
}
.problem[data-severity="info"] {
  --sev: var(--info);
  --sev-soft: var(--info-soft);
  --sev-line: #dfe2e8;
}
.problem-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.sev {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--sev);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.problem code {
  color: var(--ink-2);
  font-size: 12px;
}
.problem p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}
.problem .where {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.foot {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 28px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.foot p {
  margin: 0;
}

/* ---------------------------------------------------------------- busy */

.busy .verdict-title,
.busy .stage canvas {
  opacity: 0.55;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1240px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(118px, auto));
  }
}

@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "viewer"
      "side"
      "details";
  }
  .verdict {
    grid-template-columns: minmax(0, 1fr);
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 16px;
  }
  .privacy {
    order: 3;
    width: 100%;
    margin: 0;
    font-size: 12.5px;
  }
  .sample-note {
    margin-left: auto;
  }
  .app {
    padding: 12px 12px 24px;
  }
  .verdict {
    padding: 14px 14px 14px 18px;
    gap: 14px;
  }
  .verdict-title {
    font-size: 22px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric dd {
    font-size: 18px;
  }
  .metric .sub,
  .metric dd {
    white-space: normal;
  }
  .side {
    grid-template-columns: minmax(0, 1fr);
  }
  .details {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    height: 380px;
  }
  .viewer-head {
    gap: 8px;
  }
  .segmented {
    width: 100%;
  }
  .segmented button {
    flex: 1;
    padding: 6px 4px;
    font-size: 12.5px;
  }
  .viewer-tools {
    width: 100%;
  }
  .viewer-tools .select-wrap {
    flex: 1;
  }
  .stage-legend {
    left: 84px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    padding: 6px 9px;
    font-size: 11.5px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
  }
  .stage-legend .row + .row {
    margin-top: 0;
  }
  /* Small screens keep only what was found; the counts of zero stay in the report. */
  .stage-legend .row.zero {
    display: none;
  }
  .card-head {
    flex-direction: column;
    gap: 2px;
  }
  .card-hint {
    text-align: left;
  }
  .foot {
    padding: 0 16px 24px;
  }
}

.capture * {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
