/* ============== Agent Jobs page ============== */
.content-jobs { padding: 0; overflow-y: auto; background: var(--bg); }

.topbar-slot { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  background: var(--fg); color: var(--bg-elevated);
  border-radius: var(--r-md); font-size: var(--fs-12); font-weight: 500;
  white-space: nowrap;
}
.btn-primary:hover { background: #000; }
.btn-primary .plus { font-size: 14px; line-height: 1; opacity: 0.8; }

/* Toolbar */
.jobs-toolbar {
  position: sticky; top: 0; background: var(--bg);
  z-index: 5; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.jobs-toolbar-row {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}

/* ===== Salesforce-style stage pipeline ===== */
.pipeline-bar {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  height: 30px;
  font-size: var(--fs-12);
}
.pipe-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  margin-right: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  color: var(--fg-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms, color 100ms;
  /* Right-pointing chevron — flat left, pointed right */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  display: flex; align-items: center; justify-content: center;
}
.pipe-stage[data-first="true"] {
  /* Flat left edge */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  border-radius: 4px 0 0 4px;
}
.pipe-stage[data-last="true"] {
  /* Flat right edge */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
  border-radius: 0 4px 4px 0;
  margin-right: 0;
}
.pipe-stage:hover {
  background: var(--bg-active);
  color: var(--fg);
}
.pipe-stage.is-muted { color: var(--fg-tertiary); }
.pipe-stage.is-muted:hover { color: var(--fg-secondary); }
.pipe-stage-inner {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 0 8px 0 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.pipe-stage[data-first="true"] .pipe-stage-inner { padding-left: 10px; }
.pipe-num {
  font-size: 10px; font-weight: 700;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.pipe-stage:hover .pipe-num { color: var(--fg-secondary); }
.pipe-name {
  font-size: var(--fs-12); font-weight: 500;
  letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis;
}
.pipe-count {
  font-size: var(--fs-11); font-weight: 600;
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
  background: var(--bg-active);
  border-radius: 8px;
  height: 16px; min-width: 18px;
  padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pipe-stage.is-muted .pipe-count {
  background: transparent;
  color: var(--fg-tertiary);
}

/* Toolbar action buttons (Search / Filter) */
.toolbar-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.toolbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  color: var(--fg-secondary);
  font-size: var(--fs-12); font-weight: 500;
  white-space: nowrap;
}
.toolbar-btn:hover { color: var(--fg); border-color: var(--border-strong); }

/* Groups */
.groups-wrap { padding: 8px 16px 32px; position: relative; }

.stage-group {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0;
  position: relative;
}

/* Rail (vertical timeline) — number badges on the line */
.stage-rail {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  justify-self: center;
  width: 36px;
}
.stage-rail::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1.5px;
  margin-left: -0.75px;
  background: var(--border-strong);
  z-index: 0;
}
.stage-group:first-child .stage-rail::before { top: 24px; }
.stage-group:last-child.is-collapsed .stage-rail::before { display: none; }
.stage-group:last-child:not(.is-collapsed) .stage-rail::before { bottom: 16px; }

.rail-line { display: none; }
.rail-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  display: inline-grid; place-items: center;
  margin-top: 5px;
  flex: 0 0 auto;
  z-index: 2;
  position: relative;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stage-content { min-width: 0; padding: 0 0 16px 12px; }
.group-header { padding-top: 0; padding-bottom: 4px; }

.group-header {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 4px 8px 4px 4px;
  background: transparent; cursor: pointer;
  user-select: none;
  border-radius: var(--r-md);
  margin-left: -4px;
}
.group-header:hover { background: rgba(15,23,31,0.025); }
.group-header:hover .group-toggle { color: var(--fg); border-color: var(--border-strong); background: var(--bg-elevated); }
.group-sub, .group-name, .group-dash { white-space: nowrap; }
.group-num {
  font-family: var(--font-mono); font-size: var(--fs-12);
  font-weight: 600; color: var(--fg-tertiary);
  display: none;
}
.group-name {
  font-size: var(--fs-14); font-weight: 600;
  color: var(--fg); letter-spacing: -0.01em;
}
.group-dash { color: var(--fg-tertiary); font-weight: 400; }
.group-sub { font-size: var(--fs-13); color: var(--fg-secondary); font-weight: 500; }
.group-count {
  font-size: var(--fs-11); font-weight: 600;
  color: var(--fg-secondary); font-variant-numeric: tabular-nums;
  background: var(--bg-elevated); border: 1px solid var(--border);
  height: 18px; min-width: 22px; padding: 0 6px;
  border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center;
}
.group-chev {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-md);
  color: var(--fg-secondary);
  transition: transform 160ms ease, color 100ms, background 100ms;
  transform: rotate(0deg);
  margin-left: 2px;
  flex-shrink: 0;
}
.group-chev svg { display: block; }
.group-chev.is-collapsed { transform: rotate(-90deg); }
.group-header:hover .group-chev {
  color: var(--fg);
  background: var(--bg-active);
}
.group-desc {
  margin: 0 0 10px 0;
  font-size: var(--fs-12); color: var(--fg-secondary);
  font-style: italic; max-width: 880px; line-height: 1.45;
}
.group-body { display: flex; flex-direction: column; gap: 8px; }
.group-empty {
  padding: 14px 18px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: var(--fs-12); color: var(--fg-tertiary);
  font-style: italic;
}

/* Job card */
.job-card {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 100ms, box-shadow 100ms;
  cursor: pointer;
}
.job-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 3px rgba(15,23,31,0.05);
}
.job-card-anomaly { border-left: 3px solid oklch(0.55 0.18 25); }

.job-card-main { padding: 14px 16px; min-width: 0; }
.job-card-heading {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.job-title {
  font-size: var(--fs-15); font-weight: 600;
  color: var(--fg); letter-spacing: -0.01em;
  margin: 0;
}
.anomaly-flag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 600; color: oklch(0.55 0.18 25);
  background: rgba(200,68,45,0.08); padding: 2px 6px; border-radius: 3px;
}

.job-meta-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  font-size: 11px; font-weight: 500;
  color: var(--fg-secondary);
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 4px; white-space: nowrap;
}
.meta-icon { color: var(--fg-tertiary); font-size: 9px; }

