/* Belegfluss: restrained tool UI. Warm neutrals, one accent (petrol), state colors only for state. */
:root {
  color-scheme: light;
  --bg: oklch(0.972 0.006 80);
  --surface: oklch(0.995 0.003 85);
  --surface-2: oklch(0.952 0.008 78);
  --surface-3: oklch(0.925 0.01 76);
  --border: oklch(0.875 0.011 75);
  --border-strong: oklch(0.78 0.014 72);
  --text: oklch(0.25 0.014 60);
  --text-2: oklch(0.46 0.014 62);
  --text-3: oklch(0.5 0.012 65);
  --accent: oklch(0.47 0.085 200);
  --accent-hover: oklch(0.41 0.085 200);
  --accent-soft: oklch(0.94 0.025 200);
  --accent-text: oklch(0.42 0.085 200);
  --on-accent: oklch(0.99 0.004 85);
  --ok: oklch(0.47 0.11 150);
  --ok-soft: oklch(0.95 0.035 150);
  --warn: oklch(0.5 0.11 68);
  --warn-icon: oklch(0.66 0.14 72);
  --warn-soft: oklch(0.955 0.045 85);
  --err: oklch(0.5 0.17 28);
  --err-soft: oklch(0.95 0.03 28);
  --info: oklch(0.46 0.05 240);
  --info-soft: oklch(0.955 0.015 240);
  --diff-add: oklch(0.955 0.035 150);
  --diff-change: oklch(0.955 0.04 85);
  --shadow: 0 1px 2px oklch(0.3 0.02 60 / 0.06), 0 4px 14px oklch(0.3 0.02 60 / 0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: oklch(0.2 0.008 60);
    --surface: oklch(0.235 0.009 60);
    --surface-2: oklch(0.27 0.01 60);
    --surface-3: oklch(0.31 0.011 60);
    --border: oklch(0.36 0.012 60);
    --border-strong: oklch(0.46 0.014 60);
    --text: oklch(0.93 0.008 80);
    --text-2: oklch(0.76 0.01 75);
    --text-3: oklch(0.68 0.01 75);
    --accent: oklch(0.72 0.09 200);
    --accent-hover: oklch(0.78 0.09 200);
    --accent-soft: oklch(0.32 0.04 200);
    --accent-text: oklch(0.78 0.08 200);
    --on-accent: oklch(0.2 0.02 200);
    --ok: oklch(0.78 0.12 150);
    --ok-soft: oklch(0.3 0.05 150);
    --warn: oklch(0.83 0.12 80);
    --warn-icon: oklch(0.8 0.14 78);
    --warn-soft: oklch(0.32 0.05 80);
    --err: oklch(0.76 0.14 28);
    --err-soft: oklch(0.32 0.06 28);
    --info: oklch(0.78 0.06 240);
    --info-soft: oklch(0.3 0.03 240);
    --diff-add: oklch(0.3 0.05 150);
    --diff-change: oklch(0.32 0.05 85);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 4px 14px oklch(0 0 0 / 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 650; }
h3 { font-size: 0.9375rem; font-weight: 650; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 0.85em; }
.muted { color: var(--text-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -40px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { top: 8px; }
* { scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }

/* ------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.brand-name { display: block; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 0.8125rem; color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.user-select { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-2); }
select, input[type="text"], textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; min-height: 40px;
}
select { padding-right: 28px; }
textarea { width: 100%; min-height: 72px; resize: vertical; }
select:hover, textarea:hover { border-color: var(--text-3); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 550;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge.live { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.recorded { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.tag-live { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag-recorded { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tag-recon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-ai { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ---------------------------------------------------------------- tabs */
.tabs { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.tabs-inner { display: flex; gap: 4px; padding: 0 16px; overflow-x: auto; max-width: 1440px; margin: 0 auto; }
.tabs button {
  font: inherit; font-size: 0.875rem; font-weight: 550; color: var(--text-2); background: none; border: 0;
  padding: 12px 12px 10px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- layout */
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; }
.view[hidden] { display: none; }
.flow { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.inbox { display: grid; gap: 16px; position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow: auto; padding-bottom: 4px; }
.work { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel > h2 + .hint, .panel > h1 + .muted { margin-top: 4px; }
.hint { font-size: 0.8125rem; color: var(--text-2); }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.prose-view .panel { max-width: 900px; }
.prose p, .prose ul { max-width: 72ch; }
.prose h2 { margin-top: 28px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.prose h1 + p { margin-top: 10px; }
.prose ul { padding-left: 20px; margin: 8px 0 0; }
.prose li + li { margin-top: 6px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.compare-col { border-top: 2px solid var(--border-strong); padding: 12px 0 0; }
.compare-col h2 { margin-top: 0; font-size: 1rem; }

/* ------------------------------------------------------------- samples */
.sample-list { list-style: none; margin: 12px -8px 0; padding: 0; display: grid; }
.sample-list li + li { border-top: 1px solid var(--border); }
.sample {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit;
  background: transparent; border: 0; border-radius: var(--radius-sm); padding: 10px 8px; cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.sample:hover { background: var(--surface-2); }
.sample[aria-pressed="true"] { background: var(--accent-soft); }
.sample[aria-pressed="true"] .sample-title { color: var(--accent-text); }
.sample .icon { margin-top: 2px; color: var(--text-2); }
.sample[aria-pressed="true"] .icon { color: var(--accent-text); }
.sample-title { display: block; font-weight: 600; font-size: 0.9rem; }
.sample-meta { display: block; font-size: 0.8125rem; color: var(--text-2); margin-top: 2px; }
.upload { margin-top: 12px; }
.upload-zone {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem; transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.upload-zone .muted { font-size: 0.8125rem; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload input:focus-visible + .upload-zone { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-zone.selected { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.preview { overflow: hidden; }
.preview img { box-shadow: 0 0 0 1px var(--border); border-radius: 2px; }
.preview img { display: block; width: 100%; height: auto; }
.preview .placeholder { background: var(--surface-2); padding: 40px 16px; text-align: center; color: var(--text-2); font-size: 0.875rem; }
.preview-text { margin: 0; padding: 12px; max-height: 340px; overflow: auto; white-space: pre-wrap; font-size: 0.75rem; }
.preview-links { margin-top: 8px; font-size: 0.8125rem; }

/* ------------------------------------------------------------- run bar */
.run-bar { scroll-margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; }
.run-title p { margin-top: 2px; font-size: 0.875rem; }
.run-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.provider-note { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--text-2); }
.provider-note:empty { display: none; }
.segmented { display: inline-flex; gap: 4px; border: 0; padding: 0; margin: 0; }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 40px; border-radius: var(--radius-sm); cursor: pointer; box-shadow: inset 0 0 0 1px var(--border-strong);
  font-size: 0.875rem; font-weight: 550; color: var(--text-2); transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.segmented input:checked + label { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; min-height: 40px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 0.875rem; font-weight: 600;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { background: var(--surface-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--err); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--on-accent); border-right-color: transparent; animation: spin 700ms linear infinite;
}
.link { font: inherit; color: var(--accent-text); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- stepper */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; gap: 6px; flex-wrap: wrap; }
.stepper li {
  flex: 1 1 0; min-width: 96px; font-size: 0.8125rem; font-weight: 600; color: var(--text-3);
  padding: 8px 10px 8px 30px; border-radius: var(--radius-sm); background: var(--surface-2); position: relative;
}
.stepper li::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  border: 2px solid currentColor; box-sizing: border-box;
}
.stepper li.done { color: var(--ok); background: var(--ok-soft); }
.stepper li.done::before { background: currentColor; }
.stepper li.current { color: var(--accent-text); background: var(--accent-soft); }
.stepper li.blocked { color: var(--err); background: var(--err-soft); }

/* ------------------------------------------------------------ results */
#result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.empty-steps { margin: 12px 0 14px; padding-left: 20px; max-width: 72ch; }
.empty-steps li + li { margin-top: 8px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.result-head .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 12px; background: var(--surface-2); }
.notice .icon { margin-top: 1px; }
.notice.warn { background: var(--warn-soft); color: var(--text); }
.notice.warn .icon { color: var(--warn-icon); }
.notice.info { background: var(--info-soft); }
.notice.info .icon { color: var(--info); }
.notice.err { background: var(--err-soft); }
.notice.err .icon { color: var(--err); }
.notice.ok { background: var(--ok-soft); }
.notice.ok .icon { color: var(--ok); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.kv > div { background: var(--surface); padding: 8px 12px; min-width: 0; }
.kv dt { font-size: 0.75rem; color: var(--text-2); }
.kv dd { margin: 2px 0 0; font-weight: 550; overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }

.conf { font-size: 0.75rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.conf::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conf.hi { color: var(--ok); }
.conf.mid { color: var(--warn); }
.conf.lo { color: var(--err); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.8438rem; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { background: var(--surface-2); font-size: 0.75rem; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table td.flag { background: var(--err-soft); }
.table td.flag-warn { background: var(--warn-soft); }
.table .sub { display: block; font-size: 0.75rem; color: var(--text-2); }
.table.plain { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cell-conf { display: block; margin-top: 2px; }

.meta-line { overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 0.8125rem; color: var(--text-2); }
.meta-line strong { color: var(--text); font-weight: 600; }
.ai-note { margin-top: 12px; font-size: 0.8125rem; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.ai-note .icon { color: var(--info); width: 16px; height: 16px; margin-top: 2px; }

details.payload { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
details.payload summary { cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 0.875rem; list-style-position: inside; }
details.payload[open] summary { border-bottom: 1px solid var(--border); }
.payload-body { padding: 12px; display: grid; gap: 10px; font-size: 0.8125rem; }
.payload-body pre { margin: 0; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; white-space: pre-wrap; word-break: break-word; }
.mask-mark { background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* findings */
.summary-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.count .icon { width: 15px; height: 15px; }
.count.err { background: var(--err-soft); color: var(--err); }
.count.warn { background: var(--warn-soft); color: var(--warn); }
.count.ok { background: var(--ok-soft); color: var(--ok); }
.count.info { background: var(--info-soft); color: var(--info); }
.findings { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.finding { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.finding .icon { margin-top: 1px; }
.finding.error { background: var(--err-soft); border-color: transparent; }
.finding.error .icon { color: var(--err); }
.finding.warning { background: var(--warn-soft); border-color: transparent; }
.finding.warning .icon { color: var(--warn-icon); }
.finding.info .icon { color: var(--info); }
.finding.ok .icon { color: var(--ok); }
.finding-title { font-weight: 600; font-size: 0.875rem; }
.finding-detail { font-size: 0.8125rem; color: var(--text-2); margin-top: 2px; }
.finding .ack { font-size: 0.8125rem; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; min-height: 32px; cursor: pointer; }
details.passed { margin-top: 10px; }
details.passed summary { cursor: pointer; font-size: 0.875rem; color: var(--text-2); padding: 6px 0; }

/* diff */
.diff td.kind { width: 28px; text-align: center; font-weight: 700; font-family: var(--mono); }
.diff tr.add td.kind { color: var(--ok); }
.diff tr.change td.kind { color: var(--warn); }
.diff tr.info td.kind { color: var(--info); }
.diff tr.add td.after { background: var(--diff-add); }
.diff tr.change td.after { background: var(--diff-change); }
.diff td.before { color: var(--text-2); white-space: nowrap; }
.diff td.after { min-width: 9rem; }
.diff td.before.strike { text-decoration: line-through; text-decoration-color: var(--text-3); }

/* approval */
.approval-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.approval-box { border-top: 1px solid var(--border); padding: 14px 0 0; }
.approval-box h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.approval-box .who { font-size: 0.8125rem; color: var(--text-2); }
.approval-box .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.approval-box label.field { display: block; font-size: 0.8125rem; font-weight: 600; margin: 8px 0 4px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.8125rem; }
.timeline li { display: flex; gap: 8px; align-items: flex-start; }
.timeline .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
.form-error { color: var(--err); font-size: 0.8125rem; margin-top: 8px; font-weight: 550; }
.form-error:empty { display: none; }

/* skeleton */
.skeleton { display: grid; gap: 10px; }
.skeleton div { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton div:nth-child(2) { width: 80%; }
.skeleton div:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ERP and audit */
.erp-grid { display: grid; gap: 20px; }
.erp-grid h2 { margin-bottom: 4px; }
.audit-table td { font-size: 0.8125rem; }
.audit-table .mono { font-size: 0.75rem; }

.footer { max-width: 1440px; margin: 0 auto; padding: 8px 24px 32px; font-size: 0.8125rem; color: var(--text-2); display: grid; gap: 4px; }

/* -------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .inbox { position: static; max-height: none; overflow: visible; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .approval-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .user-select .label-text { display: none; }
  main { padding: 16px 16px 32px; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 14px 14px; }
  .run-bar { grid-template-columns: minmax(0, 1fr); }
  .run-controls { justify-content: flex-start; }
  .run-controls .btn-primary { flex: 1 1 100%; }
  .compare { grid-template-columns: 1fr; }
  .stepper li { min-width: 0; flex: 1 1 30%; padding-left: 26px; font-size: 0.75rem; }
  .stepper li::before { left: 8px; }
  .finding { grid-template-columns: 22px 1fr; }
  .finding .ack { grid-column: 2; }
  .footer { padding: 8px 16px 28px; }
  .tabs-inner { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.work > *, .panel, .finding > div { min-width: 0; }
.finding-detail, .finding-title { overflow-wrap: anywhere; }
.table-wrap, .tabs-inner { position: relative; }
.erp-grid > * { min-width: 0; }
