/* ---- Action buttons ---- */
.act-btn {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  color: #111827;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.7rem 0.5rem;
  border-radius: 0.9rem;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #e5e7eb;
}
.act-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.act-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#actDelete:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ---- Waveform ---- */
.wave-scroller {
  position: relative;
  width: 100%;
  height: 200px;
  overflow-x: auto;
  overflow-y: hidden;
  /* timeline is always left-to-right (time 0 at left); force LTR so scrollLeft
     stays 0..max even though the page is dir=rtl — otherwise zoom snaps to start
     and scrolling runs into empty/negative space. */
  direction: ltr;
  background: #fbfbfd;
  border: 1px solid #f0f1f4;
  border-radius: 1.1rem;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
  .wave-scroller { height: 240px; }
}
.wave-spacer {
  height: 1px;
  pointer-events: none;
}
.wave-stage {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}
.wave-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#waveOverlay {
  touch-action: none;
}
.wave-scroller::-webkit-scrollbar {
  height: 10px;
}
.wave-scroller::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}
.wave-scroller::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- Parts rows ---- */
.part-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  padding: 0.6rem 0.8rem;
}
.part-badge {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 0.7rem;
  background: #111827;
  color: #fff;
  font-weight: 900;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.part-mini {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.7rem;
  transition: all 0.15s;
}
.part-mini:hover { background: #f3f4f6; }
.part-mini:active { transform: scale(0.95); }

/* ---- Spinner ---- */
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #e5e7eb;
  border-top-color: #111827;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