/* Center field row */
.center-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px 18px;
  align-items: flex-start;
}
.center-field { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.center-field.cf-grow { grid-column: span 2; }
.cf-label {
  font-size: var(--fs-11); color: var(--fg-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
}
.cf-value {
  font-size: var(--fs-13); color: var(--fg);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.cf-strong { font-weight: 600; }
.cf-success { color: oklch(0.55 0.13 150); font-weight: 600; }
.cf-warn { color: oklch(0.55 0.13 70); font-weight: 600; }
.muted-val { color: var(--fg-tertiary); font-weight: 400; }

/* Right side */
.job-card-side {
  display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--border);
  background: rgba(15,23,31,0.012);
}
.row-summary {
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
}
.rs-label {
  font-size: var(--fs-11); color: var(--fg-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
}
.rs-value { font-size: var(--fs-13); color: var(--fg); font-weight: 500; }
.rs-cost {
  font-size: var(--fs-18); font-weight: 700; color: var(--fg);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  line-height: 1.1;
}
.rs-cost-unit { font-size: var(--fs-11); color: var(--fg-tertiary); font-weight: 500; margin-left: 1px; }
.rs-cost-secondary {
  font-size: var(--fs-11); color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums; margin-top: 1px;
}

/* Stage strip */
.stage-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  flex: 1;
}
.strip-cell {
  padding: 10px 6px 12px;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  border-right: 1px solid var(--border);
  position: relative;
  background: transparent;
  min-width: 0;
}
.strip-cell:last-child { border-right: none; }
.strip-cell.is-current {
  background: var(--accent-bg);
}
.strip-cell.is-current::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.strip-label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--fg-tertiary);
  white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.strip-cell.is-current .strip-label { color: var(--accent); }
.strip-cell.is-past .strip-label { color: var(--fg-tertiary); }
.strip-state {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--fs-12); font-weight: 600;
  color: var(--fg-secondary);
}
.strip-check { color: oklch(0.55 0.13 150); font-size: 11px; }
.strip-current-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}

