:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef2f6;
  --line: #d8dee8;
  --line-soft: #e8edf3;
  --text: #172033;
  --text-strong: #0f172a;
  --muted: #667085;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #16833a;
  --green-soft: #ebf8ef;
  --red: #b42318;
  --red-soft: #fff0ee;
  --amber: #a15c07;
  --amber-soft: #fff7e6;
  --cyan: #087f9c;
  --cyan-soft: #e7f8fb;
  --violet: #6d28d9;
  --violet-soft: #f3efff;
  --shadow: 0 12px 28px rgba(15, 23, 42, .055);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open { overflow: hidden; }

button, .button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, opacity .15s ease;
}

button:hover, .button:hover { border-color: #b7c1cf; background: #fbfcfe; }
button:not(:disabled):active, .button:not(.disabled):active { transform: scale(.98); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
button.danger { color: var(--red); border-color: #efb8b2; background: var(--red-soft); }
button.quiet { background: transparent; }
button:disabled, .button.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

button[data-ui-busy="true"],
.button[data-ui-busy="true"],
select[data-ui-busy="true"],
input[data-ui-busy="true"] {
  cursor: wait;
  pointer-events: none;
}

button[data-ui-busy="true"],
.button[data-ui-busy="true"] {
  position: relative;
  color: transparent !important;
  opacity: .82;
}

button[data-ui-busy="true"] > :not(.ui-busy-content),
.button[data-ui-busy="true"] > :not(.ui-busy-content) {
  visibility: hidden;
}

.ui-busy-content {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: inherit;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}

button.primary .ui-busy-content { color: #fff; }
button.danger .ui-busy-content { color: var(--red); }

.ui-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spinner-rotate .72s linear infinite;
}

@keyframes ui-spinner-rotate {
  to { transform: rotate(360deg); }
}

.global-activity {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid #b9cffd;
  border-radius: 7px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.global-activity[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
  button:not(:disabled):active, .button:not(.disabled):active { transform: none; }
  .ui-spinner { animation-duration: 1.4s; }
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

textarea {
  min-height: 126px;
  resize: vertical;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 17px; line-height: 1.2; color: var(--text-strong); }
h2 { font-size: 14px; line-height: 1.25; color: var(--text-strong); }
h3 { font-size: 13px; line-height: 1.3; color: var(--text-strong); }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(250px, auto) auto minmax(430px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 750;
}

.brand-copy p,
.hint,
.panel-head p,
.batch-meta,
.label,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.topbar-status,
.command-bar,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.command-bar {
  justify-content: flex-end;
}

.file-picker {
  min-height: 34px;
  border: 1px dashed #b9c3d0;
  border-radius: 6px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
}

.file-picker span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker input { display: none; }

.toast {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  right: 18px;
  z-index: 60;
  max-width: min(440px, calc(100vw - 36px));
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
  color: var(--text-strong);
}

.toast.active { display: block; }
.toast.error { border-color: #efb8b2; background: var(--red-soft); color: var(--red); }
.toast.success { border-color: #bfe6c7; background: var(--green-soft); color: var(--green); }

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(560px, 1fr) minmax(420px, 520px);
  gap: 16px;
  align-items: start;
  padding: 16px;
  max-width: 1800px;
  margin: 0 auto;
}

.batch-rail,
.main-stage,
.inspector {
  display: grid;
  gap: 14px;
}

.batch-rail,
.inspector {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

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

.panel-head {
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-body { padding: 14px; }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 10px; }
.small-field input { text-align: center; }

.status,
.count-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  min-height: 24px;
  padding: 2px 9px;
  white-space: nowrap;
}

button.count-pill {
  min-height: 24px;
  padding: 2px 9px;
  cursor: pointer;
}

button.count-pill:hover {
  border-color: #a9c4ff;
  background: #f5f8ff;
  color: var(--blue);
}

.status.success { color: var(--green); border-color: #9bd8ad; background: var(--green-soft); }
.status.failed { color: var(--red); border-color: #efb8b2; background: var(--red-soft); }
.status.manual_required { color: var(--amber); border-color: #f2c87e; background: var(--amber-soft); }
.status.running { color: var(--blue); border-color: #b6cff7; background: var(--blue-soft); }
.status.analyzing { color: var(--violet); border-color: #d8cbff; background: var(--violet-soft); }
.status.pending { color: var(--muted); }
.status.achieved { color: var(--green); border-color: #9bd8ad; background: var(--green-soft); }
.status.needs_optimization { color: var(--red); border-color: #efb8b2; background: var(--red-soft); }
.status.incomplete { color: var(--amber); border-color: #f2c87e; background: var(--amber-soft); }

.segmented {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.segmented button {
  min-width: 76px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.segmented.compact button {
  min-width: auto;
  padding: 6px 10px;
}

.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--blue); color: #fff; }

.batch-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.batch-card-wrap {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px 42px 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.batch-card {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 6px;
  text-align: left;
  justify-content: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.batch-card-wrap:hover { border-color: #b7c1cf; background: var(--surface-soft); }
.batch-card.selected { box-shadow: none; }
.batch-card-wrap:has(.batch-card.selected) { border-color: #9bbcff; background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }

.batch-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.batch-delete:hover,
.batch-delete:focus-visible {
  background: var(--red-soft);
  color: var(--red);
  outline: none;
}

.batch-project-control {
  position: static;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.batch-project-control select {
  width: min(280px, calc(100% - 54px));
  height: 27px;
  padding: 0 25px 0 8px;
  font-size: 11px;
}

.batch-title {
  color: var(--text-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.batch-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}

.tag.active { color: var(--blue); border-color: #a9c4ff; background: #f3f7ff; }

.batch-hero {
  padding: 14px;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 4px;
}

.batch-hero h2 {
  font-size: 22px;
  line-height: 1.2;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.workflow-step {
  min-height: 62px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-soft);
}

.workflow-step.done { border-color: #bfe6c7; background: var(--green-soft); }
.workflow-step.current { border-color: #a9c4ff; background: var(--blue-soft); }
.workflow-step.blocked { border-color: #f2c87e; background: var(--amber-soft); }
.workflow-step strong {
  display: block;
  color: var(--text-strong);
  font-size: 12px;
}
.workflow-step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.run-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--muted);
}

.run-banner.running { background: var(--blue-soft); border-color: #c8d9ff; color: #1d4ed8; }
.run-banner.pause-requested { background: var(--amber-soft); border-color: #f2c87e; color: #92400e; }
.run-banner.paused { background: var(--green-soft); border-color: #bfe6c7; color: #166534; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.metric {
  min-height: 78px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong {
  font-size: 24px;
  line-height: 1;
  color: var(--text-strong);
}

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

.metric.total { border-top: 3px solid #475569; }
.metric.pending { border-top: 3px solid var(--blue); }
.metric.running { border-top: 3px solid var(--violet); }
.metric.success { border-top: 3px solid var(--green); }
.metric.failed { border-top: 3px solid var(--red); }
.metric.geo_success { border-top: 3px solid var(--cyan); }

.geo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.geo-form .action-row {
  grid-column: 1 / -1;
}

.platform-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.platform-option {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.platform-option input {
  width: auto;
  margin: 0;
}

.platform-option strong {
  color: var(--text-strong);
  font-size: 12px;
}

.platform-option span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.platform-option:has(input:checked) {
  border-color: #a9c4ff;
  background: var(--blue-soft);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #c8d9ff;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.account-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.account-column {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-column-body {
  display: grid;
  gap: 8px;
}

.account-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface);
}

.account-item.disabled { opacity: .55; }
.account-name { font-weight: 650; color: var(--text-strong); }
.account-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.task-head {
  align-items: flex-start;
}

.task-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.task-search {
  width: 220px;
}

.retry-bulk-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 34px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.retry-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.retry-task-select {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.retry-select-all input {
  margin: 0;
  accent-color: var(--blue);
}

.retry-task-select input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
}

.retry-task-select .selection-mark {
  display: none;
}

.retry-task-select:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.retry-task-select:has(input:checked) .selection-mark {
  display: none;
}

.retry-task-select:has(input:disabled) {
  opacity: .35;
  cursor: not-allowed;
}

.batch-retry-button {
  min-height: 28px;
  padding: 4px 11px;
  border: 1px solid #efb8b2;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.batch-retry-button:not(:disabled):hover {
  border-color: var(--red);
  background: #ffe3e0;
}

.batch-retry-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.question-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.question-line .question-title {
  min-width: 0;
}

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

.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 880px;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.task-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-table tbody tr {
  cursor: pointer;
}

.task-table tbody tr:hover {
  background: var(--surface-soft);
}

.task-table tbody tr.selected {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.task-table .empty-state {
  height: 180px;
  text-align: center;
  vertical-align: middle;
}

.question-cell {
  min-width: 280px;
}

.question-title {
  color: var(--text-strong);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.question-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.manual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  gap: 14px;
}

.manual-question textarea {
  min-height: 162px;
}

.inspector-panel {
  min-height: calc(100vh - 100px);
}

.inspector-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.tab-button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-width: 88px;
  box-shadow: none;
}

.tab-button:last-child { border-right: 0; }
.tab-button.active { background: var(--blue); color: #fff; }

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

.inspector-actions .icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.panel-view { display: none; }
.panel-view.active { display: block; }

.detail {
  padding: 14px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 166px);
  overflow: auto;
}

.detail.empty-state {
  color: var(--muted);
}

.detail-section {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.detail-section-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.detail-section-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-value {
  color: var(--text-strong);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-value a,
.evidence-link a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, .25);
}

.evidence-block {
  display: grid;
  gap: 8px;
}

.screenshot-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
  cursor: zoom-in;
}

.screenshot-preview:hover {
  border-color: #98a5b8;
  background: var(--surface-soft);
}

.screenshot-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.text-preview {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
  color: var(--text-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text-preview.collapsed {
  max-height: 180px;
}

.muted-preview {
  color: var(--muted);
}

details.debug-details {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

details.debug-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text-strong);
  font-weight: 650;
  background: var(--surface-soft);
}

details.debug-details .detail-section-body {
  border-top: 1px solid var(--line-soft);
}

.geo-results {
  max-height: calc(100vh - 166px);
  overflow: auto;
  padding: 14px;
}

.geo-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.geo-stat {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.geo-stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 20px;
}

.geo-stat span {
  color: var(--muted);
  font-size: 12px;
}

.geo-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.geo-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.geo-table th,
.geo-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.geo-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

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

.empty-state {
  color: var(--muted);
  padding: 14px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 28px;
}

.image-modal.active {
  display: grid;
  place-items: center;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, .62);
  cursor: zoom-out;
}

.image-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}

.image-modal-head,
.image-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.image-modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
  background: var(--surface-soft);
}

.image-modal-title {
  font-weight: 750;
  color: var(--text-strong);
}

.image-modal-path {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.image-modal-close {
  flex: 0 0 auto;
}

.image-modal-body {
  min-height: 0;
  overflow: auto;
  background: #0b1220;
  display: grid;
  place-items: center;
  padding: 14px;
}

.image-modal-body img {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
}

/* Visual refresh: compact two-column workspace with a slide-out inspector. */
body {
  background:
    linear-gradient(180deg, #f8fafc 0, #f4f6f9 220px, #f6f7f9 100%);
  font-size: 13px;
}

button, .button,
input, textarea, select {
  border-radius: 7px;
}

button, .button {
  min-height: 32px;
  padding: 6px 11px;
}

.topbar {
  min-height: 62px;
  padding: 10px 18px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.workspace {
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 1660px;
  gap: 16px;
  padding: 16px 18px 28px;
}

.batch-rail {
  top: 78px;
  max-height: calc(100vh - 94px);
}

.main-stage {
  gap: 12px;
  min-width: 0;
}

.panel {
  box-shadow: none;
  border-color: #dce2ea;
}

.panel-head {
  min-height: 46px;
  padding: 10px 14px;
  background: #fbfcfe;
}

.panel-body {
  padding: 12px 14px;
}

.batch-list {
  gap: 6px;
  padding: 8px;
}

.batch-card {
  min-height: 68px;
  padding: 9px 42px 9px 10px;
  border-radius: 7px;
}

.batch-card.selected {
  background: #f5f8ff;
  border-color: #93b4ff;
}

.account-item {
  padding: 9px;
  grid-template-columns: minmax(0, 1fr) auto;
  background: #fbfcfe;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.account-sub {
  line-height: 1.35;
}

.batch-hero {
  display: grid;
  grid-template-columns: minmax(240px, .95fr) minmax(520px, 1.8fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dce2ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.batch-hero h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.hero-actions {
  justify-content: flex-end;
  align-items: center;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 8px;
  padding: 0;
}

.metric {
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f8fafc;
}

.metric strong {
  font-size: 22px;
}

.metric.total,
.metric.pending,
.metric.running,
.metric.success,
.metric.failed,
.metric.geo_success {
  border-top: 0;
}

.metric.total { box-shadow: inset 0 3px 0 #475569; }
.metric.pending { box-shadow: inset 0 3px 0 var(--blue); }
.metric.running { box-shadow: inset 0 3px 0 var(--violet); }
.metric.success { box-shadow: inset 0 3px 0 var(--green); }
.metric.failed { box-shadow: inset 0 3px 0 var(--red); }
.metric.geo_success { box-shadow: inset 0 3px 0 var(--cyan); }

.status-strip {
  gap: 8px;
}

.run-banner {
  padding: 9px 11px;
  border-radius: 7px;
  background: #fff;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-head {
  align-items: center;
}

.matrix-search {
  width: min(320px, 36vw);
}

.dashboard-body {
  display: grid;
  gap: 12px;
}

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

.dashboard-metric {
  min-height: 64px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 10px 11px;
  background: #f8fafc;
  display: grid;
  align-content: space-between;
  box-shadow: inset 0 3px 0 #64748b;
}

.dashboard-metric strong {
  color: var(--text-strong);
  font-size: 23px;
  line-height: 1;
}

.dashboard-metric span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-metric.keyword_pass { box-shadow: inset 0 3px 0 var(--green); }
.dashboard-metric.keyword_fail { box-shadow: inset 0 3px 0 var(--red); }
.dashboard-metric.keyword_incomplete { box-shadow: inset 0 3px 0 var(--amber); }
.dashboard-metric.platform_pass { box-shadow: inset 0 3px 0 var(--cyan); }

.dashboard-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(320px, auto) minmax(150px, .7fr) minmax(160px, .8fr);
  gap: 10px;
  align-items: end;
}

.matrix-filter-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.matrix-platform-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-filter-all,
.matrix-platform-option {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
}

.platform-filter-all.active,
.matrix-platform-option:has(input:checked) {
  border-color: #a9c4ff;
  background: var(--blue-soft);
  color: #1d4ed8;
}

.matrix-platform-option input {
  width: auto;
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  gap: 12px;
  align-items: start;
}

.matrix-table-wrap {
  max-height: calc(100vh - 420px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.matrix-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: 0;
}

.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 36px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.matrix-keyword-col,
.matrix-keyword-cell {
  width: 300px;
}

.matrix-overall-col {
  width: 112px;
}

.matrix-keyword-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.matrix-table th.matrix-keyword-col {
  left: 0;
  z-index: 5;
}

.matrix-table tbody tr:hover .matrix-keyword-cell,
.matrix-table tbody tr:hover td {
  background: #fbfcfe;
}

.matrix-question {
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.matrix-overall {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.matrix-overall.pass { color: var(--green); border-color: #9bd8ad; background: var(--green-soft); }
.matrix-overall.fail { color: var(--red); border-color: #efb8b2; background: var(--red-soft); }
.matrix-overall.incomplete { color: var(--amber); border-color: #f2c87e; background: var(--amber-soft); }

.matrix-cell {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 3px;
  text-align: left;
  color: var(--text);
  box-shadow: inset 0 3px 0 #94a3b8;
}

button.matrix-cell {
  cursor: pointer;
}

button.matrix-cell:hover {
  border-color: #a9b7c8;
  background: #fff;
}

.matrix-cell strong {
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.2;
}

.matrix-cell span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.matrix-cell.status-pass {
  border-color: #bfe6c7;
  background: var(--green-soft);
  box-shadow: inset 0 3px 0 var(--green);
}

.matrix-cell.status-fail {
  border-color: #efb8b2;
  background: var(--red-soft);
  box-shadow: inset 0 3px 0 var(--red);
}

.matrix-cell.status-incomplete {
  border-color: #f2c87e;
  background: var(--amber-soft);
  box-shadow: inset 0 3px 0 var(--amber);
}

.matrix-cell.status-error {
  border-color: #d6b2ff;
  background: var(--violet-soft);
  box-shadow: inset 0 3px 0 var(--violet);
}

.matrix-cell.key-not_connected {
  border-style: dashed;
  background: #f8fafc;
  box-shadow: inset 0 3px 0 #94a3b8;
}

.matrix-cell.selected {
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 1px;
}

.matrix-empty {
  height: 220px;
  text-align: center;
  vertical-align: middle;
}

.platform-rank-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.rank-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
  color: var(--text-strong);
  font-weight: 750;
}

.platform-rank-list {
  display: grid;
}

.platform-rank-item {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.platform-rank-item:last-child {
  border-bottom: 0;
}

.platform-rank-item strong,
.platform-rank-item span {
  display: block;
}

.platform-rank-item strong {
  color: var(--text-strong);
}

.platform-rank-item span {
  color: var(--muted);
  font-size: 12px;
}

.rank-rate {
  color: var(--green);
  font-weight: 800;
  font-size: 18px;
}

.compact-empty {
  min-height: 96px;
}

.geo-control-panel .panel-body {
  padding-top: 12px;
}

.geo-form {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .9fr) auto;
  align-items: end;
}

.geo-form .action-row {
  grid-column: auto;
  align-items: center;
}

.geo-form .action-row .hint {
  flex-basis: 100%;
}

.task-panel {
  min-width: 0;
}

.task-head {
  align-items: center;
}

.task-tools {
  flex-wrap: wrap;
}

.task-search {
  width: 260px;
}

.retry-selection-hint {
  white-space: nowrap;
}

.table-wrap {
  max-height: calc(100vh - 430px);
  min-height: 360px;
}

.task-table {
  min-width: 1200px;
  table-layout: fixed;
}

.task-table th,
.task-table td {
  padding: 9px 11px;
}

.task-table th {
  height: 36px;
  white-space: nowrap;
  background: #fbfcfe;
}

.task-table th:nth-child(1),
.task-table td:nth-child(1) { width: 92px; }

.task-table th:nth-child(2),
.task-table td:nth-child(2) { width: 33%; }

.task-table th:nth-child(3),
.task-table td:nth-child(3) { width: 196px; }

.task-table th:nth-child(4),
.task-table td:nth-child(4) { width: 108px; }

.task-table th:nth-child(5),
.task-table td:nth-child(5) { width: 150px; }

.task-table th:nth-child(6),
.task-table td:nth-child(6) { width: 150px; }

.task-table th:nth-child(7),
.task-table td:nth-child(7) { width: 128px; }

.question-cell {
  min-width: 0;
}

.intent-cluster-cell {
  overflow-wrap: anywhere;
  line-height: 1.38;
}

.question-title {
  line-height: 1.38;
}

.row-actions {
  flex-wrap: nowrap;
}

.row-actions button {
  min-height: 26px;
  padding: 3px 8px;
}

.manual-grid {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, .9fr);
  gap: 12px;
}

.manual-question textarea {
  min-height: 116px;
}

.inspector {
  position: fixed;
  top: 62px;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(620px, calc(100vw - 28px));
  display: block;
  max-height: none;
  overflow: hidden;
  background: #fff;
  border-left: 1px solid #dce2ea;
  box-shadow: -18px 0 48px rgba(15, 23, 42, .16);
  transform: translateX(102%);
  transition: transform .18s ease;
}

.inspector.open {
  transform: translateX(0);
}

.inspector-panel {
  min-height: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.inspector-head {
  min-height: 54px;
  background: #fff;
}

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

.detail,
.geo-results {
  max-height: calc(100vh - 116px);
}

.empty-state {
  padding: 16px;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .batch-hero {
    grid-template-columns: 1fr;
  }

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

  .geo-form,
  .manual-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .dashboard-control-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .platform-rank-item {
    border-right: 1px solid var(--line-soft);
  }

  .geo-form .action-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .command-bar {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .batch-rail {
    position: static;
    max-height: none;
  }

  .workflow-steps,
  .metric-grid,
  .dashboard-metrics,
  .dashboard-control-grid,
  .geo-form,
  .manual-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-search {
    width: 100%;
  }

  .matrix-table-wrap {
    max-height: 70vh;
  }

  .platform-rank-list {
    grid-template-columns: 1fr;
  }

  .platform-rank-item {
    border-right: 0;
  }

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

  .task-tools {
    justify-content: flex-start;
  }

  .task-search {
    width: 100%;
  }

  .inspector {
    top: 0;
    width: 100vw;
  }
}

/* GEO dashboard workspace V1: full-width admin layout with tabs. */
body {
  background: #f9fafb;
}

.app-shell {
  min-height: 100vh;
  background: #f9fafb;
}

.topbar {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, .96);
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-status {
  justify-self: end;
}

.workspace {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px;
}

.main-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: calc(100vh - 112px);
}

.app-card,
.panel,
.dashboard-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  overflow: hidden;
}

.main-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.main-tab {
  min-width: 180px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-size: 15px;
  font-weight: 750;
}

.main-tab-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
}

.main-tab:hover {
  background: #f3f4f6;
  border-color: transparent;
}

.main-tab.active {
  background: #111827;
  color: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .18);
}

.tab-panel {
  display: none;
  min-width: 0;
}

.tab-panel.active {
  display: block;
  flex: 1;
  min-height: 0;
}

#dashboardTabPanel.active {
  display: flex;
  flex-direction: column;
}

.dashboard-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-head,
.panel-head {
  min-height: 54px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #edf0f4;
}

.dashboard-head h2,
.panel-head h2 {
  font-size: 16px;
}

.dashboard-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

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

.dashboard-metric {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-top: 3px solid #64748b;
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.dashboard-metric.keyword_pass {
  border-top-color: var(--green);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.dashboard-metric.keyword_fail {
  border-top-color: var(--red);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.dashboard-metric.keyword_incomplete {
  border-top-color: var(--amber);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.dashboard-metric.platform_pass {
  border-top-color: var(--cyan);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.dashboard-metric strong {
  color: var(--text-strong);
  font-size: 25px;
  line-height: 1;
}

.dashboard-metric span {
  color: var(--muted);
  font-size: 12px;
}

.filters-bar {
  display: flex;
  flex-direction: row;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.filters-bar .field {
  gap: 6px;
}

.filter-search {
  flex: 1 1 360px;
  min-width: 240px;
}

.filter-select {
  flex: 0 0 168px;
}

.filters-bar input,
.filters-bar select {
  height: 38px;
  background: #fff;
}

.matrix-table-wrap {
  flex: 1;
  min-height: 460px;
  max-height: none;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.matrix-table {
  width: 100%;
  min-width: 1060px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.matrix-table th,
.matrix-table td {
  padding: 8px;
  border-right: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
  text-align: center;
  vertical-align: middle;
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: 0;
}

.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 42px;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.matrix-keyword-col,
.matrix-keyword-cell {
  width: 360px;
}

.matrix-keyword-col,
.matrix-table th.matrix-keyword-col {
  left: 0;
  z-index: 6;
  text-align: left;
}

.matrix-keyword-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 12px;
  background: #fff;
  text-align: left;
}

.matrix-table tbody tr:hover td,
.matrix-table tbody tr:hover .matrix-keyword-cell {
  background: #f8fafc;
}

.matrix-question {
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.matrix-overall {
  min-height: 22px;
  padding: 1px 8px;
  font-size: 11px;
}

.matrix-cell {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-strong);
  box-shadow: none;
}

button.matrix-cell {
  min-height: 42px;
  padding: 0;
}

button.matrix-cell:hover {
  border-color: #98a2b3;
  background: #fff;
}

.matrix-cell strong {
  color: currentColor;
  font-size: 23px;
  line-height: 1;
}

.matrix-cell.status-pass {
  color: var(--green);
  border-color: #bfe6c7;
  background: var(--green-soft);
  box-shadow: none;
}

.matrix-cell.status-fail {
  color: var(--red);
  border-color: #efb8b2;
  background: var(--red-soft);
  box-shadow: none;
}

.matrix-cell.status-incomplete {
  color: var(--amber);
  border-color: #f2c87e;
  background: var(--amber-soft);
  box-shadow: none;
}

.matrix-cell.status-error {
  color: var(--violet);
  border-color: #d8cbff;
  background: var(--violet-soft);
  box-shadow: none;
}

.matrix-cell.key-not_connected {
  color: #667085;
  border-style: dashed;
  background: #f8fafc;
  box-shadow: none;
}

.matrix-cell.selected {
  outline: 2px solid rgba(37, 99, 235, .32);
  outline-offset: 1px;
}

.batch-hero {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(420px, 1.6fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(88px, 1fr));
  gap: 10px;
  padding: 0;
}

.metric {
  min-height: 64px;
  background: #f8fafc;
  box-shadow: none;
}

.command-panel .command-bar {
  justify-content: flex-start;
  gap: 10px;
}

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

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.batch-list-panel,
.account-panel,
.geo-control-panel,
.manual-panel,
.task-panel {
  min-width: 0;
}

.geo-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
}

.geo-form .action-row {
  grid-column: 1 / -1;
}

.manual-grid {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, .9fr);
}

.task-panel .table-wrap {
  min-height: 360px;
  max-height: 56vh;
}

@media (max-width: 1180px) {
  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .filters-bar {
    flex-wrap: wrap;
  }

  .filter-select {
    flex: 1 1 180px;
  }

  .batch-hero,
  .control-grid,
  .manual-grid,
  .geo-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .topbar-status {
    justify-self: start;
  }

  .workspace {
    padding: 16px;
  }

  .main-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .main-tab {
    width: 100%;
  }

  .dashboard-metrics,
  .metric-grid,
  .status-strip,
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    align-items: stretch;
  }

  .filter-search,
  .filter-select {
    flex-basis: 100%;
    min-width: 0;
  }

  .matrix-table-wrap {
    min-height: 420px;
  }

  .matrix-keyword-col,
  .matrix-keyword-cell {
    width: 280px;
  }
}

/* Task control UX refresh */
#collectTabPanel.active {
  min-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-toolbar-panel {
  flex: 0 0 auto;
}

.action-bar-panel {
  flex: 0 0 auto;
  overflow: visible;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.action-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
}

.action-zone {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-zone {
  flex: 1 1 420px;
  justify-content: flex-start;
}

.engine-zone {
  flex: 0 0 auto;
  justify-content: center;
}

.output-zone {
  flex: 1 1 260px;
  justify-content: flex-end;
}

.action-primary {
  min-height: 38px;
  padding-inline: 18px;
  font-weight: 750;
}

.platform-select {
  position: relative;
  min-width: 260px;
}

.platform-trigger {
  width: 100%;
  min-height: 36px;
  justify-content: space-between;
  background: var(--surface-soft);
}

.platform-trigger.active {
  border-color: #a9c4ff;
  background: #f5f8ff;
}

.platform-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  max-width: 150px;
  overflow: hidden;
}

.platform-tags span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c8d9ff;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.platform-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 360px;
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .14);
}

.platform-menu.open {
  display: block;
}

.compact-picker.platform-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-picker .platform-option {
  min-height: 32px;
  padding: 6px 8px;
}

.compact-picker .platform-option strong {
  overflow-wrap: anywhere;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .34);
}

.dialog-backdrop.open {
  display: grid;
}

.dialog-panel {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.control-collapses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
  align-items: start;
}

.collapse-panel {
  overflow: visible;
}

.collapse-panel summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  background: var(--surface);
}

.collapse-panel summary::-webkit-details-marker {
  display: none;
}

.collapse-panel summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 750;
}

.collapse-panel[open] summary {
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.collapse-panel[open] summary::before {
  content: "-";
}

.collapse-panel[open] {
  grid-column: 1 / -1;
}

.collapse-panel summary strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
}

.collapse-panel summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.collapse-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.collapse-panel.manual-panel[open] .manual-grid {
  grid-template-columns: minmax(420px, 1.3fr) minmax(420px, .9fr);
  align-items: stretch;
}

.collapse-panel.manual-panel[open] .manual-question textarea {
  min-height: 178px;
}

.collapse-panel.manual-panel[open] .platform-picker {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.collapse-panel.manual-panel[open] .manual-side {
  align-content: start;
}

.collapse-panel.manual-panel[open] .inline-actions {
  align-items: center;
}

.collapse-panel.manual-panel[open] .inline-actions .hint {
  flex: 1 1 180px;
}

.collapse-panel.batch-list-panel[open] .batch-list,
.collapse-panel.advanced-panel[open] .batch-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.collapse-panel.account-panel[open] .account-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#collectTabPanel .task-panel {
  flex: 1 1 auto;
  min-height: 440px;
  display: flex;
  flex-direction: column;
}

#collectTabPanel .task-panel .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* Inspector task evidence refresh */
.qa-overview-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.qa-overview-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.qa-overview-card p {
  color: var(--muted);
  font-size: 12px;
}

.qa-overview-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.qa-evidence-layout,
.task-geo-detail {
  display: grid;
  gap: 12px;
}

.evidence-screenshot-card,
.qa-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.evidence-screenshot-card .detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.evidence-screenshot-frame {
  min-height: 220px;
  border: 0;
  border-radius: 0;
}

.evidence-screenshot-frame img {
  max-height: 420px;
}

.evidence-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: repeating-linear-gradient(
    45deg,
    #f8fafc,
    #f8fafc 12px,
    #f1f5f9 12px,
    #f1f5f9 24px
  );
}

.evidence-placeholder strong {
  color: var(--text-strong);
}

.qa-text {
  padding: 14px;
  color: var(--text-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.qa-card .text-preview {
  margin: 14px;
}

.qa-actions {
  padding: 0 14px 14px;
}

.evidence-actions-card .detail-section-body {
  border-top: 1px solid var(--line-soft);
}

.evidence-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px;
}

.evidence-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  color: var(--blue);
  background: var(--surface);
  text-decoration: none;
}

.evidence-actions a:hover {
  border-color: #a9c4ff;
  background: var(--blue-soft);
}

.compact-detail {
  gap: 8px;
}

.compact-detail .detail-row {
  grid-template-columns: 84px minmax(0, 1fr);
}

@media (max-width: 1180px) {
  .action-bar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .source-zone,
  .engine-zone,
  .output-zone {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .control-collapses {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .action-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-select,
  .platform-menu {
    width: 100%;
    min-width: 0;
  }

  .platform-menu {
    position: static;
    margin-top: 8px;
  }

  .compact-picker.platform-picker {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   运营版布局：批次概览 + 步骤卡片 + 进度条 + 内联 GEO 表单
   ============================================================ */

/* 顶栏采集进度横幅 */
.runner-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.runner-banner:empty,
.runner-banner.idle {
  display: none;
}

.runner-banner.running {
  background: var(--blue-soft);
  color: var(--blue);
}

.runner-banner.pause-requested {
  background: var(--amber-soft);
  color: var(--amber);
}

.runner-banner.done {
  background: var(--green-soft);
  color: var(--green);
}

/* 批次概览左右分区 */
.batch-hero-left {
  min-width: 0;
}

.batch-hero-left h2 {
  font-size: 18px;
  font-weight: 750;
  margin: 4px 0;
  color: var(--text-strong);
}

.batch-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 200px;
}

/* 批次概览进度条 */
.progress-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.progress-bar-wrap {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--blue);
  transition: width .35s ease;
}

.progress-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* 步骤卡片 */
.step-card {
  margin-top: 14px;
  padding: 0;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
}

.step-number {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-info {
  flex: 1 1 auto;
  min-width: 0;
}

.step-info h2 {
  font-size: 16px;
  font-weight: 750;
  margin: 2px 0 4px;
  color: var(--text-strong);
}

.step-info p {
  margin: 0;
}

.step-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-project-select {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.compact-project-select select {
  width: 210px;
  min-width: 0;
  height: 34px;
  padding: 0 30px 0 10px;
  font-size: 12px;
}

.project-tag {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line-soft));
  background: var(--blue-soft);
}

.project-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

.project-dialog::backdrop { background: rgba(21, 29, 42, .42); }
.project-dialog form { display: grid; gap: 16px; padding: 20px; }
.project-dialog h3 { margin: 0; font-size: 16px; color: var(--text-strong); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.step-body {
  padding: 0 18px 16px 62px;
  display: grid;
  gap: 12px;
}

.step-body-banner {
  margin: 0 18px 16px 62px;
}

/* 账号状态卡片列表 */
.account-choice-row {
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

#accountCountGroup {
  justify-self: start;
}

.account-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* 内联 GEO 表单 */
.geo-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr);
  gap: 12px;
  align-items: end;
}

.geo-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.geo-auto-option {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
}

.geo-auto-option input {
  margin-top: 3px;
  width: auto;
  flex: 0 0 auto;
}

.geo-auto-option span {
  display: grid;
  gap: 3px;
}

.geo-auto-option small {
  color: var(--muted);
}

.source-progress {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.dashboard-mode {
  margin-right: 4px;
}

.source-domain-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.source-domain-strip > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.source-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(120px, 1fr));
}

.source-table td {
  vertical-align: top;
}

.source-table td a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.source-table td small,
.source-item summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.source-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
}

.source-view-tabs {
  margin: 12px 0;
}

.source-report-filters {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr));
}

.source-cluster-filters {
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr));
}

.source-cluster-table {
  min-width: 1420px;
}

.source-cluster-table col:nth-child(1) { width: 10%; }
.source-cluster-table col:nth-child(2) { width: 6%; }
.source-cluster-table col:nth-child(3) { width: 8%; }
.source-cluster-table col:nth-child(4) { width: 6%; }
.source-cluster-table col:nth-child(5) { width: 6%; }
.source-cluster-table col:nth-child(6) { width: 6%; }
.source-cluster-table col:nth-child(7) { width: 13%; }
.source-cluster-table col:nth-child(8) { width: 15%; }
.source-cluster-table col:nth-child(9) { width: 26%; }
.source-cluster-table col:nth-child(10) { width: 4%; }

.source-cluster-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.source-cluster-table td:first-child small {
  display: block;
  color: var(--amber);
  margin-top: 3px;
}

.source-cluster-table tbody tr {
  cursor: pointer;
}

.cluster-report-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.cluster-report-dialog::backdrop {
  background: rgba(15, 23, 42, .42);
}

.cluster-dialog-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.cluster-dialog-head h2 {
  margin-top: 3px;
  font-size: 16px;
}

.cluster-dialog-body {
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 16px;
}

.cluster-dialog-body > section,
.cluster-analysis-grid > section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.cluster-dialog-body section h3 {
  margin-bottom: 8px;
}

.cluster-dialog-body section p,
.cluster-dialog-body li {
  overflow-wrap: anywhere;
}

.cluster-report-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.cluster-report-facts span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-right: 1px solid var(--line-soft);
}

.cluster-report-facts span:last-child {
  border-right: 0;
}

.cluster-report-facts small,
.cluster-priorities small {
  color: var(--muted);
}

.cluster-report-facts strong {
  color: var(--text-strong);
  font-size: 17px;
}

.cluster-partial-note,
.cluster-error-note {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

.cluster-error-note {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.cluster-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cluster-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.cluster-dialog-body ul,
.cluster-dialog-body ol {
  margin: 0;
  padding-left: 20px;
}

.cluster-dialog-body li + li {
  margin-top: 7px;
}

.cluster-differences li {
  display: grid;
  gap: 2px;
}

.cluster-priorities {
  list-style: none;
  padding-left: 0 !important;
}

.cluster-priorities li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.cluster-priorities li div {
  display: grid;
  gap: 2px;
}

.priority {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.priority.high { color: var(--red); background: var(--red-soft); }
.priority.medium { color: var(--amber); background: var(--amber-soft); }
.priority.low { color: var(--green); background: var(--green-soft); }

.cluster-keyword-table {
  min-width: 980px;
}

.source-report-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.source-report-table {
  min-width: 1240px;
}

.source-report-table col:nth-child(1) { width: 13%; }
.source-report-table col:nth-child(2) { width: 7%; }
.source-report-table col:nth-child(3) { width: 7%; }
.source-report-table col:nth-child(4) { width: 6%; }
.source-report-table col:nth-child(5) { width: 13%; }
.source-report-table col:nth-child(6) { width: 17%; }
.source-report-table col:nth-child(7) { width: 31%; }
.source-report-table col:nth-child(8) { width: 6%; }

.source-report-table .report-conclusion {
  white-space: normal;
  text-align: left;
  line-height: 1.55;
}

.source-cluster-table .report-conclusion {
  text-align: left;
  line-height: 1.55;
}

.keyword-source-report {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  margin-bottom: 12px;
}

.keyword-source-report-head,
.report-article-head,
.report-product {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.keyword-source-report-head h3 {
  margin: 3px 0 0;
}

.report-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.report-facts span,
.report-products,
.report-coverage-sites,
.report-gap-sites,
.report-conclusion,
.report-articles {
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  margin-top: 9px;
}

.report-facts strong {
  color: var(--text-strong);
}

.report-products {
  display: grid;
  gap: 7px;
}

.report-coverage-sites > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.report-gap-sites {
  display: grid;
  gap: 7px;
}

.report-gap-site {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 8px;
}

.report-gap-site span,
.report-article-meta {
  color: var(--muted);
  font-size: 12px;
}

.report-article-meta {
  margin-top: 6px;
}

.report-product span,
.report-article-head span {
  color: var(--muted);
  font-size: 12px;
}

.report-articles {
  display: grid;
  gap: 8px;
}

.report-article {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px;
}

.report-article a {
  display: block;
  color: var(--blue);
  overflow-wrap: anywhere;
  margin-top: 4px;
}

.report-article p {
  margin: 6px 0 3px;
}

.report-points {
  color: var(--muted);
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .source-report-filters,
  .source-cluster-filters,
  .report-facts {
    grid-template-columns: 1fr;
  }

  .cluster-report-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .cluster-report-facts,
  .cluster-analysis-grid {
    grid-template-columns: 1fr;
  }

  .cluster-report-facts span {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

.source-task-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.source-item-list {
  display: grid;
  gap: 8px;
}

.source-item {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}

.source-item > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}

.source-rank {
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.source-item-body {
  border-top: 1px solid var(--line-soft);
  padding: 10px;
}

/* 折叠面板（任务明细 / 批次管理）在新布局中的外边距 */
.collapse-panel.task-collapse,
.collapse-panel.advanced-panel {
  margin-top: 14px;
}

/* 大盘头部导出按钮 */
.dashboard-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 折叠面板 summary 中的状态筛选器 */
.task-filter-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-intent-cluster-filter,
.task-qualification-filter {
  width: 154px;
  height: 32px;
  padding: 4px 26px 4px 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-qualification-filter {
  width: 96px;
}

.collapse-filter {
  margin-left: 0;
}

@media (max-width: 720px) {
  .task-filter-controls {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .step-header {
    flex-direction: column;
  }

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

  .compact-project-select select {
    width: min(210px, calc(100vw - 106px));
  }

  .step-body,
  .step-body-banner {
    padding-left: 18px;
    margin-left: 0;
  }

  .account-choice-row {
    grid-template-columns: 1fr;
  }

  .geo-inline-form {
    grid-template-columns: 1fr;
  }

  .source-filters,
  .source-task-summary {
    grid-template-columns: 1fr;
  }

  .source-progress {
    grid-template-columns: 1fr;
  }
}

/* GEO 判断标准面板 */
.geo-criteria-panel {
  margin-bottom: 14px;
}

.geo-criteria-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.geo-criteria-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.geo-criteria-preview .criteria-file {
  font-size: 13px;
  color: #0f172a;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
}

.geo-criteria-preview .criteria-file-time {
  color: #64748b;
  font-weight: 400;
}

.geo-criteria-preview .criteria-block {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.geo-criteria-preview .criteria-label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: #0f172a;
}

.geo-criteria-preview p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
}

.geo-criteria-preview ul,
.geo-criteria-preview ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}

.geo-criteria-preview li {
  margin-bottom: 4px;
}
