/* live.css — Live generation view.
   Aligned with SonicFlow design system (concert-hall parchment). */

/* ===== Stuck indicator ===== */
.lv-stuck {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 0;
  font-size: 10px;
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    background 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}
.lv-stuck.hidden {
  display: none;
}
.lv-stuck-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: lv-pulse 1.4s ease-out infinite;
}
.lv-stuck.warn {
  color: var(--sf-warning, #8a6a2f);
  background: var(--sf-warning-bg, rgba(138, 106, 47, 0.1));
  box-shadow: 0 0 0 1px rgba(184, 151, 90, 0.28) inset;
}
.lv-stuck.info {
  color: var(--sf-burgundy, #6b2c3e);
  background: rgba(107, 44, 62, 0.08);
  box-shadow: 0 0 0 1px rgba(107, 44, 62, 0.2) inset;
}
.lv-stuck.alert {
  color: var(--sf-danger, #8b2e2e);
  background: var(--sf-danger-bg, rgba(139, 46, 46, 0.08));
  box-shadow: 0 0 0 1px rgba(139, 46, 46, 0.28) inset;
  animation: lv-shake 0.4s ease-in-out infinite alternate;
}
@keyframes lv-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(184, 151, 90, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(184, 151, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(184, 151, 90, 0);
  }
}
@keyframes lv-shake {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(1px);
  }
}

/* ===== Stage step-card grid ===== */
.lv-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.lv-stage {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 0;
  background: rgba(42, 33, 24, 0.035);
  border: 1px solid rgba(184, 151, 90, 0.14);
  transition:
    background 0.3s,
    border-color 0.3s;
  min-width: 0;
}
.lv-stage-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(42, 33, 24, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.lv-mark-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}
.lv-stage-body {
  min-width: 0;
  flex: 1;
}
.lv-stage-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--sf-ink-muted, #5c4f42);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv-stage-hint {
  font-size: 9px;
  color: rgba(42, 33, 24, 0.45);
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  line-height: 1.3;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv-stage-elapsed {
  font-size: 9px;
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  color: rgba(42, 33, 24, 0.4);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.lv-stage.queued .lv-stage-label {
  color: rgba(42, 33, 24, 0.4);
}
.lv-stage.active {
  background: rgba(107, 44, 62, 0.07);
  border-color: rgba(107, 44, 62, 0.32);
  box-shadow: 0 0 0 2px rgba(184, 151, 90, 0.08);
}
.lv-stage.active .lv-stage-mark {
  background: var(--sf-burgundy, #6b2c3e);
  box-shadow: 0 0 0 3px rgba(107, 44, 62, 0.16);
}
.lv-stage.active .lv-mark-dot {
  background: white;
  animation: lv-spin 1.2s linear infinite;
  border: 1.5px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  width: 6px;
  height: 6px;
}
.lv-stage.active .lv-stage-label {
  color: var(--sf-burgundy, #6b2c3e);
}
.lv-stage.active .lv-stage-elapsed {
  color: var(--sf-burgundy, #6b2c3e);
  font-weight: 600;
}
.lv-stage.done {
  background: rgba(184, 151, 90, 0.08);
  border-color: rgba(184, 151, 90, 0.22);
}
.lv-stage.done .lv-stage-mark {
  background: var(--sf-gold, #b8975a);
}
.lv-stage.done .lv-mark-dot::before {
  content: "✓";
  color: white;
  font-size: 9px;
  line-height: 1;
}
.lv-stage.done .lv-stage-label {
  color: rgba(90, 72, 40, 0.85);
}
.lv-stage.done .lv-stage-elapsed {
  color: rgba(90, 72, 40, 0.75);
}
.lv-stage.err {
  background: rgba(139, 46, 46, 0.06);
  border-color: rgba(139, 46, 46, 0.28);
}
.lv-stage.err .lv-stage-mark {
  background: var(--sf-danger, #8b2e2e);
}
.lv-stage.err .lv-stage-label {
  color: var(--sf-danger, #8b2e2e);
}
@keyframes lv-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Annotation timeline ===== */
.lv-timeline.hidden {
  display: none;
}
.lv-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.lv-tl-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sf-burgundy, #6b2c3e);
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
}
.lv-tl-legend {
  display: flex;
  gap: 8px;
}
.lv-legend-key {
  font-size: 9px;
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  padding: 1px 6px;
  border-radius: 0;
  color: var(--sf-cream, #fbf7f0);
}
.lv-key-bgm {
  background: rgba(107, 44, 62, 0.85);
}
.lv-key-sfx {
  background: rgba(92, 107, 74, 0.88);
}
.lv-key-song {
  background: rgba(138, 115, 72, 0.9);
}
.lv-timeline-body {
  position: relative;
  margin-bottom: 2px;
}
#lv-timeline-svg {
  display: block;
  width: 100%;
  height: 120px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0;
  border: 1px solid rgba(184, 151, 90, 0.16);
}
.lv-timeline-axis {
  position: relative;
  height: 14px;
  font-size: 8px;
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  color: rgba(92, 79, 66, 0.7);
  margin-top: 2px;
}
.lv-timeline-axis span {
  position: absolute;
  transform: translateX(-50%);
  top: 0;
}
.lv-timeline-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.lv-chip {
  font-size: 9px;
  font-family: var(--sf-font-mono, "JetBrains Mono", monospace);
  padding: 2px 7px;
  background: rgba(107, 44, 62, 0.07);
  color: var(--sf-burgundy, #6b2c3e);
  border-radius: 0;
  border: 1px solid rgba(107, 44, 62, 0.18);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .lv-stuck-dot,
  .lv-stuck.alert,
  .lv-stage.active .lv-mark-dot {
    animation: none;
  }
}
