:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #20242c;
}

* { box-sizing: border-box; }
body { margin: 0; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #d9dde5;
}

.site-header form { display: flex; gap: 12px; align-items: center; margin: 0; }
.brand { color: #1e56b3; font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.container { width: min(1000px, calc(100% - 32px)); margin: 28px auto; }
.complaints-page .container { width: min(1380px, calc(100% - 40px)); }

.tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid #cfd5df; }
.tab { padding: 11px 16px; color: #4c5668; text-decoration: none; border-bottom: 3px solid transparent; }
.tab.active { color: #174ea6; border-color: #174ea6; font-weight: 700; }
.mode-indicator { margin: -10px 0 18px; color: #7a2e0e; font-weight: 700; }

.workspace, .card { background: #fff; border: 1px solid #d9dde5; border-radius: 8px; padding: 28px; }
.workspace h1, .card h1 { margin: 0 0 22px; font-size: 1.65rem; }
.narrow { width: min(420px, 100%); margin: 64px auto; }
.stack { display: grid; gap: 18px; }
label { display: grid; gap: 8px; font-weight: 650; }
input, textarea, button, .button { font: inherit; border-radius: 6px; }
input, textarea { width: 100%; border: 1px solid #aeb7c5; padding: 11px 12px; background: #fff; }
textarea { min-height: 220px; resize: vertical; line-height: 1.5; }

button, .button {
  border: 0;
  background: #e7ebf1;
  color: #20242c;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.primary, .button.primary { background: #175cd3; color: #fff; }
button.large { min-width: 190px; padding: 13px 24px; font-weight: 700; }
button.secondary { background: #e7ebf1; color: #20242c; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.disabled-actions { display: flex; gap: 12px; margin-top: 24px; }
.muted, .job-id { color: #667085; }
.job-id { margin-top: -12px; font-size: 0.9rem; overflow-wrap: anywhere; }
.status-line { margin: 24px 0 12px; }
.alert.error { background: #fff1f0; color: #b42318; padding: 11px 12px; border: 1px solid #f5c2c0; border-radius: 6px; }
.alert.info { background: #eef4ff; color: #1849a9; padding: 11px 12px; border: 1px solid #b2ccff; border-radius: 6px; }
.hidden { display: none; }

.fake-banner { margin: 0 0 22px; padding: 12px 14px; background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; border-radius: 6px; }
.route-options { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid #d9dde5; border-radius: 6px; }
.route-options legend { padding: 0 6px; font-weight: 700; }
.radio-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; font-weight: 500; }
.radio-row input { width: auto; }
.preflight-summary { margin-top: 30px; padding-top: 24px; border-top: 1px solid #d9dde5; }
.preflight-summary h2 { margin-top: 0; }
.complaint-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fake-progress { background: #d97706; }
.artifact-list { display: flex; flex-wrap: wrap; gap: 10px; }
.complaint-queue-block { margin-top: 28px; }
.complaint-queue-block h3 { margin: 0; }
.complaint-products { display: grid; gap: 10px; margin-top: 12px; }
.complaint-product-card { padding: 12px 14px; border: 1px solid #d9dde5; border-radius: 6px; }
.complaint-product-card label { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; cursor: pointer; }
.complaint-product-card input, .compact-check input { width: auto; margin-top: 3px; }
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.queue-heading form, .complaint-queue-table form { margin: 0; }
.table-scroll { overflow-x: auto; border: 1px solid #d9dde5; border-radius: 6px; }
.complaint-queue-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 0.94rem; line-height: 1.35; }
.complaint-queue-table th, .complaint-queue-table td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #e7eaf0; white-space: normal; overflow-wrap: break-word; word-break: normal; }
.complaint-queue-table th { background: #f7f8fa; line-height: 1.25; }
.complaint-queue-table tr:last-child td { border-bottom: 0; }
.complaint-queue-table .scope-disabled { color: #667085; background: #f8f9fb; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:nth-child(1),
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(1),
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(1),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(1) { width: 125px; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:nth-child(2),
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(2),
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(2),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(2) { width: 145px; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(1),
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(2),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(1),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(2) { white-space: nowrap; overflow-wrap: normal; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:nth-child(3),
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(3) { width: 250px; }
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(3),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(3) { width: 200px; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:nth-child(4),
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:nth-child(4),
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(4),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(4) { width: 76px; text-align: center; }
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(5),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(5) { width: 180px; }
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:nth-child(6),
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:nth-child(6) { width: 170px; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:last-child,
[aria-labelledby="automatic-queue-title"] .complaint-queue-table td:last-child,
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:last-child,
[aria-labelledby="manual-queue-title"] .complaint-queue-table td:last-child { position: sticky; right: 0; z-index: 1; width: 128px; background: #fff; border-left: 1px solid #e7eaf0; box-shadow: -6px 0 10px -9px #667085; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table th:last-child,
[aria-labelledby="manual-queue-title"] .complaint-queue-table th:last-child { z-index: 2; background: #f7f8fa; }
[aria-labelledby="automatic-queue-title"] .complaint-queue-table tr.scope-disabled td:last-child,
[aria-labelledby="manual-queue-title"] .complaint-queue-table tr.scope-disabled td:last-child { background: #f8f9fb; }
.compact-check { display: flex; grid-template-columns: none; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; }
.metrics .primary-metric { border-left-color: #175cd3; }
.metrics .primary-metric dd { color: #175cd3; }
.compact-summary { display: flex; flex-wrap: wrap; gap: 24px; margin: 14px 0; }
.compact-summary div { min-width: 145px; }
.compact-summary dt { color: #667085; }
.compact-summary dd { margin: 4px 0 0; font-size: 1.1rem; font-weight: 700; }
.queue-details { margin-top: 14px; }
.queue-details summary { color: #175cd3; cursor: pointer; font-weight: 700; }
.last-search h2 { margin-top: 0; }

.progress { width: 100%; height: 12px; overflow: hidden; background: #e6e9ee; border-radius: 6px; }
.progress-fill { width: 0; height: 100%; background: #175cd3; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.metrics div { border-left: 3px solid #d7dce5; padding-left: 14px; }
.metrics dt { color: #667085; }
.metrics dd { margin: 5px 0 0; font-size: 1.35rem; font-weight: 700; }

@media (max-width: 640px) {
  .site-header { padding: 10px 16px; }
  .container { width: min(100% - 20px, 1000px); margin-top: 18px; }
  .workspace, .card { padding: 20px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .metrics { grid-template-columns: 1fr; }
  .disabled-actions { align-items: stretch; flex-direction: column; }
  .complaints-page .container { width: min(100% - 20px, 1380px); }
}

@media (max-width: 1399px) {
  [aria-labelledby="automatic-queue-title"] .complaint-queue-table { min-width: 1180px; }
  [aria-labelledby="manual-queue-title"] .complaint-queue-table { min-width: 1280px; }
}
