: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;
}

.header-live-status {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-docs-link {
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9d9d3;
  border-radius: 5px;
  color: #176b51;
  background: #f5faf8;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.header-docs-link:hover { border-color: #7eaa9a; background: #edf7f2; }

.header-sad-cdk-link {
  color: #a72f3d;
  border-color: #dfafb6;
  background: #fff5f6;
}

.header-sad-cdk-link:hover {
  color: #8f2431;
  border-color: #c97580;
  background: #ffecef;
}

.site-statistics {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-statistic {
  min-width: 0;
  min-height: 42px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: baseline;
  gap: 1px;
  border: 1px solid #dfe3e5;
  border-radius: 6px;
  color: #747b84;
  background: #f8f9f9;
  font-size: 10px;
  white-space: nowrap;
}

.site-statistic strong {
  color: #24292f;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.site-statistic[data-kind="running"] { border-color: #e4d1aa; background: #fff9ef; }
.site-statistic[data-kind="running"] strong { color: #94691f; }
.site-statistic[data-kind="queued"] { border-color: #cbdce5; background: #f3f8fa; }
.site-statistic[data-kind="queued"] strong { color: #34647e; }
.site-statistic[data-kind="paid"] { border-color: #bcd9ce; background: #f1f8f5; }
.site-statistic[data-kind="paid"] strong { color: #176b51; }

.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; }
.link-cdk-heading-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.link-cdk-purchase-button {
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  white-space: nowrap;
  text-decoration: none;
}
.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; }
.link-cdk-fusion-hint { margin: 8px 0 0; color: #8a5b11; font-size: 10px; line-height: 1.5; }

.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-team-heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.payment-team-heading > span {
  color: #24282e;
  font-size: 12px;
  font-weight: 750;
}

.payment-team-refresh {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #ccd1d5;
  border-radius: 5px;
  color: #4f5962;
  background: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.payment-team-refresh:hover { background: #f3f6f5; }
.payment-team-refresh:disabled { cursor: wait; opacity: .55; }
.payment-team-refresh:focus-visible {
  outline: 0;
  border-color: #208060;
  box-shadow: 0 0 0 3px rgba(32, 128, 96, .12);
}

.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(4, minmax(0, 1fr));
  gap: 8px;
}

.payment-actions .button {
  min-height: 34px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
}

.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: repeat(2, minmax(0, 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-manual-submit { color: #ffffff; border-color: #202428; background: #202428; }
.button-manual-submit:hover:not(:disabled) { border-color: #08090a; background: #08090a; }
.button-clear { color: #9a3340; border-color: #e5c5c9; background: #fff8f8; }
.button-clear:hover:not(:disabled) { border-color: #dcaeb4; background: #fff0f1; }
.button-purchase { color: #ffffff; border-color: #d96b16; background: #e8781c; }
.button-purchase:hover { border-color: #bd5510; background: #cf6414; }
.button-purchase[aria-disabled="true"] { pointer-events: none; opacity: .48; }
.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;
  container-type: inline-size;
  container-name: task-board;
}

.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; }

.email-suffix-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(520px, calc(100% - 32px));
  margin: 0;
  padding: 14px 18px;
  transform: translate(-50%, -50%);
  border: 1px solid #e4d1aa;
  border-left: 3px solid #c08a27;
  border-radius: 6px;
  color: #7c571c;
  background: #fff9ef;
  box-shadow: 0 14px 40px rgba(44, 35, 19, .2);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  pointer-events: none;
  text-align: center;
}

.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 {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, 1fr));
  align-items: center;
  gap: 8px;
}
.workspace-buttons .button {
  min-height: 36px;
  white-space: nowrap;
}
.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;
}

@container task-board (max-width: 1005px) {
  .job-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workspace-heading { flex: 1 1 auto; }
  .bulk-copy-actions {
    width: 100%;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .workspace-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: end;
    gap: 8px;
  }
  .task-stats { grid-row: 1; }
  .workspace-buttons { grid-row: 2; justify-self: end; }
}

@container task-board (max-width: 801px) {
  .job-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container task-board (max-width: 597px) {
  .job-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container task-board (max-width: 393px) {
  .job-list { grid-template-columns: minmax(0, 1fr); }
}

.job-card {
  position: relative;
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: auto 300px;
  min-width: 0;
  min-height: 300px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  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; flex: 1 1 auto; 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 {
  flex: 0 0 auto;
  min-height: 24px;
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  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; }

.dialog-header { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e1e4e6; }

.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: 1120px) {
  .workspace-header { align-items: flex-start; }
  .bulk-copy-actions {
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .bulk-copy-actions .button,
  .workspace-buttons .button { min-height: 32px; padding: 6px 8px; font-size: 10px; }
  .workspace-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .workspace-buttons { grid-template-columns: repeat(2, minmax(84px, 1fr)); gap: 6px; }
  .task-stats { gap: 10px; }
  .task-stats span { font-size: 10px; }
  .task-stats strong { font-size: 12px; }
}

@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; }
  .workspace-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .workspace-heading { display: contents; }
  .bulk-copy-actions { order: 1; width: 100%; margin-bottom: 0; }
  .workspace-actions { order: 2; width: 100%; }
  .workspace-heading .section-kicker { order: 3; margin-top: 2px; }
  .workspace-title-row { order: 4; }
  .bulk-copy-actions .button,
  .workspace-buttons .button { min-height: 30px; padding: 5px 6px; }
  .workspace-actions { align-items: flex-end; gap: 6px; }
  .workspace-buttons { grid-template-columns: repeat(2, minmax(78px, 1fr)); gap: 5px; }
  .task-stats { display: flex; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; }
  .task-stats span { font-size: 9px; }
  .task-stats strong { font-size: 11px; }
}

@media (max-width: 720px) {
  .app-header { height: auto; min-height: 64px; padding: 9px 14px; flex-wrap: wrap; gap: 8px; }
  .brand-block h1 { font-size: 15px; }
  .brand-block p { display: none; }
  .header-live-status { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 8px; }
  .header-docs-link { order: 1; flex: 0 0 auto; }
  .service-status { order: 2; }
  .site-statistics { order: 3; width: 100%; flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .site-statistic { min-height: 38px; padding: 5px 7px; align-items: flex-start; font-size: 9px; }
  .site-statistic strong { font-size: 13px; }
  .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; }
  .email-suffix-notice { width: calc(100% - 28px); padding: 12px 14px; font-size: 12px; }
  .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; }
  .bulk-copy-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .task-stats { display: flex; justify-content: space-between; }
  .job-list { gap: 9px; }
  .job-card { padding: 9px; }
  .qr-wrap { width: min(54%, 112px); }
}

@media (max-width: 440px) {
  .link-cdk-heading { align-items: flex-start; }
  .link-cdk-heading-actions { flex-wrap: wrap; }
  .link-cdk-purchase-button { min-height: 30px; padding: 6px 8px; font-size: 10px; }
  .form-actions,
  .proxy-actions { grid-template-columns: 1fr; }
  .recent-timeline { grid-template-columns: repeat(12, minmax(8px, 1fr)); }
  .job-card { width: 100%; max-width: 360px; justify-self: center; }
  .bulk-copy-actions .button { padding-right: 4px; padding-left: 4px; font-size: 9px; }
}

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

/* Temple gold theme: restrained gilt details over a quiet operations surface. */
:root {
  --temple-ink: #24231f;
  --temple-ink-soft: #34322b;
  --temple-gold: #d4a72c;
  --temple-gold-deep: #8c6416;
  --temple-gold-pale: #f3df9a;
  --temple-red: #8f2d20;
  --temple-red-deep: #712218;
  --temple-jade: #176b51;
  --temple-ivory: #fffaf0;
  --temple-canvas: #f1f2ef;
  --temple-line: #dfcf9e;
}

body {
  color: var(--temple-ink);
  background: var(--temple-canvas);
}

.app-header {
  position: relative;
  isolation: isolate;
  height: 76px;
  border-top: 3px solid var(--temple-gold);
  border-bottom: 3px solid var(--temple-red);
  background: var(--temple-ink);
  box-shadow: inset 0 -1px 0 rgba(212, 167, 44, .72), 0 5px 18px rgba(36, 35, 31, .16);
}

/* A restrained roofline and bracket motif gives the header a temple silhouette. */
.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  left: 50%;
  z-index: -1;
  pointer-events: none;
  transform: translateX(-50%);
}

.app-header::before {
  top: 4px;
  width: min(440px, 34vw);
  height: 8px;
  border-right: 14px solid var(--temple-red);
  border-bottom: 1px solid #7e651f;
  border-left: 14px solid var(--temple-red);
}

.app-header::after {
  bottom: -7px;
  width: 76px;
  height: 7px;
  border-right: 7px solid var(--temple-gold-deep);
  border-bottom: 2px solid var(--temple-gold);
  border-left: 7px solid var(--temple-gold-deep);
  background: var(--temple-red);
}

.app-header > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  border: 1px solid var(--temple-gold-pale);
  color: #fff4c9;
  background: var(--temple-red);
  box-shadow: 0 0 0 2px var(--temple-gold-deep), 0 0 16px rgba(212, 167, 44, .38);
  text-shadow: 0 0 8px rgba(255, 244, 201, .7);
}

.brand-block h1 {
  color: var(--temple-gold-pale);
  text-shadow: 0 0 10px rgba(212, 167, 44, .24);
  animation: temple-title-glow 3.8s ease-in-out infinite;
}

.brand-block p { color: #d2c9b2; }

@keyframes temple-title-glow {
  0%, 100% { color: var(--temple-gold-pale); text-shadow: 0 0 8px rgba(212, 167, 44, .18); }
  50% { color: #fff1bd; text-shadow: 0 0 15px rgba(212, 167, 44, .48); }
}

.header-docs-link {
  border-color: #8f762f;
  color: #f0d77f;
  background: #34322b;
}

.header-docs-link:hover {
  border-color: var(--temple-gold-pale);
  color: #fff4c9;
  background: #423d30;
  box-shadow: 0 0 10px rgba(212, 167, 44, .2);
}

.header-sad-cdk-link {
  border-color: #c76e62;
  color: #ffd1c9;
  background: #51251f;
}

.header-sad-cdk-link:hover {
  border-color: #e7978b;
  color: #ffe6e1;
  background: #672b23;
}

.site-statistic,
.site-statistic[data-kind="running"],
.site-statistic[data-kind="queued"],
.site-statistic[data-kind="paid"] {
  border-color: #6e6040;
  color: #c8c0ad;
  background: #302f2a;
}

.site-statistic strong { color: var(--temple-gold-pale); }
.site-statistic[data-kind="running"] strong { color: #f0c65a; }
.site-statistic[data-kind="queued"] strong { color: #9ecbd2; }
.site-statistic[data-kind="paid"] strong { color: #8ed0b8; }

.service-status {
  border-color: #6e6040;
  color: #d7ceba;
  background: #302f2a;
}

.service-status[data-state="online"] {
  border-color: #5d987f;
  color: #a9dec9;
  background: #263b32;
}

.service-status[data-state="offline"] {
  border-color: #a55852;
  color: #f0b4ae;
  background: #492a27;
}

.app-layout { min-height: calc(100vh - 76px); }

.control-panel {
  border-right-color: var(--temple-line);
  background: var(--temple-ivory);
  box-shadow: 5px 0 18px rgba(73, 59, 27, .05);
}

.task-workspace { background: var(--temple-canvas); }

.section-kicker { color: var(--temple-gold-deep); }
.panel-heading h2,
.workspace-header h2,
.dialog-header h2,
.recent-results h2 { color: var(--temple-ink); }

.panel-heading > p:last-child,
.empty-state p { color: #706d64; }

.recent-results,
.job-card {
  border-color: var(--temple-line);
  background: #fffefd;
  box-shadow: 0 3px 12px rgba(73, 59, 27, .07), inset 0 1px 0 #fff8df;
}

.recent-results {
  position: relative;
  border-top: 2px solid var(--temple-gold);
}

.recent-results::before,
.recent-results::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.recent-results::before {
  left: 6px;
  border-top: 2px solid rgba(140, 100, 22, .58);
  border-left: 2px solid rgba(140, 100, 22, .58);
}

.recent-results::after {
  right: 6px;
  border-top: 2px solid rgba(140, 100, 22, .58);
  border-right: 2px solid rgba(140, 100, 22, .58);
}
.recent-results-summary > strong { color: var(--temple-jade); }
.recent-results-summary > strong:nth-of-type(2) { color: #b64042; }
.recent-summary-divider { background: var(--temple-line); }

.recent-swatch-success { background: #268c69; }
.recent-swatch-failure { background: #c94e55; }
.recent-swatch-empty { border-color: #d8d2c2; background: #eeece5; }
.recent-block { border-color: #dfd8c5; background: #eeeae0; }

.field-label,
.link-cdk-heading strong,
.toggle-row strong,
.fixed-config > div strong,
.task-stats strong { color: var(--temple-ink); }

textarea,
.payment-field select,
.payment-field input {
  border-color: #cfc6ad;
  color: var(--temple-ink);
  background: #fffef9;
}

textarea:focus,
.payment-field input:focus,
.payment-field select:focus {
  border-color: var(--temple-gold-deep);
  box-shadow: 0 0 0 3px rgba(212, 167, 44, .17);
}

.fixed-config {
  border-top-color: var(--temple-line);
  border-bottom-color: var(--temple-line);
}

.fixed-config > div,
.toggle-row { border-bottom-color: #e7dfca; }
.toggle-row input:checked + .toggle { background: var(--temple-jade); }
.toggle-row input:focus-visible + .toggle { outline-color: rgba(212, 167, 44, .35); }

.link-cdk-config {
  border-color: #d2bd79;
  background: #fff9e9;
  box-shadow: inset 0 1px 0 #fffdf5;
}

.link-cdk-metrics > div,
.payment-config {
  border-color: #ded2ae;
  background: #fffdf7;
}

.payment-team-refresh,
.icon-button {
  border-color: #cfc3a3;
  color: #655530;
  background: #fffef9;
}

.payment-team-refresh:hover,
.icon-button:hover { background: #fff7dc; }

.button:focus-visible,
.icon-button:focus-visible,
.card-action:focus-visible,
.payment-team-refresh:focus-visible {
  border-color: var(--temple-gold-deep);
  outline-color: rgba(212, 167, 44, .32);
  box-shadow: 0 0 0 3px rgba(212, 167, 44, .17);
}

.button-primary {
  border-color: var(--temple-gold);
  color: #fff8df;
  background: var(--temple-red);
  box-shadow: inset 0 1px 0 rgba(255, 236, 178, .3), 0 3px 9px rgba(113, 34, 24, .18);
}

.button-primary:hover:not(:disabled) { background: var(--temple-red-deep); }

.button-secondary {
  border-color: #cbbd94;
  color: #4d4533;
  background: #fffef9;
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--temple-gold-deep);
  background: #fff8e3;
}

.button-purchase {
  border-color: var(--temple-gold-deep);
  color: var(--temple-ink);
  background: var(--temple-gold);
  box-shadow: inset 0 1px 0 #f4dc87;
}

.button-purchase:hover {
  border-color: #6e4d0d;
  color: #171611;
  background: #e0b83e;
}

.button-manual-submit {
  border-color: var(--temple-gold);
  color: #fff8df;
  background: var(--temple-ink);
}

.button-manual-submit:hover:not(:disabled) { background: #11110f; }
.button-copy-success { color: var(--temple-jade); border-color: #9bc4b5; background: #f2f8f5; }

.form-error {
  border-left-color: var(--temple-red);
  color: #832e31;
  background: #fff4f1;
}

.email-suffix-notice {
  border-color: var(--temple-gold);
  border-left-color: var(--temple-red);
  color: #5f4212;
  background: #fff8df;
  box-shadow: 0 14px 40px rgba(44, 35, 19, .22), 0 0 0 1px rgba(212, 167, 44, .25);
}

.job-card[data-status="done"] { border-color: #8fbea9; }
.job-card[data-status="error"] { border-color: #dfaaa9; }
.job-card[data-status="running"] {
  border-color: var(--temple-gold);
  box-shadow: 0 3px 14px rgba(140, 100, 22, .12), inset 0 2px 0 #f0d77f;
}

.job-number {
  color: #5b471c;
  background: #f7edce;
}

.job-payment { border-top-color: #e8dfc8; }
.job-card[data-status="running"] .job-status { color: var(--temple-gold-deep); }

.job-countdown { color: var(--temple-jade); }
.job-countdown-value { border-color: #9bc4b5; background: #f2f8f5; }

.progress-ring {
  background: conic-gradient(var(--temple-gold) calc(var(--progress) * 1%), #e8e4da 0);
  box-shadow: 0 0 12px rgba(212, 167, 44, .13);
}

.progress-ring::before { color: #4d4533; background: #fffefd; }
.draft-mark { border-color: #bcae88; color: #6b5b36; background: #fffaf0; }
.qr-wrap { border-color: #d7c99f; }

.card-action {
  border-color: #d4c9aa;
  color: #4f4838;
  background: #fbf8ef;
}

.card-action:hover:not(:disabled) { border-color: var(--temple-gold-deep); background: #fffdf5; }
.dialog-header { border-bottom-color: var(--temple-line); }

.toast {
  border: 1px solid var(--temple-gold);
  color: #fff2bd;
  background: var(--temple-ink);
  box-shadow: 0 10px 28px rgba(23, 26, 31, .24), 0 0 12px rgba(212, 167, 44, .16);
}

@media (max-width: 720px) {
  .app-header { height: auto; min-height: 68px; }
  .app-header::before { width: 46vw; }
  .app-header::after { display: none; }
  .control-panel { border-bottom-color: var(--temple-line); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-block h1 { animation: none !important; }
}
