:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f4f4f5;
  --text: #111114;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #146356;
  --primary-contrast: #ffffff;
  --primary-soft: #e6efec;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fef6e7;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #141416;
    --surface-soft: #1c1c1f;
    --text: #f4f4f5;
    --muted: #9a9ba2;
    --border: #2a2b2f;
    --primary: #5fb8a4;
    --primary-contrast: #0b1a17;
    --primary-soft: #172622;
    --success: #4ade80;
    --success-soft: #142a1c;
    --warning: #e8a94a;
    --warning-soft: #2c2212;
    --danger: #f28b82;
    --danger-soft: #2c1615;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, tr:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 28px 36px 16px;
}

.tabbar {
  display: flex;
  gap: 4px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 36px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  margin-bottom: -1px;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.tab-button:hover { color: var(--text); }
.tab-button.active { border-bottom-color: var(--primary); color: var(--text); }

.view { display: none; }
.view.active { display: grid; gap: 20px; }

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 4px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }

h2 { margin-bottom: 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

h3 { margin-bottom: 5px; font-size: 15px; font-weight: 600; }

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle, .launch-panel p, .process-description, .workflow-caption { color: var(--muted); }

.mode-pill, .status-badge, .owner-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.mode-pill { padding: 6px 10px; background: var(--warning-soft); color: var(--warning); }

main {
  max-width: 1460px;
  margin: 0 auto;
  padding: 20px 36px 40px;
}

.launch-panel, .workflow-section, .runs-section, .detail-section, .errors-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
}

.launch-panel {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) minmax(220px, 1fr) minmax(180px, .7fr) auto;
  gap: 16px;
  align-items: end;
  padding: 18px 20px;
}

.launch-panel p { margin-bottom: 0; }

label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }

input, select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.primary-button, .secondary-button, .danger-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.primary-button { background: var(--primary); color: var(--primary-contrast); }
.secondary-button { background: var(--surface); color: var(--primary); border-color: var(--border); }
.danger-button { background: var(--surface); color: var(--danger); border-color: var(--border); }
.ghost-button { border: 1px solid var(--border); background: transparent; color: var(--text); }
button:disabled { cursor: not-allowed; opacity: .48; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }

.summary-item {
  min-height: 88px;
  padding: 16px 18px;
  border-left: 2px solid var(--muted);
  background: var(--surface);
}

.summary-item span { color: var(--muted); font-size: 12px; }
.summary-item strong { display: block; margin-top: 6px; font-size: 26px; font-weight: 600; line-height: 1; }
.warning-summary { border-color: var(--warning); }
.danger-summary { border-color: var(--danger); }
.success-summary { border-color: var(--success); }

.workflow-section, .runs-section, .detail-section, .errors-section { padding: 18px 20px; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading h2 { margin-bottom: 0; }

.workflow-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.workflow-node {
  position: relative;
  min-height: 82px;
  padding: 13px;
  background: var(--surface);
}

.workflow-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 28px;
  right: -1px;
  z-index: 2;
  color: var(--muted);
  font-weight: 600;
}

.workflow-node.active { background: var(--primary-soft); }
.workflow-node.active strong { color: var(--primary); }
.workflow-node.success { background: var(--success-soft); }
.workflow-node.success strong { color: var(--success); }
.workflow-node.error { background: var(--danger-soft); }
.workflow-node.error strong { color: var(--danger); }
.workflow-node.waiting_human { background: var(--warning-soft); }
.workflow-node.waiting_human strong { color: var(--warning); }
.workflow-node small { display: block; margin-top: 5px; color: var(--muted); }

.workflow-meter, .process-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-soft);
}

.workflow-meter { margin-top: 14px; }
.workflow-meter span, .process-meter span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .25s ease; }
.workflow-caption { margin: 9px 0 0; font-size: 13px; }

.status-badge { padding: 4px 8px; }
.status-badge.neutral { background: var(--surface-soft); color: var(--muted); }
.status-badge.running, .status-badge.pending { background: var(--primary-soft); color: var(--primary); }
.status-badge.waiting_human { background: var(--warning-soft); color: var(--warning); }
.status-badge.success { background: var(--success-soft); color: var(--success); }
.status-badge.error, .status-badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.status-badge.target { background: var(--success-soft); color: var(--success); }
.status-badge.target_with_warning, .status-badge.human_review { background: var(--warning-soft); color: var(--warning); }
.status-badge.not_target { background: var(--danger-soft); color: var(--danger); }


.decisions-table-wrap { max-height: 380px; overflow-y: auto; }
.decisions-table-wrap table thead th { position: sticky; top: 0; background: var(--surface); }
.decision-doc-link { color: var(--primary); font-size: 12px; font-weight: 600; }
.decision-doc-empty { color: var(--muted); font-size: 12px; }