/* Reused bits */
.fit-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 500; color: var(--fg); }
.fit-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.status-dot-row { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 500; }
.status-pulse-wrap { position: relative; width: 8px; height: 8px; display: inline-block; }
.status-pulse { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-pulse-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid; opacity: 0.3;
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.int-stack { display: inline-flex; align-items: center; gap: 4px; }
.int-dot {
  width: 22px; height: 22px; border-radius: 5px;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
  position: relative; flex-shrink: 0;
}
.int-status {
  position: absolute; bottom: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--bg-elevated);
}
.int-status-connecting { background: oklch(0.62 0.10 80); animation: pulse-ring 1.4s ease-in-out infinite; }
.int-status-pending { background: var(--fg-tertiary); }
.int-status-failed { background: oklch(0.55 0.18 25); }
.int-more {
  height: 22px; padding: 0 6px; border-radius: 5px;
  background: var(--bg-active); color: var(--fg-secondary);
  font-size: 10px; font-weight: 600;
  display: inline-grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

.bound-pill {
  display: inline-flex; align-items: center;
  height: 19px; padding: 0 7px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  background: rgba(193, 68, 12, 0.06);
  color: oklch(0.45 0.10 25);
  border: 1px solid rgba(193, 68, 12, 0.12);
  white-space: nowrap;
}

.pill {
  display: inline-flex; align-items: center;
  height: 19px; padding: 0 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.pill-neutral { background: var(--bg-active); color: var(--fg-secondary); }
.pill-accent { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.pill-warn { background: rgba(193,144,20,0.10); color: oklch(0.50 0.10 75); }

.flow-text {
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: -0.005em;
  color: var(--fg);
  background: rgba(15,23,31,0.025);
  padding: 3px 7px; border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.trial-progress { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.trial-progress-label {
  font-size: var(--fs-12); color: var(--fg-secondary);
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.progress-track {
  height: 4px; width: 100%; max-width: 200px;
  background: var(--bg-active); border-radius: 2px;
  display: block; overflow: hidden;
}
.progress-fill { height: 100%; display: block; border-radius: 2px; transition: width 200ms; }

.anomaly-note { font-size: 11px; color: oklch(0.50 0.15 25); margin-top: 2px; font-weight: 500; }

.archive-link { padding: 4px 16px 32px; font-size: var(--fs-13); }
.archive-link a { color: var(--fg-tertiary); text-decoration: none; font-weight: 500; }
.archive-link a:hover { color: var(--fg-secondary); }


/* ============== Triage card (Discovered stage) — compact ============== */
.triage-card {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.triage-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(15,23,31,0.04), 0 4px 12px -4px rgba(15,23,31,0.08);
}
.triage-card:hover .tc-open { color: var(--fg); }
.triage-card:hover .tc-arrow { transform: translateX(2px); }

.triage-main {
  position: relative;
  padding: 14px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.triage-side {
  padding: 14px 16px 12px 16px;
  border-left: 1px solid var(--border);
  background: rgba(15,23,31,0.012);
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.tc-side-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 6px;
}

.tc-head {
  display: flex; align-items: center;
  gap: 12px;
  padding-right: 140px; /* leave room for the corner-attached source badge */
}
.tc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tc-source {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: 0 0 0 8px;
  border-top: none;
  border-right: none;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--bg);
  color: var(--fg-tertiary);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.tc-source-discovered { color: var(--fg-tertiary); }
.tc-source-requested { color: var(--fg-tertiary); }
.tc-source-vendor, .tc-source-suggested, .tc-source-carried { color: var(--fg-tertiary); }

.tc-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  text-wrap: pretty;
  max-width: 78ch;
}

.tc-why {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-tertiary);
  font-style: italic;
  text-wrap: pretty;
  max-width: 82ch;
}

/* Compact stats row: People <avatars> +N · Tools <dots> +N */
.tc-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto; /* pin to bottom of left section */
  padding-top: 10px;
  font-size: 12px;
  color: var(--fg-tertiary);
  flex-wrap: wrap;
}
.tc-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tc-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}
.tc-stat-sep {
  color: var(--border-strong);
  user-select: none;
}
.tc-stat-more {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}

.tc-people-stack {
  display: inline-flex;
  align-items: center;
}
.tc-person-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-active);
  border: 1.5px solid var(--bg-elevated);
  color: var(--fg-secondary);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: -5px;
}
.tc-person-avatar:first-child { margin-left: 0; }

.tc-tool-stack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tc-tool-dot-wrap {
  display: inline-flex;
}
.tc-tool-dot-wrap .int-dot {
  width: 16px; height: 16px;
  font-size: 8px;
  border-radius: 3.5px;
}

.tc-value-headline {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

.tc-side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--fg-tertiary);
}
.tc-updated {
  font-variant-numeric: tabular-nums;
}

