.cst-wrap {
  max-width: 720px;
  margin: 24px auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2937;
}

.cst-row {
  margin-bottom: 16px;
}

.cst-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.cst-input,
.cst-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.cst-input:focus,
.cst-select:focus {
  outline: none;
  border-color: #2563eb;
}

.cst-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.cst-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cst-btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.cst-btn-primary {
  background: #2563eb;
  color: #fff;
}

.cst-btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.cst-muted {
  color: #6b7280;
  font-size: 13px;
}

.cst-card {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.cst-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cst-title {
  font-size: 18px;
  font-weight: 700;
}

.cst-subtitle {
  font-size: 13px;
  color: #6b7280;
}

.cst-phase {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cst-badge {
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.cst-progress {
  margin-top: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  padding: 12px;
  height: 70px;
}

.cst-progress-badge {
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
}

.cst-progress-bar {
  height: 100%;
  background: #2563eb;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.cst-progress-row {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.cst-progress-bar-wrap {
  height: 16px;
  border-radius: 999px;
  background: #eee;
  overflow: hidden;
}

.cst-status-grid,
.cst-summary-grid,
.cst-final-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.cst-status-label,
.cst-summary-label,
.cst-final-label {
  font-size: 12px;
  color: #6b7280;
}

.cst-status-value,
.cst-summary-value,
.cst-final-value {
  font-weight: 600;
  font-size: 14px;
}

.cst-pages {
  margin-top: 12px;
}

.cst-pages-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.cst-pages-list {
  padding-left: 18px;
  font-size: 13px;
}

.cst-error {
  margin-top: 12px;
  color: #b91c1c;
  font-size: 14px;
}

.cst-success {
  margin-top: 12px;
  color: #065f46;
  font-size: 14px;
}

.cst-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.cst-small {
  font-size: 12px;
}

.cst-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cst-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0; /* override earlier margin if any */
}

.cst-loading p {
  margin: 0;
}

.cst-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top: 3px solid #0073aa;
  border-radius: 50%;
  animation: cst-spin 0.8s linear infinite;
  margin: 0 auto 8px;
}

@keyframes cst-spin {
  to { transform: rotate(360deg); }
}
