:root {
  color-scheme: light;
  --bg: #f2f5f6;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #18221f;
  --muted: #66736f;
  --line: #dce2e4;
  --line-soft: #e9edef;
  --teal: #0f877f;
  --teal-dark: #0b6e68;
  --teal-soft: #e0f2ef;
  --blue: #3468b7;
  --blue-soft: #e6edfa;
  --amber: #9f6816;
  --amber-soft: #f8ecd7;
  --green: #2f7b4c;
  --green-soft: #e0f1e6;
  --red: #b0443d;
  --red-soft: #f8e3e1;
  --shadow: 0 10px 26px rgba(27, 43, 38, 0.06);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea { font: inherit; }

button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

button:hover { border-color: #abb8b7; background: #f8fbfa; }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }

button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

button.primary:hover { border-color: var(--teal-dark); background: var(--teal-dark); }

button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.brand,
.topbar-actions,
.header-worker-state,
.section-heading,
.inline-actions {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; min-width: 0; }

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #26322f;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.brand h1,
.brand p,
.stage-heading h2,
.stage-heading p,
.section-heading h3,
.section-heading span { margin: 0; }
.brand h1 { font-size: 18px; line-height: 1.25; }
.brand p { color: var(--muted); font-size: 12px; }

.topbar-actions { gap: 8px; }
.header-worker-state { gap: 7px; margin-right: 6px; color: #52605b; font-size: 13px; }
.status-orb { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #9da6a4; }
.status-orb.online { background: #25a45a; box-shadow: 0 0 0 3px #dff3e7; }

.icon-button {
  width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.text-button { background: transparent; }

.stage-nav {
  position: sticky;
  top: 64px;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 4px 14px rgba(23, 37, 33, .04);
}

.stage-tab {
  position: relative;
  min-width: 0;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4e5a57;
}

.stage-tab:hover { border: 0; background: #f8faf9; }
.stage-tab::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: transparent; content: ""; }
.stage-tab.active { color: var(--teal); background: #f7fcfb; }
.stage-tab.active::after { background: var(--teal); }
.stage-tab-icon { width: 34px; height: 34px; display: grid; place-items: center; }
.stage-tab-icon svg { width: 25px; height: 25px; }
.stage-tab > span:last-child { min-width: 0; display: grid; gap: 2px; text-align: left; }
.stage-tab strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.stage-tab small { color: var(--muted); font-size: 12px; }

main { width: 100%; padding: 20px; }
.stage-workspace { width: 100%; }

.boot-skeleton { display: none; width: 100%; }
.app-booting .boot-skeleton { display: block; }
.app-booting .stage-workspace { display: none; }

.boot-skeleton-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.boot-skeleton-header > div { min-width: 0; display: grid; gap: 2px; }
.boot-skeleton-header strong { font-size: 18px; }
.boot-skeleton-header span:last-child { color: var(--muted); font-size: 12px; }

.boot-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 3px solid #d8e3e1;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: boot-spin .8s linear infinite;
}

.boot-action-placeholder {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.boot-record-placeholder {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.boot-record-placeholder > div {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) minmax(120px, .8fr) 96px;
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.boot-record-placeholder > div:last-child { border-bottom: 0; }
.skeleton-line,
.skeleton-button,
.skeleton-pill {
  display: block;
  background: linear-gradient(90deg, #e7eceb 22%, #f4f7f6 42%, #e7eceb 62%);
  background-size: 260% 100%;
  animation: boot-shimmer 1.35s ease-in-out infinite;
}
.skeleton-line { width: 100%; height: 12px; border-radius: 5px; }
.skeleton-line-wide { width: min(420px, 70%); height: 15px; }
.skeleton-line-title { max-width: 360px; height: 15px; }
.skeleton-line-meta { max-width: 180px; height: 11px; }
.skeleton-line-short { width: 62%; }
.skeleton-line-medium { width: 78%; }
.skeleton-button { width: 108px; height: 38px; flex: 0 0 108px; border-radius: 7px; }
.skeleton-pill { width: 82px; height: 24px; border-radius: 7px; background: #e0f2ef; }

@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.stage-heading {
  min-height: 64px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.stage-heading h2 { font-size: 26px; line-height: 1.25; }
.stage-heading p { margin-top: 4px; color: var(--muted); }
.stage-meta { display: grid; justify-items: end; gap: 2px; padding-top: 3px; }
.stage-meta strong { font-size: 16px; }
.stage-meta span { color: var(--muted); font-size: 12px; }

.back-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 8px;
  padding: 0 7px 0 3px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
}
.back-button svg { width: 18px; height: 18px; }

.stage-action-bar {
  min-height: 70px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stage-batch-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 152px auto;
  align-items: center;
  gap: 14px;
}
.source-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .38fr); gap: 16px; align-items: center; }
.source-collect-action { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 16px; border-left: 1px solid var(--line); }
.source-collect-action > div { min-width: 0; display: grid; gap: 6px; }
.source-collect-action small { color: var(--muted); }
.source-collect-copy { min-width: 0; }
.source-task-status { min-width: 0; display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: center; gap: 7px; }
.source-task-status > i { width: 8px; height: 8px; border-radius: 50%; background: #8a9894; }
.source-task-status > span { min-width: 0; display: grid; gap: 1px; }
.source-task-status b { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.source-task-status.active > i { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); animation: source-pulse 1.4s ease-in-out infinite; }
.source-task-status.failed > i { background: var(--red); }
.source-task-status.failed b { color: var(--red); }
@keyframes source-pulse { 50% { opacity: .42; transform: scale(.82); } }

.batch-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.batch-copy { display: grid; gap: 1px; }
.batch-copy strong { font-size: 15px; }
.batch-copy small { color: var(--muted); }

.number-stepper {
  height: 40px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.number-stepper button { min-height: 38px; padding: 0; border: 0; border-radius: 0; font-size: 20px; }
.number-stepper input { width: 100%; min-width: 0; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); text-align: center; font-weight: 800; outline: none; }
.number-stepper input::-webkit-inner-spin-button { display: none; }

.record-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.record-header,
.record-row {
  display: grid;
  grid-template-columns: minmax(320px, 2.2fr) minmax(120px, .7fr) minmax(90px, .45fr) minmax(130px, .7fr) minmax(130px, .7fr) 100px;
  gap: 16px;
  align-items: center;
}

.record-header {
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-row {
  width: 100%;
  min-height: 72px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: var(--surface);
  text-align: left;
}
.record-row:last-child { border-bottom: 0; }
.record-row:hover { border-color: var(--line-soft); background: #f8fbfa; }
.record-row.expired { color: #736563; background: #fcf9f9; }
.record-row.processing { box-shadow: inset 3px 0 0 var(--teal); background: #f7fbfa; }
.record-row > span { min-width: 0; display: grid; gap: 2px; }
.record-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-row small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.record-title strong { font-size: 15px; }
.score-value { width: max-content; padding: 2px 8px; border-radius: 5px; background: #e6f5eb; color: var(--green); font-size: 16px; }
.score-value.blocked { background: var(--red-soft); color: var(--red); font-size: 13px; }
.record-open { display: flex !important; grid-auto-flow: column; align-items: center; justify-content: end; color: var(--blue); font-weight: 800; }
.record-open svg { width: 16px; height: 16px; transform: rotate(45deg); }
.record-state { align-content: center; }
.record-reminder { color: #8a6315 !important; }
.record-progress { width: 100%; height: 4px; overflow: hidden; border-radius: 4px; background: #dce9e6; }
.record-progress i { height: 100%; display: block; border-radius: inherit; background: var(--teal); transition: width .25s ease; }

.status-label {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #ebeff0;
  color: #52615c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-label.collected { background: #ebeff0; color: #53615c; }
.status-label.candidate { background: var(--blue-soft); color: var(--blue); }
.status-label.draft { background: #ece8f7; color: #6653a2; }
.status-label.attention { background: var(--amber-soft); color: var(--amber); }
.status-label.done { background: var(--green-soft); color: var(--green); }
.status-label.blocked { background: var(--red-soft); color: var(--red); }

.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--ink); font-size: 16px; }

.record-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.record-pagination > div { display: flex; align-items: center; gap: 5px; }
.record-pagination button { min-width: 34px; min-height: 34px; padding: 0 9px; }
.record-pagination button.active { border-color: var(--teal); background: var(--teal); color: #fff; }
.record-pagination i { min-width: 22px; color: var(--muted); text-align: center; font-style: normal; }

.record-detail { display: grid; gap: 14px; padding-bottom: 4px; }
.record-detail-hero {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fbfa 100%);
  box-shadow: 0 8px 24px rgba(27, 43, 38, .045);
}
.record-detail-title { display: grid; gap: 9px; }
.record-detail-hero h2 { max-width: 1080px; margin: 0; font-size: 24px; line-height: 1.4; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-meta > span {
  min-width: 128px;
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}
.detail-meta small { color: var(--muted); font-size: 11px; }
.detail-meta strong { font-size: 13px; }
.locked-action,
.running-action,
.complete-action,
.muted-action { display: inline-flex; align-items: center; min-height: 38px; padding: 0 11px; border-radius: 7px; background: #f1f4f4; color: var(--muted); font-weight: 800; }
.locked-action { background: var(--red-soft); color: var(--red); }
.running-action { background: var(--amber-soft); color: var(--amber); }
.complete-action { background: var(--green-soft); color: var(--green); }

.execution-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr);
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid #c9ddd9;
  border-radius: 8px;
  background: #f7fbfa;
}
.execution-panel.failed { border-color: #e7c3bf; background: #fff8f7; }
.execution-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.execution-copy > div { min-width: 0; display: grid; gap: 1px; }
.execution-copy strong { font-size: 14px; }
.execution-copy small { color: var(--muted); }
.execution-panel.failed .execution-copy strong,
.execution-panel.failed p { color: var(--red); }
.execution-panel p { margin: 0; overflow-wrap: anywhere; }
.execution-panel.resolution-panel { grid-template-columns: minmax(220px, .62fr) minmax(0, 1fr); border-color: #ead7aa; background: #fffbf2; }
.execution-panel.resolution-panel .execution-copy strong { color: #7a550f; }
.execution-panel.resolution-panel p { color: #5f4a20; line-height: 1.6; }
.execution-panel.resolution-panel .blocker-items { grid-column: 1 / -1; }
.blocker-items { margin: 10px 0 0; padding: 10px 12px 10px 30px; border: 1px solid #ead7aa; border-radius: 7px; background: #fffdf7; color: #5f4a20; line-height: 1.65; }
.blocker-items li + li { margin-top: 4px; }
.execution-meter { height: 6px; overflow: hidden; border-radius: 6px; background: #dce9e6; }
.execution-meter i { width: 38%; height: 100%; display: block; border-radius: inherit; background: var(--teal); animation: execution-scan 1.6s ease-in-out infinite alternate; }
.execution-dialogue { grid-column: 1 / -1; display: grid; gap: 7px; padding-top: 2px; }
.execution-dialogue div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, .72); }
.execution-dialogue strong { color: var(--teal-strong); font-size: 12px; }
.execution-dialogue span { min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
@keyframes execution-scan { from { transform: translateX(0); } to { transform: translateX(165%); } }

.submitted-reminder {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid #ead7aa;
  border-radius: 8px;
  background: #fffaf0;
}
.submitted-reminder > div { display: grid; gap: 1px; }
.submitted-reminder strong { color: #765615; }
.submitted-reminder span { color: var(--muted); font-size: 12px; }
.submitted-reminder p { margin: 0; color: #65573a; overflow-wrap: anywhere; }

.detail-shell {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.detail-nav {
  position: sticky;
  top: 158px;
  z-index: 20;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.detail-nav-heading { display: grid; gap: 1px; padding: 14px 15px 11px; border-bottom: 1px solid var(--line-soft); }
.detail-nav-heading strong { font-size: 15px; }
.detail-nav-heading span { color: var(--muted); font-size: 12px; }
.detail-nav-list { display: grid; padding: 6px; }
.detail-nav-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.detail-nav-item:hover { border: 0; background: #f5f9f8; }
.detail-nav-item.active { background: var(--teal-soft); color: var(--teal-dark); }
.detail-nav-item.unavailable { background: transparent; opacity: .45; }
.detail-nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: #67736f;
}
.detail-nav-item.active .detail-nav-icon { background: #fff; color: var(--teal); }
.detail-nav-icon svg { width: 18px; height: 18px; }
.detail-nav-item > span:last-child { min-width: 0; display: grid; gap: 1px; }
.detail-nav-item strong,
.detail-nav-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-nav-item strong { font-size: 14px; }
.detail-nav-item small { color: var(--muted); font-size: 11px; }

.detail-content { min-width: 0; display: grid; gap: 12px; }
.detail-content-heading {
  min-height: 64px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--line);
}
.detail-content-heading > div { display: grid; gap: 1px; }
.detail-content-heading span,
.detail-content-heading small { color: var(--muted); font-size: 12px; }
.detail-content-heading h3 { margin: 0; font-size: 21px; }
.detail-panel-stack { display: grid; gap: 12px; }

.detail-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.section-heading { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h3 { font-size: 16px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.inline-actions { flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.small-link { min-height: 34px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #f8faf9; font-size: 12px; font-weight: 800; }

.info-list { display: grid; gap: 8px; margin: 0; }
.info-list > div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 9px; }
.info-list dt { color: var(--muted); }
.info-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.info-list.compact > div { grid-template-columns: 86px minmax(0, 1fr); }
.summary-copy { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.summary-copy h4 { margin: 0 0 6px; }
.summary-copy p,
.long-text { margin: 0; color: #34413d; white-space: pre-wrap; }
.section-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: #f4f8f7;
  color: #42534e;
  line-height: 1.65;
}

.workflow-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.workflow-progress li {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-2);
}
.workflow-progress li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8edec;
  color: #64716d;
  font-weight: 900;
}
.workflow-progress li > div { min-width: 0; display: grid; gap: 1px; }
.workflow-progress li small { color: var(--muted); font-size: 11px; }
.workflow-progress li.current { border-color: #acd8d2; background: #f4fbf9; }
.workflow-progress li.current > span { background: var(--teal); color: #fff; }
.workflow-progress li.done > span { background: var(--green-soft); color: var(--green); }
.next-step-card {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 13px 14px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f5faf9;
}
.next-step-card span { color: var(--teal-dark); font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.next-step-card strong { font-size: 15px; }
.next-step-card p { margin: 0; color: var(--muted); }

.draft-body {
  max-height: min(68vh, 900px);
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fcfdfd;
  font-size: 15px;
  line-height: 1.9;
}
.draft-body h3,
.draft-body h4,
.draft-body h5 { margin: 18px 0 8px; line-height: 1.35; }
.draft-body h3:first-child,
.draft-body h4:first-child { margin-top: 0; }
.draft-body p { margin: 0 0 12px; white-space: pre-wrap; }
.draft-body ul { margin: 0 0 12px 20px; padding: 0; }
.loading-inline,
.error-inline,
.empty-inline { padding: 14px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fafcfc; color: var(--muted); }
.error-inline { border-color: #ecc9c5; background: #fff8f7; color: var(--red); }

.check-grid { display: grid; gap: 7px; margin-top: 12px; }
.check-grid span { padding: 8px 9px; border-radius: 6px; background: var(--surface-2); color: #50605b; }
.review-extension {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bcdcd6;
  border-radius: 9px;
  background: #f4fbf9;
}
.review-extension > div { min-width: 0; display: grid; gap: 2px; }
.review-extension span { color: var(--muted); font-size: 12px; }
.review-feedback-list { display: grid; gap: 8px; margin-top: 12px; }
.review-feedback-list article {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #d6dfe0;
  border-left: 3px solid var(--amber);
  border-radius: 7px;
  background: #fffdf7;
}
.review-feedback-list article.failed { border-color: #e5c4bf; border-left-color: var(--red); background: #fff8f7; }
.review-feedback-list article.done { border-left-color: var(--green); background: #f6fbf7; }
.review-feedback-list article > div { display: flex; justify-content: space-between; gap: 12px; }
.review-feedback-list article span,
.review-feedback-list article small { color: var(--muted); font-size: 12px; }
.review-feedback-list article p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-round-list { display: grid; gap: 12px; margin-top: 14px; }
.review-round-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.review-round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #f7f9f9;
}
.review-round-header strong { color: var(--teal-dark); font-size: 15px; }
.review-round-header span { color: var(--muted); font-size: 11px; text-align: right; }
.review-round-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.review-round-block { min-width: 0; padding: 12px 14px; }
.review-round-block + .review-round-block { border-left: 1px solid var(--line-soft); }
.review-round-block > span { display: block; margin-bottom: 6px; color: var(--amber); font-size: 12px; font-weight: 900; }
.review-round-block.revise > span { color: var(--teal); }
.review-round-block p { margin: 0; color: #34413d; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-round-block.empty p { color: var(--muted); font-style: italic; }
.review-summary-raw { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface-2); }
.review-summary-raw summary { cursor: pointer; color: var(--muted); font-weight: 800; }
.review-summary-raw p { margin: 9px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-body { min-height: 180px; margin: 12px 0 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 7px; background: #f9fbfb; white-space: pre-wrap; word-break: break-word; font: inherit; }
.mail-action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }

.detail-action-dock {
  position: sticky;
  bottom: 12px;
  z-index: 28;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 12px 10px 16px;
  border: 1px solid #cbd9d6;
  border-radius: 12px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 34px rgba(27, 43, 38, .16);
  backdrop-filter: blur(14px);
}
.detail-action-copy { display: grid; gap: 1px; }
.detail-action-copy small { color: var(--muted); }
.detail-action-controls { display: flex; justify-content: flex-end; }
.detail-action-controls > button,
.detail-action-controls > span { min-width: 150px; justify-content: center; text-align: center; }
.detail-action-controls .mail-action-row { min-width: 360px; margin: 0; }

.feedback-section form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.feedback-section textarea { width: 100%; min-height: 92px; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); line-height: 1.65; }
.feedback-section textarea:focus { outline: 2px solid rgba(15, 135, 127, .14); border-color: var(--teal); }
.history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.history-list > div { min-width: 0; display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface-2); }
.history-list > div.review { border-left: 3px solid var(--amber); }
.history-list > div.attention { border-left: 3px solid var(--amber); background: #fffaf0; }
.history-list > div.revise { border-left: 3px solid var(--teal); }
.history-list > div.done { border-left: 3px solid var(--green); }
.history-list > div.failed { border-left: 3px solid var(--red); }
.history-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list span { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-list span { color: var(--muted); font-size: 12px; }

.operation-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 11px;
  border: 1px solid #c5d9d5;
  border-radius: 7px;
  background: #f4fbf9;
  color: #35534d;
}
.operation-status[hidden] { display: none; }
.operation-status[data-tone="working"]::before { width: 12px; height: 12px; border: 2px solid #bddbd6; border-top-color: var(--teal); border-radius: 50%; content: ""; animation: spin .7s linear infinite; }
.operation-status[data-tone="success"] { border-color: #bedac8; background: #f4faf6; color: var(--green); }
.operation-status[data-tone="error"] { border-color: #e7c2bd; background: #fff7f6; color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  border: 0;
  border-radius: 0;
  background: rgba(23, 34, 31, .28);
}
.system-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 72;
  width: min(480px, 94vw);
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--bg);
  box-shadow: -24px 0 50px rgba(19, 32, 28, .16);
  transform: translateX(105%);
  transition: transform .2s ease;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer-backdrop { display: block; }
body.drawer-open .system-drawer { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.drawer-header h2 { margin: 0; font-size: 22px; }
.drawer-header p { margin: 2px 0 0; color: var(--muted); }
.drawer-section { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-form label { min-width: 0; display: grid; gap: 4px; }
.profile-form label > span { color: var(--muted); font-size: 12px; }
.profile-form input,
.profile-form textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.profile-form textarea { resize: vertical; line-height: 1.55; }
.profile-wide { grid-column: 1 / -1; }
.profile-protected { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.profile-protected small { width: 100%; }
.worker-row,
.compact-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.worker-row:last-child,
.compact-row:last-child { border-bottom: 0; }
.worker-row > div,
.compact-row > div { min-width: 0; display: grid; gap: 2px; }
.worker-row strong,
.worker-row small,
.compact-row strong,
.compact-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-row small,
.compact-row small { color: var(--muted); }
.run-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #9ca6a3; }
.run-dot.completed { background: var(--green); }
.run-dot.failed { background: var(--red); }

.login-panel { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: #e9eeef; }
.login-box { width: min(400px, 100%); display: grid; gap: 14px; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 24px 60px rgba(22, 36, 32, .16); }
.login-box h2,
.login-box p { margin: 0; }
.login-box p { color: var(--muted); }
.login-box label { display: grid; gap: 6px; }
.login-box input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; }
.login-error { min-height: 20px; color: var(--red); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 110; max-width: 420px; padding: 11px 14px; border-radius: 7px; background: #26322f; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.fatal-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.fatal-screen section { width: min(440px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: center; }

@media (max-width: 1080px) {
  .stage-tab { gap: 6px; }
  .stage-tab-icon { width: 27px; height: 27px; }
  .stage-tab-icon svg { width: 21px; height: 21px; }
  .record-header,
  .record-row { grid-template-columns: minmax(280px, 2fr) 120px 80px 120px 120px 90px; gap: 10px; }
  .detail-shell { grid-template-columns: 204px minmax(0, 1fr); }
  .detail-nav-item { grid-template-columns: 30px minmax(0, 1fr); padding-right: 7px; padding-left: 7px; }
  .detail-nav-icon { width: 29px; height: 29px; }
}

@media (max-width: 760px) {
  .topbar { height: 58px; padding: 7px 12px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .brand h1 { font-size: 16px; }
  .brand p { display: none; }
  .header-worker-state span:last-child { display: none; }
  .text-button { display: none; }
  .stage-nav { top: 58px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage-nav::-webkit-scrollbar { display: none; }
  .stage-tab { min-height: 66px; gap: 5px; padding: 7px 5px; }
  .stage-tab strong { font-size: 13px; }
  main { padding: 12px; }
  .boot-skeleton-header { min-height: 48px; margin-bottom: 10px; }
  .boot-action-placeholder { min-height: 62px; padding: 12px; }
  .boot-record-placeholder { border-right: 0; border-left: 0; border-radius: 0; }
  .boot-record-placeholder > div { min-height: 94px; grid-template-columns: 1fr 72px; gap: 10px; padding: 14px 4px; }
  .boot-record-placeholder .skeleton-line-title { grid-column: 1 / -1; }
  .boot-record-placeholder .skeleton-line-meta { width: 72%; }
  .boot-record-placeholder .skeleton-pill { justify-self: end; }
  .stage-heading { min-height: 0; align-items: center; margin-bottom: 10px; }
  .stage-heading h2 { font-size: 22px; }
  .stage-heading p { font-size: 12px; }
  .stage-meta strong { font-size: 14px; }
  .stage-meta span { display: none; }
  .stage-action-bar { min-height: 0; padding: 10px; }
  .stage-batch-form { grid-template-columns: 1fr 128px; gap: 8px; }
  .stage-batch-form .batch-copy { grid-column: 1 / -1; }
  .stage-batch-form > button[type="submit"] { min-width: 0; padding: 0 8px; }
  .source-actions { grid-template-columns: 1fr; gap: 10px; }
  .source-collect-action { padding: 10px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .record-header { display: none; }
  .record-surface { border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .record-row { min-height: 100px; grid-template-columns: minmax(100px, 1.2fr) 52px minmax(78px, .9fr) 24px; gap: 7px 9px; padding: 11px 4px; }
  .record-row .record-title { grid-column: 1 / 4; }
  .record-title strong { font-size: 15px; }
  .record-title small { display: none; }
  .record-row > span[data-label] { display: flex; align-items: center; gap: 4px; }
  .record-row > span[data-label]::before { display: none; }
  .record-row > span[data-label="字数要求"] { display: none; }
  .record-row > span[data-label="当前状态"] { grid-column: 1 / 4; display: grid; grid-template-columns: max-content minmax(60px, 1fr) max-content; align-items: center; gap: 7px; }
  .record-row > span[data-label="当前状态"] > small { display: block; }
  .record-row > span[data-label="截止时间"] strong { font-size: 12px; }
  .record-row small { display: none; }
  .score-value { padding: 0; background: transparent; color: var(--amber); font-size: 14px; }
  .score-value.blocked { color: var(--red); font-size: 12px; }
  .record-pagination { min-height: 0; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 4px; }
  .record-pagination > span { text-align: center; }
  .record-pagination > div { justify-content: center; flex-wrap: wrap; }
  .record-pagination button { min-width: 36px; padding: 0 7px; }
  .record-open { grid-column: 4; grid-row: 1 / 4; align-self: center; font-size: 0; }
  .record-open svg { width: 19px; height: 19px; color: #67736f; }
  .record-detail { gap: 10px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .record-detail-hero { padding: 14px; border-radius: 10px; }
  .record-detail-hero h2 { font-size: 19px; }
  .detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .detail-meta > span { min-width: 0; padding: 7px 8px; }
  .detail-meta strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .execution-panel { grid-template-columns: 1fr; gap: 10px; padding: 12px 13px; }
  .submitted-reminder { grid-template-columns: 1fr; gap: 7px; padding: 12px 13px; }
  .execution-dialogue div { grid-template-columns: 1fr; gap: 3px; }
  .detail-shell { display: block; }
  .detail-nav {
    width: 100%;
    max-width: 100%;
    top: 124px;
    margin-bottom: 10px;
    overflow-x: auto;
    border-radius: 10px;
    scrollbar-width: none;
  }
  .detail-nav::-webkit-scrollbar { display: none; }
  .detail-nav-heading { display: none; }
  .detail-nav-list {
    width: max-content;
    min-width: 0;
    grid-auto-flow: column;
    grid-auto-columns: minmax(84px, 1fr);
    padding: 5px;
  }
  .detail-nav-item {
    min-height: 50px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
    padding: 6px 7px;
  }
  .detail-nav-icon { width: 24px; height: 24px; border-radius: 6px; }
  .detail-nav-icon svg { width: 15px; height: 15px; }
  .detail-nav-item small { display: none; }
  .detail-nav-item strong { font-size: 13px; text-align: center; }
  .detail-content { gap: 10px; }
  .detail-content-heading { min-height: 50px; padding: 2px 3px 8px; }
  .detail-content-heading h3 { font-size: 19px; }
  .detail-content-heading > small { max-width: 46%; text-align: right; }
  .detail-section { padding: 13px; border-radius: 10px; box-shadow: none; }
  .workflow-progress { gap: 6px; }
  .workflow-progress li { grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 8px 4px; text-align: center; }
  .workflow-progress li > span { width: 27px; height: 27px; }
  .workflow-progress li small { display: none; }
  .draft-body { max-height: none; padding: 14px; }
  .review-extension { grid-template-columns: 1fr; }
  .review-extension button { width: 100%; }
  .review-round-pair { grid-template-columns: 1fr; }
  .review-round-block + .review-round-block { border-top: 1px solid var(--line-soft); border-left: 0; }
  .feedback-section form { grid-template-columns: 1fr; }
  .history-list { grid-template-columns: 1fr; }
  .mail-action-row { grid-template-columns: 1fr; }
  .detail-action-dock {
    bottom: calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
    border-radius: 11px;
  }
  .detail-action-copy { display: none; }
  .detail-action-controls,
  .detail-action-controls > button,
  .detail-action-controls > span,
  .detail-action-controls .mail-action-row { width: 100%; min-width: 0; }
  .detail-action-controls .mail-action-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-action-controls .mail-action-row button { min-width: 0; padding-right: 7px; padding-left: 7px; }
  .toast { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
}

@media (max-width: 390px) {
  .stage-batch-form { grid-template-columns: 116px minmax(0, 1fr); }
  .stage-heading p { display: none; }
  .record-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 24px; }
  .record-row .record-title { grid-column: 1 / 3; }
  .record-row > span[data-label="当前状态"] { grid-column: 1 / 3; }
  .record-open { grid-column: 3; grid-row: 1 / 4; }
}

body.is-mobile-app { background: #fff; }
body.is-mobile-app.has-native-shell .topbar,
body.is-mobile-app.has-native-shell .stage-nav { display: none; }
body.is-mobile-app.has-native-shell main { padding: 10px 12px 14px; }
body.is-mobile-app.has-native-shell .stage-heading h2 { display: none; }
body.is-mobile-app.has-native-shell .stage-heading p { margin: 0; }
body.is-mobile-app.has-native-shell .stage-heading { min-height: 28px; }
body.is-mobile-app.has-native-shell .stage-meta { display: none; }
body.is-mobile-app.has-native-shell .boot-skeleton-header { min-height: 46px; }
body.is-mobile-app.has-native-shell .detail-nav { top: 0; }
body.is-mobile-app.has-native-shell.record-detail-open .stage-heading p { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.source-task-status {
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  grid-template-columns: 9px minmax(0, 1fr) auto;
}
.source-task-status:hover { border-color: var(--line); background: var(--surface-2); }
.source-task-status em { color: var(--teal); font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.source-collect-buttons { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; white-space: nowrap; }
.source-history-button { color: var(--teal-dark); font-weight: 800; }

.source-tasks-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(16, 26, 23, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.source-tasks-backdrop:hover { background: rgba(16, 26, 23, .42); }
.source-tasks-drawer {
  position: fixed;
  z-index: 79;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(980px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(22, 36, 32, .24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(28px);
  transition: opacity .2s ease, transform .2s ease;
}
.source-tasks-open { overflow: hidden; }
.source-tasks-open .source-tasks-backdrop { opacity: 1; pointer-events: auto; }
.source-tasks-open .source-tasks-drawer { opacity: 1; pointer-events: auto; transform: translateX(0); }
.source-tasks-header {
  min-height: 104px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fbfa, #eef7f5);
}
.source-tasks-header > div { display: grid; gap: 2px; }
.source-tasks-header span { color: var(--teal-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.source-tasks-header h2 { margin: 0; font-size: 22px; }
.source-tasks-header p { margin: 2px 0 0; color: var(--muted); }
.source-tasks-layout { min-height: 0; display: grid; grid-template-columns: 292px minmax(0, 1fr); }
.source-task-history-pane { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid var(--line); background: #f7f9f9; }
.source-task-pane-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.source-task-pane-heading span { color: var(--muted); font-size: 12px; }
.source-task-history { min-height: 0; display: grid; align-content: start; gap: 7px; overflow-y: auto; padding: 10px; }
.source-task-history-row {
  min-height: 94px;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.source-task-history-row:hover { background: #fff; }
.source-task-history-row.selected { border-color: #96cbc6; background: #fff; box-shadow: 0 6px 16px rgba(33, 70, 63, .07); }
.source-task-history-row > span:not(.source-task-history-top) { color: var(--muted); font-size: 12px; }
.source-task-history-row small { overflow: hidden; color: #465550; text-overflow: ellipsis; white-space: nowrap; }
.source-task-history-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-task-history-top strong { color: var(--teal-dark); }
.source-task-history-row.selected .source-task-history-top strong { color: var(--ink); }
.source-task-history-top time { color: var(--muted); font-size: 11px; }
.source-task-detail-pane { min-height: 0; overflow-y: auto; background: var(--surface); }
.source-task-detail-card { display: grid; gap: 18px; padding: 22px; }
.source-task-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.source-task-detail-hero > div { display: grid; justify-items: start; gap: 7px; }
.source-task-detail-hero h3 { margin: 0; font-size: 21px; }
.source-task-detail-hero p { max-width: 620px; margin: 0; color: var(--muted); }
.source-task-refresh { color: var(--teal-dark); font-weight: 800; white-space: nowrap; }
.source-task-live { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid #a8d8d3; border-radius: 10px; background: var(--teal-soft); }
.source-task-live > i { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(15, 135, 127, .12); animation: source-pulse 1.4s ease-in-out infinite; }
.source-task-live > div { display: grid; }
.source-task-live span { color: var(--muted); font-size: 12px; }
.source-task-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.source-task-facts > div { min-width: 0; display: grid; gap: 3px; padding: 12px; background: var(--surface-2); }
.source-task-facts dt,
.source-task-result-card dt { color: var(--muted); font-size: 11px; }
.source-task-facts dd,
.source-task-result-card dd { margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.source-task-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.source-task-metrics > div { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.source-task-metrics span { color: var(--muted); font-size: 12px; }
.source-task-metrics strong { color: var(--teal-dark); font-size: 23px; }
.source-task-error { display: grid; gap: 7px; padding: 14px; border: 1px solid #e9aaa5; border-radius: 10px; background: var(--red-soft); }
.source-task-error > span { color: var(--red); font-size: 11px; font-weight: 900; }
.source-task-error details { color: var(--muted); }
.source-task-error pre { max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-task-results { display: grid; gap: 11px; }
.source-task-result-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-top: 4px; }
.source-task-result-heading > div { display: grid; }
.source-task-result-heading span,
.source-task-result-heading small { color: var(--muted); font-size: 12px; }
.source-task-result-heading strong { font-size: 18px; }
.source-task-result-list { display: grid; gap: 10px; }
.source-task-result-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fcfdfd; }
.source-task-result-card header { display: flex; align-items: flex-start; gap: 11px; }
.source-task-result-card header > span { min-width: 28px; color: #86a09a; font-size: 12px; font-weight: 900; }
.source-task-result-card header > div { min-width: 0; }
.source-task-result-card h4 { margin: 0; font-size: 15px; }
.source-task-result-card header small { color: var(--muted); }
.source-task-result-card p { margin: 0; color: #4f5d59; }
.source-task-result-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.source-task-result-card dl > div { min-width: 0; display: grid; gap: 2px; padding: 8px 10px; border-radius: 7px; background: var(--surface-2); }
.source-task-result-card footer { display: flex; gap: 14px; padding-top: 2px; }
.source-task-result-card footer a { font-weight: 800; }
.source-task-result-empty,
.source-task-detail-empty,
.source-task-loading { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.source-task-detail-empty { min-height: 100%; }
.source-task-detail-empty strong,
.source-task-result-empty strong,
.source-task-loading strong { color: var(--ink); }
.source-task-detail-empty.error strong { color: var(--red); }

@media (max-width: 760px) {
  .source-collect-action { align-items: stretch; }
  .source-collect-buttons { width: 100%; grid-template-columns: 1fr 1fr; }
  .source-collect-buttons button { flex: 1; }
  .source-tasks-drawer { inset: 0; width: 100%; border: 0; border-radius: 0; }
  .source-tasks-header { min-height: 88px; padding: 14px 16px; }
  .source-tasks-header h2 { font-size: 19px; }
  .source-tasks-header p { display: none; }
  .source-tasks-layout { grid-template-columns: 1fr; grid-template-rows: 210px minmax(0, 1fr); }
  .source-task-history-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-task-pane-heading { min-height: 43px; }
  .source-task-history { grid-auto-flow: column; grid-auto-columns: minmax(220px, 74vw); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .source-task-history::-webkit-scrollbar { display: none; }
  .source-task-history-row { min-height: 140px; align-content: center; }
  .source-task-detail-card { gap: 14px; padding: 15px; }
  .source-task-detail-hero h3 { font-size: 18px; }
  .source-task-facts { grid-template-columns: 1fr 1fr; }
  .source-task-metrics { grid-template-columns: 1fr 1fr; gap: 7px; }
  .source-task-result-card dl { grid-template-columns: 1fr; }
}