.tc-open {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-secondary);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 120ms ease;
}
.tc-arrow {
  display: inline-block;
  transition: transform 160ms ease;
}

.group-desc-note {
  color: var(--fg-tertiary);
  font-style: italic;
}

/* ============== Setup card (Job setup / Scoping stage) ============== */
.setup-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.setup-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(15,23,31,0.04), 0 4px 12px -4px rgba(15,23,31,0.08);
}
.setup-card:hover .sc-open { color: var(--fg); }
.setup-card:hover .sc-arrow { transform: translateX(2px); }

.setup-main {
  position: relative;
  padding: 14px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.setup-side {
  padding: 14px 16px 14px 16px;
  border-left: 1px solid var(--border);
  background: rgba(15,23,31,0.012);
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sc-head {
  display: flex; align-items: center;
  gap: 12px;
  padding-right: 170px; /* leave room for the corner-attached status badge */
}
.sc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.sc-status {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: 0 0 0 8px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--bg);
  color: var(--fg-tertiary);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.sc-status-drafting {
  color: var(--fg-tertiary);
}
.sc-status-awaiting_input {
  color: oklch(0.50 0.13 60);
  background: rgba(217, 119, 6, 0.05);
}
.sc-status-ready {
  color: oklch(0.46 0.12 150);
  background: rgba(22, 163, 74, 0.05);
}
.sc-status-onb-connecting_integrations {
  color: var(--fg-tertiary);
}
.sc-status-onb-loading_context {
  color: oklch(0.48 0.14 280);
  background: rgba(99, 91, 255, 0.05);
}
.sc-status-onb-ready_for_trial {
  color: oklch(0.46 0.12 150);
  background: rgba(22, 163, 74, 0.05);
}

.sc-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  text-wrap: pretty;
  max-width: 78ch;
}

.sc-needs {
  margin: 0;
  padding: 8px 10px;
  background: rgba(217, 119, 6, 0.05);
  border-left: 2px solid oklch(0.55 0.13 60);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg);
  display: flex; align-items: flex-start; gap: 6px;
}
.sc-arrow-in {
  color: oklch(0.55 0.13 60);
  font-weight: 600;
  flex-shrink: 0;
}

.sc-footer {
  display: none;
}
.sc-side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--fg-tertiary);
}
.sc-updated {
  font-variant-numeric: tabular-nums;
}
.sc-open {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-secondary);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 120ms ease;
}
.sc-arrow {
  display: inline-block;
  transition: transform 160ms ease;
}

