:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #171a1f;
  background: #f4f5f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f4f5f6;
}

button,
textarea,
input { font: inherit; }

button { letter-spacing: 0; }

.app-header {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dfe2e5;
  background: #ffffff;
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: #176b51;
  font-size: 16px;
  font-weight: 800;
}

.brand-block h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand-block p {
  margin: 3px 0 0;
  color: #747b84;
  font-size: 12px;
}

.service-status {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d8dcdf;
  border-radius: 999px;
  color: #616872;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c08a27;
}

.service-status[data-state="online"] { color: #176b51; border-color: #bcd9ce; background: #f1f8f5; }
.service-status[data-state="online"] .status-dot { background: #24946f; }
.service-status[data-state="offline"] { color: #a03b47; border-color: #ebc9cd; background: #fff5f5; }
.service-status[data-state="offline"] .status-dot { background: #c74c5a; }

.app-layout {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.control-panel {
  padding: 28px 24px 40px;
  border-right: 1px solid #dfe2e5;
  background: #ffffff;
}

.panel-heading { margin-bottom: 24px; }
.section-kicker {
  margin: 0 0 6px;
  color: #176b51;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-heading h2,
.workspace-header h2,
.dialog-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.panel-heading > p:last-child {
  margin: 8px 0 0;
  color: #747b84;
  font-size: 13px;
  line-height: 1.6;
}

.field { display: block; margin-bottom: 18px; }

.field-label {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #32373e;
  font-size: 13px;
  font-weight: 750;
}

.field-count {
  color: #858b93;
  font-size: 11px;
  font-weight: 600;
}

textarea {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid #ccd1d5;
  border-radius: 6px;
  color: #24282e;
  background: #fbfcfc;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea::placeholder { color: #a0a5ab; }
textarea:focus { outline: 0; border-color: #208060; box-shadow: 0 0 0 3px rgba(32, 128, 96, .12); }

.fixed-config {
  margin: 4px 0 20px;
  border-top: 1px solid #e8eaec;
  border-bottom: 1px solid #e8eaec;
}

.fixed-config > div,
.toggle-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eceef0;
  color: #6d747c;
  font-size: 12px;
}

.fixed-config > div strong { color: #24282e; }
.fixed-config > :last-child { border-bottom: 0; }

.toggle-row { position: relative; cursor: pointer; }
.toggle-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.toggle-row strong { color: #24282e; font-size: 12px; }
.toggle-row small { color: #8a9097; font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: #c8cdd1;
  transition: background 120ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform 120ms ease;
}

.toggle-row input:checked + .toggle { background: #208060; }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle { outline: 3px solid rgba(32, 128, 96, .18); }

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

.link-cdk-config {
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid #cfd6d3;
  border-radius: 7px;
  background: #f8faf9;
}

.link-cdk-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-cdk-heading > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-cdk-heading strong { color: #24282e; font-size: 13px; }
.link-cdk-heading small { color: #7b828a; font-size: 10px; }
.compact-icon-button { width: 32px; height: 32px; flex: 0 0 32px; }

.link-cdk-actions {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.link-cdk-actions .button { min-height: 34px; padding: 6px 4px; font-size: 11px; }

.link-cdk-metrics {
  margin-top: 10px;
  padding-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #dfe5e2;
}

.link-cdk-metrics div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.link-cdk-metrics span { color: #747b84; font-size: 10px; }
.link-cdk-metrics strong { color: #176b51; font-size: 13px; overflow-wrap: anywhere; }
.link-cdk-config[data-state="error"] .link-cdk-metrics strong { color: #a03b47; }

.fusion-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #d9dddf;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(26, 31, 36, .22);
}

.fusion-dialog::backdrop { background: rgba(21, 26, 31, .38); }
.fusion-dialog form { padding: 20px; }
.fusion-description { margin: 16px 0; color: #666e77; font-size: 12px; line-height: 1.6; }
.fusion-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.fusion-actions .button { min-width: 100px; }

.payment-config {
  padding: 13px 0 14px;
  border-top: 1px solid #eceef0;
  color: inherit;
}

/* The fixed-config row rule also matches the payment panel itself. */
.fixed-config > div.payment-config {
  display: block;
  min-height: 0;
  align-items: initial;
  justify-content: initial;
  gap: 0;
  border-bottom: 0;
}

.payment-config-heading,
.payment-field,
.payment-quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-config-heading > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payment-config-heading strong,
.payment-field > span,
.payment-quota-row > span {
  color: #24282e;
  font-size: 12px;
  font-weight: 750;
}

.payment-config-heading small {
  color: #8a9097;
  font-size: 10px;
}

.payment-toggle-row {
  min-height: 20px;
  border-bottom: 0;
}

.payment-field {
  margin-top: 11px;
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.payment-field select,
.payment-field input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #ccd1d5;
  border-radius: 5px;
  color: #24282e;
  background: #fbfcfc;
  font-size: 12px;
}

.payment-field input:focus,
.payment-field select:focus {
  outline: 0;
  border-color: #208060;
  box-shadow: 0 0 0 3px rgba(32, 128, 96, .12);
}

#paymentCdkInput {
  font-family: "Cascadia Code", Consolas, monospace;
}

.payment-actions {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.payment-actions .button { min-height: 34px; padding: 7px 8px; font-size: 11px; }

.payment-quota-row {
  min-height: 32px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eceef0;
}

.payment-quota-row > span { color: #6d747c; font-weight: 650; }
.payment-quota-row strong { color: #176b51; font-size: 13px; }
.payment-quota-row[data-state="blocked"] strong { color: #a03b47; }

.payment-error {
  margin: 8px 0 0;
  color: #963642;
  font-size: 11px;
  line-height: 1.45;
}

.form-actions {
  margin: -4px 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.proxy-actions {
  margin: -4px 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible,
.icon-button:focus-visible,
.card-action:focus-visible { outline: 3px solid rgba(32, 128, 96, .18); outline-offset: 1px; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #ffffff; background: #176b51; }
.button-primary:hover:not(:disabled) { background: #105940; }
.button-secondary { color: #3c444c; border-color: #cfd4d8; background: #ffffff; }
.button-secondary:hover:not(:disabled) { border-color: #9ba2a9; background: #f7f8f8; }
.button-copy-success { color: #176b51; border-color: #b5d5c8; background: #f2f8f5; }
.button-copy-success:hover:not(:disabled) { border-color: #83b7a4; background: #e8f4ef; }
.button-copy-failed { color: #9a3340; border-color: #e5c5c9; background: #fff8f8; }
.button-copy-failed:hover:not(:disabled) { border-color: #dcaeb4; background: #fff0f1; }
.button-clear { color: #9a3340; border-color: #e5c5c9; background: #fff8f8; }
.button-clear:hover:not(:disabled) { border-color: #dcaeb4; background: #fff0f1; }
.button-danger { min-height: 36px; color: #9a3340; border-color: #e5c5c9; background: #fff8f8; }
.button-danger:hover:not(:disabled) { background: #fff0f1; }

.form-error {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-left: 3px solid #c74c5a;
  color: #963642;
  background: #fff5f5;
  font-size: 12px;
  line-height: 1.5;
}

.task-workspace { min-width: 0; padding: 28px 24px 48px; }

.recent-results {
  margin-bottom: 20px;
  padding: 16px 18px 15px;
  border: 1px solid #dfe2e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 26, 31, .04);
}

.top-recent-results { margin: 16px 24px 0; }

.recent-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.recent-results h2 {
  margin: 0;
  color: #272c32;
  font-size: 16px;
  line-height: 1.3;
}

.recent-results-summary {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  color: #7a8189;
  font-size: 10px;
  white-space: nowrap;
}

.recent-results-summary > strong {
  color: #176b51;
  font-size: 20px;
  line-height: 1;
}

.recent-results-summary > strong:nth-of-type(2) { color: #c74c5a; }
.recent-summary-label { font-weight: 700; }
.recent-summary-divider { width: 1px; height: 16px; margin: 0 5px; background: #dfe2e5; }
.recent-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: 5px; font-weight: 700; }
.recent-swatch { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.recent-swatch-success { background: #28a878; }
.recent-swatch-failure { background: #df5964; }
.recent-swatch-empty { background: #e9eef2; border: 1px solid #dfe5e9; }

.recent-timeline {
  display: grid;
  grid-template-columns: repeat(48, minmax(8px, 1fr));
  grid-auto-rows: 16px;
  gap: 5px;
  margin-top: 14px;
}

.recent-block {
  min-width: 8px;
  display: block;
  border: 1px solid #e2e7eb;
  border-radius: 4px;
  background: #edf1f4;
  cursor: help;
  transition: transform 120ms ease, filter 120ms ease;
}

.recent-block:hover { z-index: 1; transform: scale(1.12); filter: saturate(1.08); }
.recent-block[data-state="success"] { border-color: #8acdb3; background: #28a878; }
.recent-block[data-state="failure"] { border-color: #ec9ba3; background: #df5964; }

.workspace-header {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.workspace-heading { min-width: 0; }
.bulk-copy-actions {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.bulk-copy-actions .button { min-height: 36px; }
.workspace-title-row { display: flex; align-items: center; gap: 10px; }
.batch-label {
  max-width: 260px;
  overflow: hidden;
  color: #7b8188;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.workspace-buttons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.workspace-buttons .button { min-height: 36px; }
.task-stats { display: flex; align-items: center; gap: 18px; }
.task-stats span { color: #7a8189; font-size: 11px; white-space: nowrap; }
.task-stats strong { margin-right: 3px; color: #272c32; font-size: 14px; }

.empty-state {
  min-height: calc(100vh - 180px);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-symbol {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px dashed #adb4ba;
  border-radius: 8px;
  color: #7c848b;
  background: #fafbfb;
  font-size: 18px;
  font-weight: 800;
}

.empty-state h3 { margin: 16px 0 6px; font-size: 16px; }
.empty-state p { margin: 0; color: #80868d; font-size: 12px; }

.job-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.job-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe2e5;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 26, 31, .04);
}

.job-card[data-status="done"] { border-color: #a9cfc0; }
.job-card[data-status="error"] { border-color: #e6bec3; }
.job-card[data-status="running"] { border-color: #d9c08c; }

.job-card-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job-identity { min-width: 0; display: flex; align-items: center; gap: 7px; }
.job-number {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #394047;
  background: #eef0f1;
  font-size: 11px;
  font-weight: 800;
}

.job-status { min-width: 0; color: #666d75; font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card[data-status="done"] .job-status { color: #176b51; }
.job-card[data-status="error"] .job-status,
.job-card[data-status="cancelled"] .job-status { color: #a03b47; }
.job-card[data-status="running"] .job-status { color: #94691f; }

.job-payment {
  min-width: 0;
  margin: 8px 0 0;
  padding-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #eceef0;
  color: #858b93;
  font-size: 10px;
}

.job-payment strong {
  min-width: 0;
  color: #6d747c;
  font-size: 10px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-payment[data-payment-status="completed"] strong { color: #176b51; }
.job-payment[data-payment-status="failed"] strong,
.job-payment[data-payment-status="expired"] strong,
.job-payment[data-payment-status="cancelled"] strong,
.job-payment[data-payment-status="quota_insufficient"] strong,
.job-payment[data-payment-status="submit_failed"] strong { color: #a03b47; }
.job-payment[data-payment-status="queued"] strong,
.job-payment[data-payment-status="submission_waiting"] strong,
.job-payment[data-payment-status="submitting"] strong,
.job-payment[data-payment-status="awaiting_worker"] strong,
.job-payment[data-payment-status="claimed"] strong,
.job-payment[data-payment-status="verifying"] strong { color: #94691f; }

.icon-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #dfe2e5;
  border-radius: 5px;
  color: #616971;
  background: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.job-email {
  min-height: 17px;
  margin: 7px 0 0;
  overflow: hidden;
  color: #8a9096;
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  min-height: 24px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  color: #176b51;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.job-countdown-value {
  min-width: 64px;
  padding: 4px 7px;
  border: 1px solid #b5d5c8;
  border-radius: 5px;
  background: #f2f8f5;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  line-height: 1.1;
}

.job-countdown[data-state="expired"] { color: #9a3340; }
.job-countdown[data-state="expired"] .job-countdown-value { border-color: #e5c5c9; background: #fff5f5; }

.job-stage {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.progress-block { width: 100%; display: grid; justify-items: center; }
.progress-ring {
  --progress: 0;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#b3832e calc(var(--progress) * 1%), #eceeef 0);
}

.progress-ring::before {
  content: attr(data-value) "%";
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4d545b;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.progress-block p,
.error-block p {
  max-width: 100%;
  margin: 8px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: #767d85;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.draft-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px dashed #b5bbc0;
  border-radius: 50%;
  color: #6f777e;
  background: #fafbfb;
  font-size: 17px;
  font-weight: 800;
}

.qr-wrap {
  width: min(58%, 132px);
  aspect-ratio: 1;
  padding: 5px;
  display: grid;
  place-items: center;
  border: 1px solid #e0e3e5;
  border-radius: 5px;
  background: #ffffff;
}

.qr-image { width: 100%; height: 100%; display: block; object-fit: contain; }
.qr-placeholder { color: #176b51; font-size: 11px; font-weight: 800; }

.payment-success-stage {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #176b51;
}

.payment-success-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #76ac98;
  border-radius: 50%;
  background: #edf7f2;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.payment-success-stage strong { font-size: 14px; }

.error-block { max-width: 100%; color: #a03b47; }
.error-code { font-size: 24px; font-weight: 800; line-height: 1; }
.error-block p { color: #9a4b55; }

.card-actions {
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.card-action {
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  border: 1px solid #d9dddf;
  border-radius: 5px;
  color: #41484f;
  background: #f8f9f9;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.card-action:hover:not(:disabled) { border-color: #9ba3a9; background: #ffffff; }
.card-action:disabled { color: #afb4b9; cursor: not-allowed; }
.job-card[data-status="done"] .card-action:first-child { color: #176b51; border-color: #b5d5c8; background: #f2f8f5; }

.log-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: min(680px, calc(100vh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7dbde;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(23, 26, 31, .2);
}

.log-dialog::backdrop { background: rgba(23, 26, 31, .42); }
.dialog-header { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e1e4e6; }
.log-dialog pre { min-height: 240px; max-height: 520px; margin: 0; padding: 18px 20px; overflow: auto; color: #46505a; background: #f7f8f8; font: 11px/1.65 "Cascadia Code", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(340px, calc(100% - 32px));
  padding: 10px 13px;
  border-radius: 6px;
  color: #ffffff;
  background: #252a30;
  box-shadow: 0 10px 28px rgba(23, 26, 31, .2);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .job-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .job-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-header { align-items: flex-start; }
  .workspace-actions { align-items: flex-end; flex-direction: column-reverse; gap: 10px; }
}

@media (max-width: 940px) {
  .app-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .control-panel { padding-right: 18px; padding-left: 18px; }
  .task-workspace { padding-right: 18px; padding-left: 18px; }
  .job-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
}

@media (max-width: 720px) {
  .app-header { height: 64px; padding: 0 14px; }
  .brand-block h1 { font-size: 15px; }
  .brand-block p { display: none; }
  .service-status { padding: 0 8px; font-size: 11px; }
  .app-layout { display: block; }
  .control-panel { padding: 22px 16px 26px; border-right: 0; border-bottom: 1px solid #dfe2e5; }
  .task-workspace { padding: 22px 14px 36px; }
  .top-recent-results { margin: 14px 14px 0; }
  .recent-results { padding: 14px 12px 13px; }
  .recent-results-header { flex-direction: column; gap: 10px; }
  .recent-results-summary { justify-content: flex-start; }
  .recent-timeline { grid-template-columns: repeat(24, minmax(8px, 1fr)); gap: 4px; }
  .workspace-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .workspace-actions { align-items: stretch; flex-direction: column-reverse; }
  .bulk-copy-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .task-stats { display: flex; justify-content: space-between; }
  .job-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .job-card { padding: 9px; }
  .qr-wrap { width: min(54%, 112px); }
}

@media (max-width: 440px) {
  .form-actions,
  .proxy-actions { grid-template-columns: 1fr; }
  .job-list { grid-template-columns: 1fr; }
  .recent-timeline { grid-template-columns: repeat(12, minmax(8px, 1fr)); }
  .job-card { width: 100%; max-width: 360px; justify-self: center; }
  .task-stats { display: grid; grid-template-columns: 1fr 1fr; }
}

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