.muted-note { color: var(--muted); font-size: 12px; }
.align-right { text-align: right; }
.chip { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; vertical-align: -1px; }
.chip-accent { background: var(--primary); }
.chip-warning { background: var(--warning); }
.chip-danger { background: var(--danger); }

/* Текущее рабочее состояние */
.workload-panel { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.workload-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 20px; flex-wrap: wrap; }
.workload-figures { display: flex; align-items: stretch; gap: 28px; }
.workload-divider { width: 1px; background: var(--border); }
.workload-figure { display: flex; flex-direction: column; gap: 5px; }
.workload-figure span { color: var(--muted); font-size: 12px; }
.workload-figure strong { font-size: 34px; font-weight: 600; line-height: 1; }
.workload-figure strong.figure-warning { color: var(--warning); }
.workload-actions { display: flex; align-items: center; gap: 8px; }
.workload-actions .primary-button, .workload-actions .ghost-button { display: inline-flex; align-items: center; gap: 8px; }
.workload-actions .ghost-button svg { transition: transform .18s ease; }
.workload-actions .ghost-button[aria-expanded="true"] svg { transform: rotate(180deg); }

.worklist { border-top: 1px solid var(--border); }
.worklist-row { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px 190px 110px; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--surface-soft); }
.worklist-head { padding: 10px 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.worklist-row:last-child { border-bottom: 0; }
.worklist-number { font-size: 13px; font-weight: 600; }
.worklist-etp { margin-top: 2px; color: var(--muted); font-size: 11px; }
.worklist-row span { font-size: 13px; }
.worklist-left { font-size: 13px; font-weight: 600; text-align: right; }
.worklist-left.urgent-soon { color: var(--warning); }
.worklist-left.urgent-now { color: var(--danger); }

/* Линия статусов */
.pipeline-panel { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 18px 20px; }
.pipeline-bar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--surface-soft); }
.pipeline-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pipeline-legend div { display: flex; flex-direction: column; gap: 6px; }
.pipeline-legend .pipeline-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.pipeline-legend strong { font-size: 20px; font-weight: 600; line-height: 1; }
.pipeline-current { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pipeline-current .eyebrow { margin-bottom: 0; flex-shrink: 0; }
.pipeline-current .process-meter { flex: 1; }
.pipeline-current > span:nth-child(2) { font-size: 13px; flex-shrink: 0; }

/* Таблица ручной обработки */
.decisions-table { table-layout: fixed; }
.decisions-table col.col-customer { width: 185px; }
.decisions-table col.col-title { width: 240px; }
.decisions-table col.col-procedure { width: 150px; }
.decisions-table col.col-price { width: 110px; }
.decisions-table col.col-status { width: 118px; }
.decisions-table col.col-decision { width: 186px; }
.decisions-table col.col-docs { width: 130px; }
.decisions-table th { white-space: nowrap; }
.decisions-table .decision-doc-link { white-space: nowrap; }
.decisions-table td { vertical-align: top; }
.decisions-table .align-center { text-align: center; }
.procedure-cell { display: inline-flex; align-items: center; gap: 5px; }
.procedure-cell span { font-size: 13px; }
.platform-link { display: inline-flex; align-items: center; color: var(--primary); flex-shrink: 0; }
.platform-link:hover { color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.decisions-table .align-right { text-align: right; }
.decision-price { font-size: 13px; font-weight: 600; }
.decision-price.is-missing { color: var(--muted); font-weight: 400; }
.decision-reason { color: var(--muted); font-size: 12px; line-height: 1.5; }
.participation-report { margin-top: 8px; max-width: 520px; font-size: 12px; line-height: 1.45; }
.participation-report summary { color: var(--primary); cursor: pointer; font-weight: 700; }
.participation-report p, .participation-report ul { margin: 5px 0; padding-left: 18px; }
.decision-doc-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 12px; font-weight: 600; }
.decision-doc-empty { color: var(--muted); font-size: 12px; }
.decision-files { margin-top: 3px; color: var(--muted); font-size: 11px; }

.decision-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.decision-toggle button { padding: 6px 11px; border: 0; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.3; }
.decision-toggle button:first-child { border-right: 1px solid var(--border); }
.decision-toggle button:disabled { cursor: progress; opacity: .6; }
.decision-toggle button.is-target { background: var(--success-soft); color: var(--success); }
.decision-toggle button.is-not-target { background: var(--danger-soft); color: var(--danger); }
.decision-source { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.decision-source.by-ai { color: var(--primary); }
.decision-source.by-human { color: var(--text); }
.decision-date { margin-top: 2px; color: var(--muted); font-size: 11px; }

/* Календарь подач — диаграмма Ганта */
.calendar-title { display: flex; align-items: center; gap: 16px; }
.gantt-legend { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.gantt { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow-x: auto; }
.gantt-row { display: flex; border-bottom: 1px solid var(--surface-soft); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-months, .gantt-days { border-bottom: 1px solid var(--border); }
.gantt-label { width: 400px; flex-shrink: 0; padding: 12px 16px; border-right: 1px solid var(--border); overflow: hidden; }
.gantt-customer { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-title { margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-months .gantt-label, .gantt-days .gantt-label { padding: 10px 16px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.gantt-month { flex-shrink: 0; padding: 10px 12px; border-right: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.gantt-month:last-child { border-right: 0; }
.gantt-day { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0; border-left: 1px solid var(--surface-soft); }
.gantt-day.is-weekend { background: var(--surface-soft); }
.gantt-day.is-today { background: var(--primary-soft); }
.gantt-day.is-today b, .gantt-day.is-today i { color: var(--primary); }
.gantt-day b { font-size: 12px; font-weight: 600; }
.gantt-day i { color: var(--muted); font-size: 10px; font-style: normal; }
.gantt-track { position: relative; flex-shrink: 0; height: 58px; }
.gantt-cell { position: absolute; top: 0; bottom: 0; width: 48px; border-left: 1px solid var(--surface-soft); }
.gantt-cell.is-weekend { background: var(--bg); }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); opacity: .45; }
.gantt-bar { position: absolute; top: 15px; height: 28px; border-radius: 4px; background: var(--primary); display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 10px; overflow: hidden; }
.gantt-bar .gantt-bar-start { margin-right: auto; }
.gantt-bar.is-clipped { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gantt-bar.urgent-soon { background: var(--warning); }
.gantt-bar.urgent-now { background: var(--danger); }
.gantt-bar-start { color: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 500; white-space: nowrap; }
.gantt-bar-end { color: #ffffff; font-size: 11px; font-weight: 600; white-space: nowrap; }

.stub-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.stub-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; background: var(--surface); }
.stub-card h3 { margin: 0; }
.stub-card p { margin: 0; color: var(--muted); font-size: 13px; }
.stub-note { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.test-options { max-width: 380px; color: var(--muted); font-size: 13px; }
.test-options summary { cursor: pointer; font-weight: 600; }
.checkbox-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.checkbox-row input { width: auto; min-height: auto; margin-top: 3px; }

.process-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }

.process-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  box-shadow: none;
  border-top: 2px solid transparent;
}

.process-card.is-running { border-top-color: var(--primary); }
.process-card.has-error { border-top-color: var(--danger); }
.process-card.needs-human { border-top-color: var(--warning); }
.process-number { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.process-card h3 { margin-top: 12px; }
.process-description { min-height: 62px; margin-bottom: 14px; font-size: 13px; }
.process-status-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.process-percent { color: var(--muted); font-size: 12px; font-weight: 600; }
.current-step { min-height: 43px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.process-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.process-actions button { flex: 1 1 auto; min-width: 78px; }

.step-details { margin: 2px 0 14px; }
.step-details summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; }
.step-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.step-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px; align-items: start; }
.step-item strong { display: block; font-size: 12px; font-weight: 600; }
.step-item small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.step-marker { width: 8px; height: 8px; margin-top: 5px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); }
.step-item.running .step-marker { border-color: var(--primary); background: var(--primary); }
.step-item.success .step-marker { border-color: var(--success); background: var(--success); }
.step-item.error .step-marker, .step-item.cancelled .step-marker { border-color: var(--danger); background: var(--danger); }
.step-item.waiting_human .step-marker { border-color: var(--warning); background: var(--warning); }

#view-engineering .process-card,
#view-engineering #run-detail,
#view-engineering .process-report,
#view-engineering .download-item {
  -webkit-user-select: text;
  user-select: text;
}

.process-report { margin: 0 0 15px; padding: 12px 13px; border-left: 2px solid var(--primary); background: var(--surface-soft); }
.empty-report { color: var(--muted); }
.empty-report p, .report-summary, .report-path { margin: 6px 0 0; font-size: 12px; }
.report-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; align-items: center; }
.report-heading > strong { font-size: 13px; font-weight: 600; }
.report-mode { color: var(--warning); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.report-mode.production { color: var(--success); }
.report-summary { color: var(--muted); }
.report-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 12px; }
.report-totals strong { margin-left: 4px; font-size: 16px; font-weight: 600; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.report-metrics span { padding: 7px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.report-metrics strong { display: block; margin-top: 2px; color: var(--text); font-size: 14px; font-weight: 600; text-align: right; }
.report-list, .folder-list, .document-list { display: grid; gap: 7px; margin-top: 10px; }
.report-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 2px 10px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 12px; }
.report-row small { grid-column: 1 / -1; color: var(--muted); }
.report-empty { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.file-report { display: grid; gap: 4px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.file-report span, .report-path span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.file-report strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.file-report code, .report-path code, .folder-row code { display: block; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.file-report small { color: var(--muted); font-size: 11px; }
.compact-file { padding-top: 7px; }
.compact-file a, .registry-link a { color: var(--primary); font-size: 12px; font-weight: 600; }
.card-result { margin-top: 10px; font-size: 12px; }
.registry-link { display: grid; gap: 4px; margin: 10px 0 0; }
.registry-link code { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.external-boundary { margin: 10px 0 0; padding: 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.download-list { display: grid; gap: 10px; }
.download-item { grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.3fr) minmax(130px, .65fr); align-items: start; padding: 10px 0 0; }
.download-item > div, .download-item-paths, .download-item-facts { display: grid; gap: 4px; }
.download-item a { color: var(--primary); font-size: 11px; font-weight: 600; }
.download-item code { max-width: 100%; white-space: normal; }
.download-item-facts span { color: var(--muted); font-size: 11px; }
.download-item.has-item-error { margin: 0 -8px; padding: 10px 8px 0; border-radius: 4px; background: var(--danger-soft); }
.item-error { color: var(--danger) !important; line-height: 1.35; }
.process-report h4 { margin: 13px 0 0; font-size: 12px; font-weight: 600; }
.folder-row { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.folder-row div strong { display: block; font-size: 12px; font-weight: 600; }
.folder-row div small, .folder-row > span { display: block; color: var(--muted); font-size: 11px; }
.document-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, .8fr); gap: 12px; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.document-row > div > strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.document-row small { display: block; color: var(--muted); font-size: 11px; }
.recognition { display: grid; grid-template-columns: minmax(70px, 1fr) 36px; gap: 7px; align-items: center; }
.recognition strong { font-size: 11px; font-weight: 600; text-align: right; }
.report-path code { margin-top: 3px; }

.owner-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; }
.owner-badge { padding: 3px 7px; background: var(--surface-soft); color: var(--muted); border: 1px solid var(--border); }
.owner-badge.ai { background: var(--success-soft); color: var(--success); border-color: transparent; }
.owner-badge.human { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.owner-badge.external { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr); gap: 24px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.registry-section { margin-top: 0; }
.registry-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--muted); font-size: 12px; }
.registry-summary strong { margin-left: 4px; color: var(--text); font-size: 15px; font-weight: 600; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.registry-section th:last-child, .registry-section td:last-child { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: var(--surface-soft); }

.mini-progress { display: flex; align-items: center; gap: 7px; min-width: 110px; }
.mini-progress .process-meter { width: 72px; }

.empty-state { padding: 20px 0; color: var(--muted); text-align: center; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.detail-meta { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.timeline { display: grid; gap: 11px; margin-top: 16px; border-left: 1px solid var(--border); padding-left: 14px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; top: 6px; left: -18px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.timeline-item.success::before { background: var(--success); }
.timeline-item.warning::before { background: var(--warning); }
.timeline-item.error::before { background: var(--danger); }
.timeline-item time { display: block; color: var(--muted); font-size: 11px; }
.timeline-item p { margin: 2px 0 0; font-size: 13px; }

.errors-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.error-item { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.6fr) auto; gap: 12px; align-items: center; padding: 12px; border-left: 2px solid var(--danger); background: var(--surface); }
.error-item p { margin: 0; }
.error-item small { color: var(--muted); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: 420px;
  padding: 11px 15px;
  border-radius: 4px;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .process-grid { grid-template-columns: 1fr; }
  .launch-panel { grid-template-columns: 1fr 1fr; }
  .launch-panel > div { grid-column: 1 / -1; }
  .lower-grid { grid-template-columns: 1fr; }
  .stub-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { padding: 24px 18px 18px; }
  .tabbar { padding: 0 18px; }
  main { padding: 16px 18px 40px; }
  .topbar { flex-direction: column; }
  .launch-panel { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-track { grid-template-columns: 1fr; }
  .workflow-node:not(:last-child)::after { content: "↓"; top: auto; right: 50%; bottom: -1px; }
  .process-grid { grid-template-columns: 1fr; }
  .process-card { min-height: auto; }
  .process-description { min-height: auto; }
  .section-heading { flex-direction: column; }
  .error-item { grid-template-columns: 1fr; }
  .document-row { grid-template-columns: 1fr; gap: 5px; }
  .download-item { grid-template-columns: 1fr; }
}

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

.status-ok { color: var(--success); }
.status-warning { color: var(--warning); }
.status-danger { color: var(--danger); }
