/* .sp- · B5 · робочі стани і помилка (X4, X5, робочі стани прототипу). */

/* ── Екран сцени (T3: padding 36–44 · clamp(24px,4vw,56px) · 80–96 · max-w 1000) ── */

.sp {
  max-width: 1000px;
  padding: 44px clamp(24px, 4vw, 56px) 96px;
}

.sp-title {
  margin-top: 18px;
  overflow-wrap: anywhere;
}

/* Пульсуюча крапка --accent у заголовку (T4: opacity 1 → .2 · 1.1s, reduced-motion — base.css). */
.sp-pulse {
  display: inline-block;
  animation: adc-pulse 1.1s ease-in-out infinite;
}

.sp-body {
  margin-top: 44px;
}

.sp-host {
  margin-bottom: 36px;
  overflow-wrap: anywhere;
}

/* ── Лічильник (X5) і відсоток рендеру ── */

.sp-numeral {
  white-space: nowrap;
}

.sp-bar {
  margin-top: 26px;
}

/* Мітка під смугою: 400 12px/1.4 mono, --muted (X5). */
.sp-caption {
  margin-top: 12px;
  color: var(--muted);
  font: 400 12px / 1.4 var(--f-mono);
}

/* Невідомий done/total: смужка біжить по треку. */
.sp-bar--unknown .bar__fill {
  width: 28%;
  animation: sp-indeterminate 1.6s var(--ease) infinite;
  transition: none;
}

@keyframes sp-indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(360%);
  }
}

/* ── Мітки stageLog: ✓ попередні, спінер на останній ── */

.sp-log {
  max-width: 640px;
  border-top: 1px solid var(--line);
}

.sp-log__row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: 400 15px / 1.45 var(--f-ui);
}

.sp-log__row[data-state="done"] {
  color: var(--ink-2);
}

.sp-log__mark {
  justify-self: start;
  color: var(--ink);
  font: 500 13px / 1 var(--f-mono);
}

.sp-log__count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── directing: дві гілки ── */

.sp-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px 56px;
}

.sp-branch__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.sp-branch__right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sp-branch__status {
  color: var(--muted);
  font: 500 12px / 1 var(--f-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sp-branch[data-state="done"] .sp-branch__status,
.sp-branch[data-state="kept"] .sp-branch__status {
  color: var(--ink);
}

.sp-branch[data-state="pending"] .sp-branch__name {
  color: var(--muted);
}

.sp-branch .sp-bar {
  margin-top: 18px;
}

/* ── revising: цитата правки клієнта ── */

.sp-quote {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin-bottom: 36px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}

.sp-quote__text {
  color: var(--ink);
  font: 400 20px / 1.45 var(--f-ui);
  overflow-wrap: anywhere;
}

/* ── failed (X4) ── */

.sp-failed__eyebrow {
  color: var(--danger);
}

.sp-failed__lead {
  max-width: 520px;
  margin-top: 20px;
  color: var(--ink-2);
  font: 400 17px / 1.55 var(--f-ui);
}

.sp-failed__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

@media (prefers-reduced-motion: reduce) {
  .sp-bar--unknown .bar__fill {
    animation: none;
    width: 100%;
    opacity: 0.35;
  }
}