.sc-side-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.setup-progress {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.sp-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.4;
}
.sp-label {
  color: var(--fg-secondary);
  min-width: 0;
}
.sp-value {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.sp-value-complete {
  color: oklch(0.46 0.12 150);
}
.sp-value-pending {
  color: var(--fg-tertiary);
  font-style: italic;
  font-weight: 400;
}
.sp-of {
  color: var(--fg-tertiary);
  font-weight: 400;
}
.sp-num {
  font-variant-numeric: tabular-nums;
}

/* ============== Production card (Production stage, incl. trial) ============== */
.prod-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.prod-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(15,23,31,0.04), 0 4px 12px -4px rgba(15,23,31,0.08);
}
.prod-card:hover .pc-open { color: var(--fg); }
.prod-card:hover .pc-arrow { transform: translateX(2px); }
.prod-card-anomaly {
  border-color: rgba(220, 38, 38, 0.28);
}
.prod-card-anomaly:hover {
  border-color: rgba(220, 38, 38, 0.45);
}

.prod-main {
  position: relative;
  padding: 14px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.prod-side {
  padding: 14px 16px 14px 16px;
  border-left: 1px solid var(--border);
  background: rgba(15,23,31,0.012);
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.pc-head {
  display: flex; align-items: center;
  gap: 12px;
  padding-right: 200px; /* room for corner-attached status badge */
}
.pc-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.pc-status {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: 0 0 0 8px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--bg);
  color: var(--fg-tertiary);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.pc-status-running {
  color: oklch(0.46 0.12 150);
  background: rgba(22, 163, 74, 0.05);
}
.pc-status-trial {
  color: oklch(0.48 0.14 280);
  background: rgba(99, 91, 255, 0.05);
}
.pc-status-trial-decision {
  color: oklch(0.50 0.13 60);
  background: rgba(217, 119, 6, 0.06);
}
.pc-status-anomaly {
  color: oklch(0.48 0.18 25);
  background: rgba(220, 38, 38, 0.06);
}
.pc-status-paused {
  color: var(--fg-tertiary);
  background: var(--bg-active);
}

.pc-needs {
  margin: 0;
  padding: 8px 10px;
  background: rgba(217, 119, 6, 0.05);
  border-left: 2px solid oklch(0.55 0.13 60);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg);
  display: flex; align-items: flex-start; gap: 6px;
}
.pc-arrow-in {
  color: oklch(0.55 0.13 60);
  font-weight: 600;
  flex-shrink: 0;
}

.pc-anomaly-note {
  margin: 0;
  padding: 8px 10px;
  background: rgba(220, 38, 38, 0.05);
  border-left: 2px solid oklch(0.55 0.18 25);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg);
  display: flex; align-items: flex-start; gap: 6px;
}
.pc-anomaly-icon {
  color: oklch(0.55 0.18 25);
  flex-shrink: 0;
}

.pc-tools-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto; /* push tools to bottom of left section */
}
.pc-side-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}
.pc-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pc-tool-dot-wrap {
  display: inline-flex;
}
.pc-tool-dot-wrap .int-dot {
  width: 18px; height: 18px;
  font-size: 8.5px;
  border-radius: 4px;
}
.pc-tools-more {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.pc-metrics {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.pcm-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.4;
}
.pcm-label {
  color: var(--fg-secondary);
  min-width: 0;
}
.pcm-value {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.pcm-num {
  font-variant-numeric: tabular-nums;
}
.pcm-unit {
  color: var(--fg-tertiary);
  font-weight: 400;
}
.pcm-value-good {
  color: oklch(0.46 0.12 150);
}
.pcm-value-warn {
  color: oklch(0.50 0.13 60);
}

.pc-side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--fg-tertiary);
}
.pc-updated {
  font-variant-numeric: tabular-nums;
}
.pc-open {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-secondary);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 120ms ease;
}
.pc-arrow {
  display: inline-block;
  transition: transform 160ms ease;
}
