:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --ink: #1b232c;
  --muted: #687684;
  --line: #dfe5ea;
  --line-strong: #cbd4dc;
  --accent: #ef3124;
  --accent-dark: #c6241a;
  --accent-soft: #fff1ef;
  --info: #1769aa;
  --info-soft: #eaf4fc;
  --ok: #18794e;
  --ok-soft: #eaf6ef;
  --warn: #8a5a00;
  --warn-soft: #fff5d9;
  --bad: #b42318;
  --bad-soft: #feeeee;
  --shadow: 0 8px 28px rgba(25, 37, 50, 0.07);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 280px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.32);
  outline-offset: 2px;
}

.site-header {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1240px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(239, 49, 36, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.primary-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.primary-nav a,
.header-link,
.header-button {
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #394754;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.primary-nav a:hover,
.header-link:hover,
.header-button:hover,
.primary-nav a[aria-current="page"],
.header-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

.account-nav {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-nav form {
  margin: 0;
}

.user-chip {
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow-wrap: anywhere;
  color: #42515e;
  font-size: 13px;
}

.user-chip span {
  color: var(--ok);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.narrow-shell {
  width: min(680px, calc(100% - 40px));
}

.environment-banner {
  margin-bottom: 22px;
  padding: 13px 16px;
  border: 1px solid;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.environment-banner strong,
.environment-banner span {
  display: block;
}

.environment-banner span {
  margin-top: 1px;
}

.mock-banner,
.dry-run-banner {
  border-color: #b9d9ed;
  background: var(--info-soft);
  color: #174d75;
}

.disabled-banner {
  border-color: var(--line-strong);
  background: #edf1f5;
  color: #42515e;
}

.production-banner {
  border-color: #e88882;
  background: #b42318;
  color: #fff;
}

.banner-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0 !important;
  border-radius: 999px;
  display: grid !important;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-weight: 800;
}

.page-intro,
.section-title,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-intro {
  margin-bottom: 22px;
}

.page-intro-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
  word-break: normal;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.22;
}

h1 {
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(19px, 2vw, 24px);
}

h3 {
  font-size: 16px;
}

.lead {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.panel {
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.upload-form,
.form-stack,
.confirm-form {
  display: grid;
  gap: 16px;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(280px, 1.2fr) minmax(130px, 0.45fr);
  gap: 16px;
  align-items: end;
}

.upload-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.field,
.mode-switch {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 7px;
}

.field-label,
.field > span,
.mode-switch legend {
  color: #465562;
  font-size: 13px;
  font-weight: 700;
}

.field-hint,
.hint,
small {
  color: var(--muted);
  font-size: 12px;
}

input[type="number"],
input[type="datetime-local"],
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

input:hover {
  border-color: #aebac4;
}

input:focus {
  border-color: var(--info);
}

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

.file-control {
  min-height: 68px;
  padding: 10px;
  border: 1px dashed #b9c4cd;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-soft);
  cursor: pointer;
}

.file-control:hover,
.file-control:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-select-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 700;
}

.file-name-display {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mode-card {
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  cursor: pointer;
  font-weight: 650;
}

.mode-card input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.mode-card:has(input:checked),
.mode-card:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(239, 49, 36, 0.1);
}

.mode-card-copy {
  display: grid;
  gap: 3px;
}

.mode-card-copy strong,
.mode-card-copy small {
  display: block;
}

.mode-card.is-disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f2f4f6;
  color: #6a7680;
}

.mode-card.is-disabled:has(input:checked) {
  border-color: #c9a94f;
  background: var(--warn-soft);
  color: #6f4a00;
}

.scheduled-row {
  max-width: 420px;
}

.scheduled-row[hidden],
.scheduled-confirmation[hidden] {
  display: none;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
}

.compact-button {
  min-height: 38px;
  padding: 8px 14px;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 14px rgba(239, 49, 36, 0.16);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  background: var(--panel-soft);
}

.danger {
  border-color: #efb3ae;
  background: var(--bad-soft);
  color: var(--bad);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.actions form {
  margin: 0;
}

.alert,
.empty,
.scheduled-confirmation {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 11px;
}

.alert {
  border-color: #efb3ae;
  background: var(--bad-soft);
  color: var(--bad);
}

.alert.neutral,
.empty {
  border-color: var(--line);
  background: var(--panel-soft);
  color: #40505d;
}

.alert.info {
  border-color: #b9d9ed;
  background: var(--info-soft);
  color: #174d75;
}

.alert.success {
  border-color: #b8ddc9;
  background: var(--ok-soft);
  color: var(--ok);
}

.scheduled-confirmation {
  border-color: #ecd286;
  background: var(--warn-soft);
  color: #6f4a00;
}

.scheduled-confirmation p {
  margin: 0;
}

.section-title {
  margin: 30px 0 12px;
  align-items: end;
}

.section-title span {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.jobs-table {
  min-width: 1120px;
  table-layout: auto;
}

.data-table {
  min-width: 920px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.jobs-table th:nth-child(1),
.jobs-table td:nth-child(1) {
  min-width: 72px;
}

.jobs-table th:nth-child(2),
.jobs-table td:nth-child(2) {
  min-width: 180px;
}

.jobs-table th:nth-child(3),
.jobs-table td:nth-child(3) {
  min-width: 120px;
}

.jobs-table th:nth-child(4),
.jobs-table td:nth-child(4) {
  min-width: 110px;
}

.jobs-table th:nth-child(5),
.jobs-table td:nth-child(5),
.jobs-table th:nth-child(6),
.jobs-table td:nth-child(6),
.jobs-table th:nth-child(7),
.jobs-table td:nth-child(7) {
  min-width: 90px;
  white-space: nowrap;
}

.jobs-table th:nth-child(8),
.jobs-table td:nth-child(8) {
  min-width: 150px;
  white-space: nowrap;
}

.jobs-table th:nth-child(9),
.jobs-table td:nth-child(9) {
  min-width: 100px;
  white-space: nowrap;
}

.file-name,
.error-cell,
.filename-value {
  overflow-wrap: break-word;
  word-break: normal;
}

.job-link {
  font-weight: 750;
}

.badge {
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #edf1f5;
  color: #42515e;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.job-status-badge {
  white-space: nowrap;
}

.completed,
.completed_with_business_errors,
.completed_with_limit_errors,
.success,
.status-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.scheduled,
.waiting_for_limit_retry,
.pending_confirmation,
.validation-errors,
.status-warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.running,
.running_primary,
.running_limit_retry,
.in_progress,
.status-info {
  background: var(--info-soft);
  color: var(--info);
}

.failed,
.scheduled_start_missed,
.invalid,
.duplicate_in_file,
.rejected,
.rate_limited,
.timeout,
.internal_error,
.status-error {
  background: var(--bad-soft);
  color: var(--bad);
}

.cancelled,
.status-neutral {
  background: #edf1f5;
  color: #52616e;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecf0;
}

.progress.large {
  height: 12px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.progress.completed span,
.progress.success span {
  background: var(--ok);
}

.progress.running span,
.progress.running_primary span,
.progress.running_limit_retry span,
.progress.in_progress span,
.progress.dry_run span {
  background: var(--info);
}

.progress.scheduled span,
.progress.waiting_for_limit_retry span,
.progress.validation-errors span {
  background: var(--warn);
}

.progress.failed span {
  background: var(--bad);
}

.progress.cancelled span {
  background: #64727e;
}

.jobs-mobile {
  display: none;
}

.job-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.job-card + .job-card {
  margin-top: 12px;
}

.job-card-head,
.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-card-file {
  margin: 9px 0 13px;
  overflow-wrap: anywhere;
  color: #354553;
  font-weight: 650;
}

.job-card-grid {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.job-card-grid span,
.metric-card span,
.timeline-card span,
.technical-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid,
.status-grid,
.technical-grid,
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.preflight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card,
.status-card,
.timeline-card {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: var(--panel);
}

.metric-card strong {
  font-size: 25px;
}

.metric-card.filename-card {
  grid-column: span 2;
}

.filename-value {
  font-size: 16px !important;
}

.status-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.status-overview {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-overview p {
  margin: 5px 0 0;
  color: var(--muted);
}

.technical-details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.technical-details > summary {
  min-height: 48px;
  padding: 13px 15px;
  cursor: pointer;
  color: #394956;
  font-weight: 750;
}

.technical-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.technical-content {
  padding: 16px;
}

.technical-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.technical-grid > div {
  padding: 11px;
  border-radius: 9px;
  background: #fff;
}

.payload-preview {
  max-width: 100%;
  max-height: 340px;
  margin: 12px 0 0;
  padding: 15px;
  overflow: auto;
  border-radius: 10px;
  background: #1e2933;
  color: #f6f8fa;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
}

.copy-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.detail-progress {
  flex: 1 1 360px;
}

.detail-progress small {
  display: block;
  margin-top: 7px;
}

.timeline-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline-card {
  min-height: 82px;
}

.summary-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.health-links {
  justify-content: flex-start;
}

.auth-card {
  max-width: 560px;
  margin: 0 auto;
}

.auth-card .panel {
  padding: 26px;
}

.admin-key-state {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-key-state > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
}

.admin-key-state span,
.admin-key-state strong {
  display: block;
}

.admin-key-state span {
  color: var(--muted);
  font-size: 12px;
}

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #465562;
  font-size: 13px;
}

.confirm-check input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.page-head {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-head > div {
  max-width: 820px;
}

.page-head p:not(.eyebrow),
.filename-heading {
  margin: 7px 0 0;
  color: var(--muted);
}

.filename-heading {
  max-width: 760px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-grid {
  margin-bottom: 22px;
}

.summary-grid > article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-grid > article > span,
.summary-grid > article > small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid > article > strong {
  font-size: 24px;
}

.compact-summary > article {
  min-height: 92px;
}

.compact-summary > article > strong {
  font-size: 19px;
}

.detail-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-summary .filename-card {
  grid-column: span 2;
}

.metric-ok {
  color: var(--ok);
}

.metric-info {
  color: var(--info);
}

.metric-bad {
  color: var(--bad);
}

.status-callout {
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  background: var(--panel);
}

.status-callout.is-ok {
  border-color: #b8ddc9;
  background: var(--ok-soft);
  color: var(--ok);
}

.status-callout.is-bad {
  border-color: #efb3ae;
  background: var(--bad-soft);
  color: var(--bad);
}

.status-callout.is-info {
  border-color: #b9d9ed;
  background: var(--info-soft);
  color: #174d75;
}

.status-callout-icon {
  display: block;
  width: 52px;
  height: 52px;
  max-width: none;
  flex-shrink: 0;
}

.status-callout-copy {
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

.status-callout-copy strong,
.status-callout-copy span {
  display: block;
}

.status-callout-copy > span {
  margin-top: 3px;
  color: inherit;
  opacity: 0.85;
}

.status-grid {
  margin-bottom: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
}

.status-card > div strong,
.status-card > div small {
  display: block;
}

.status-card > span:last-child {
  font-size: 12px;
  font-weight: 750;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
}

.status-card.is-ok .status-dot {
  background: var(--ok);
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.action-panel p {
  margin: 5px 0 0;
}

.technical-details {
  margin-bottom: 22px;
}

.technical-details > .technical-grid,
.technical-details > .nested-details,
.technical-details > .actions {
  margin: 16px;
}

.nested-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.nested-details > summary {
  cursor: pointer;
  font-weight: 700;
}

.progress-panel {
  padding: 18px 20px;
}

.progress-copy {
  margin-bottom: 10px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy > strong {
  font-size: 20px;
}

.timeline-panel .section-title,
.panel .section-title {
  margin-top: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
}

.timeline > div {
  position: relative;
  padding: 25px 10px 0 0;
  display: grid;
  gap: 3px;
}

.timeline > div::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--line);
}

.timeline > div > span {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: 0;
  width: 14px;
  height: 14px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line);
}

.timeline > div.is-done::before,
.timeline > div.is-done > span {
  background: var(--ok);
}

.timeline > div.is-done.validation-errors::before,
.timeline > div.is-done.validation-errors > span {
  background: var(--warn);
}

.timeline small {
  display: block;
}

.result-table {
  min-width: 1590px;
  table-layout: auto;
}

.result-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.result-table .row-column {
  min-width: 76px;
  white-space: nowrap;
}

.result-table .inn-column {
  min-width: 126px;
  white-space: nowrap;
}

.result-table .organization-column {
  min-width: 190px;
  overflow-wrap: break-word;
  word-break: normal;
}

.result-table .person-column {
  min-width: 170px;
  overflow-wrap: break-word;
  word-break: normal;
}

.result-table .phone-column {
  min-width: 142px;
  white-space: nowrap;
}

.result-table .city-column {
  min-width: 120px;
  white-space: nowrap;
}

.result-table .result-column {
  min-width: 150px;
  white-space: nowrap;
}

.result-column .badge {
  white-space: nowrap;
}

.result-table .http-column,
.result-table .duration-column,
.result-table .attempts-column {
  min-width: 82px;
  white-space: nowrap;
}

.result-table .error-column {
  min-width: 220px;
  overflow-wrap: break-word;
  word-break: normal;
}

.result-table .category-column {
  min-width: 150px;
  white-space: nowrap;
}

.numeric-cell {
  font-variant-numeric: tabular-nums;
}

.technical-value {
  overflow-wrap: anywhere;
}

.error-summary-table {
  min-width: 720px;
}

.validation-summary-table {
  min-width: 560px;
}

.summary-category-column,
.summary-code-column,
.error-summary-table th,
.validation-summary-table th {
  white-space: nowrap;
  word-break: normal;
}

.summary-category-column {
  min-width: 170px;
}

.summary-code-column {
  min-width: 180px;
}

.success-empty {
  border-color: #b8ddc9;
  background: var(--ok-soft);
  color: var(--ok);
}

.dry-run-results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #b9d9ed;
  background: var(--info-soft);
  color: #174d75;
}

.dry-run-results p {
  margin: 5px 0 0;
}

.dry-run-results > strong {
  font-size: 28px;
}

.job-actions {
  justify-content: flex-start;
}

.job-actions .confirm-form {
  max-width: 560px;
}

.inline-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.auth-layout {
  max-width: 940px;
  margin: 30px auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 42px;
}

.auth-intro p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.auth-panel {
  margin: 0;
  padding: 28px;
}

.auth-link {
  justify-self: center;
  font-weight: 650;
}

.full-button {
  width: 100%;
}

.form-panel {
  max-width: 680px;
}

.empty-state {
  text-align: center;
}

.empty-state-icon {
  display: block;
  margin-bottom: 8px;
  font-size: 30px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 0;
  }

  .brand {
    flex: 1 1 auto;
  }

  .primary-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .summary-grid,
  .status-grid,
  .timeline-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-grid .file-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .summary-grid,
  .status-grid,
  .technical-grid,
  .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-key-state {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-layout {
    max-width: 680px;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .page-intro {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .header-inner,
  .shell,
  .narrow-shell {
    width: min(100% - 24px, 1240px);
  }

  .account-nav {
    flex: 1 1 auto;
  }

  .primary-nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .primary-nav a {
    flex: 0 0 auto;
  }

  .page-intro,
  .page-head,
  .panel-header,
  .detail-row,
  .status-overview,
  .action-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .panel {
    padding: 18px;
  }

  .upload-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .upload-grid .file-field {
    grid-column: auto;
  }

  .upload-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-actions .button {
    width: 100%;
  }

  .jobs-desktop {
    display: none;
  }

  .jobs-mobile {
    display: block;
  }

  .metric-card.filename-card {
    grid-column: span 2;
  }

  .detail-summary .filename-card {
    grid-column: span 2;
  }

  .detail-row .actions {
    justify-content: flex-start;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .shell,
  .narrow-shell {
    width: min(100% - 20px, 1240px);
  }

  .site-header {
    position: static;
  }

  .account-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .user-chip {
    max-width: 100%;
  }

  .primary-nav {
    gap: 2px;
  }

  .primary-nav a,
  .header-link,
  .header-button {
    min-height: 42px;
    padding: 9px 10px;
  }

  .shell {
    padding-top: 20px;
  }

  .environment-banner {
    padding: 12px;
  }

  .mode-options,
  .summary-grid,
  .status-grid,
  .technical-grid,
  .timeline-grid,
  .admin-key-state {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-card {
    min-height: 54px;
  }

  .metric-card.filename-card {
    grid-column: auto;
  }

  .detail-summary .filename-card {
    grid-column: auto;
  }

  .file-control {
    align-items: stretch;
    flex-direction: column;
  }

  .file-select-button {
    justify-content: center;
  }

  .actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .actions > .button,
  .actions > form,
  .actions > form .button {
    width: 100%;
  }

  .job-card-head,
  .job-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .job-card-footer .button {
    width: 100%;
  }

  .payload-preview {
    font-size: 12px;
  }

  .job-card .job-status-badge,
  .page-head .job-status-badge {
    white-space: normal;
  }

  .timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .inline-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-callout {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
  }

  .dry-run-results {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .header-inner,
  .shell,
  .narrow-shell {
    width: min(100% - 16px, 1240px);
  }

  .brand small {
    display: none;
  }

  .panel,
  .auth-card .panel {
    padding: 15px;
  }

  h1 {
    font-size: 26px;
  }

  .job-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
