/* ============================================================
   PIPELINE — sample list, stage pills, result cards
   ============================================================ */

/* Sample list */
.samples-list {
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
  max-height: 620px;
  padding-right: 4px;
}
.sample-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  cursor: pointer;
  transition: all 160ms;
}
.sample-card:hover {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: var(--panel-3);
  transform: translateX(2px);
}
.sample-card.active {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(217, 70, 239, 0.14);
  box-shadow: 0 0 0 1px var(--accent);
}
.sample-card .sample-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.sample-id {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); font-weight: 600;
}
.sample-cat {
  font-size: 10px; padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  border: 1px solid var(--border);
  text-transform: capitalize;
}
.sample-preview {
  font-size: 11.5px; color: var(--text-dim);
  margin-top: 6px; line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sample-meta {
  font-size: 10px; color: var(--muted);
  margin-top: 5px; font-family: var(--mono);
}

/* Pipeline stage bar */
.pipeline-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.stage-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 220ms;
  overflow: hidden;
}
.stage-pill .stage-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
  transition: all 220ms;
}
.stage-pill.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-3);
}
.stage-pill.active .stage-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: stagePulse 1.2s ease-in-out infinite;
}
.stage-pill.active::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(217, 70, 239, 0.22) 50%, transparent 100%);
  animation: stageShimmer 1.6s linear infinite;
}
.stage-pill.done {
  background: rgba(74, 222, 128, 0.14);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.42);
}
.stage-pill.done .stage-dot { background: var(--good); opacity: 1; }
.stage-pill.error {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.42);
}
.stage-pill .timing {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--muted); margin-left: 2px;
}
@keyframes stagePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}
@keyframes stageShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Results stream */
.results {
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  max-height: 720px;
}

.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 360ms ease, transform 360ms ease, border-color 200ms;
}
.card.visible { opacity: 1; transform: translateY(0); }
.card:hover { border-color: var(--border-strong); }
.card .head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card .head h4 {
  margin: 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
}
.card .head .meta {
  font-size: 11px; color: var(--muted); font-family: var(--mono);
}
.stage-badge {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
}
.stage-badge.preprocessing { background: var(--c-pre); color: var(--c-pre); }
.stage-badge.action_items  { background: var(--c-action); color: var(--c-action); }
.stage-badge.decisions     { background: var(--c-decision); color: var(--c-decision); }
.stage-badge.topics        { background: var(--c-topic); color: var(--c-topic); }
.stage-badge.sentiment     { background: var(--c-sentiment); color: var(--c-sentiment); }
.stage-badge.summary       { background: var(--c-summary); color: var(--c-summary); }
.stage-badge.validation    { background: var(--c-validation); color: var(--c-validation); }

/* Decision and topic cards */
.list-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.list-item:last-child { margin-bottom: 0; }
.list-item .title { font-weight: 600; font-size: 13px; }
.list-item .body { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; line-height: 1.5; }
.list-item .quote { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 6px; }
.list-item .row-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.list-item.decision { border-left-color: var(--c-decision); }
.list-item.topic { border-left-color: var(--c-topic); }
.list-item.topic .range { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 5px; }

/* Sentiment tiles */
.sentiment-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 10px;
}
.sentiment-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.sentiment-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 10px;
}
.sentiment-tile .name { font-size: 12px; font-weight: 600; }
.sentiment-tile .sub  { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Summary card */
.summary-text {
  font-size: 14px; line-height: 1.6; color: var(--text-dim);
}
ul.takeaways { padding-left: 18px; margin: 8px 0 0; }
ul.takeaways li { margin: 4px 0; }

/* Validation warnings */
.warn-list {
  font-size: 12px; max-height: 180px; overflow-y: auto;
  margin-top: 6px;
}
.warn-list .warn-row {
  padding: 7px 0;
  border-bottom: 1px solid rgba(42, 47, 61, 0.5);
}
.warn-list .warn-row:last-child { border-bottom: none; }
.warn-list code { color: var(--warn); }

/* Stagger animation on cards */
.card:nth-child(1) { transition-delay: 0ms; }
.card:nth-child(2) { transition-delay: 50ms; }
.card:nth-child(3) { transition-delay: 100ms; }
.card:nth-child(4) { transition-delay: 150ms; }
.card:nth-child(5) { transition-delay: 200ms; }
