/* ============================================================================
   Track tab → Stems (js/audio/stems.js) and Frequency bands (js/audio/bands.js)
   ========================================================================= */

/* ---------- stems ---------- */
.stems { margin-bottom: var(--space-3); }
.stems .action-btn[hidden] { display: none; } /* .action-btn is display:flex */
.stems .dl-status { margin: 0 0 var(--space-2); }
.stems .dl-status[data-kind="err"] { color: var(--err); }
.stems .dl-progress-bar { margin: 0 0 var(--space-2); }
.stems-rows[hidden] { display: none !important; }
.stems-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-2);
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-3);
}
.stem-row {
  display: grid;
  grid-template-columns: 56px 1fr 28px 28px;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--ink-2);
}
.stem-row.is-silent .stem-name,
.stem-row.is-silent .stem-meter { opacity: 0.4; }
.stem-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.stem-name::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--stem);
  box-shadow: 0 0 8px var(--stem);
  flex-shrink: 0;
}
.stem-meter,
.band-meter {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-4);
  overflow: hidden;
}
.stem-meter-fill,
.band-meter-fill {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, color-mix(in srgb, var(--stem, var(--band)) 55%, transparent), var(--stem, var(--band)));
  will-change: transform;
}
.stem-hit,
.band-hit {
  position: absolute; right: 3px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%;
  background: var(--ink-5);
  transition: background 0.08s linear, box-shadow 0.08s linear;
}
.stem-hit.on,
.band-hit.on { background: #fff; box-shadow: 0 0 8px #fff; }
.stem-btn {
  height: 24px;
  border-radius: var(--radius-2);
  border: 1px solid var(--hairline-2);
  background: var(--surface-4);
  color: var(--ink-3);
  font: 700 11px var(--font-mono);
  cursor: pointer;
}
.stem-btn:hover { color: var(--ink); border-color: var(--ink-5); }
.stem-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stem-btn[data-act="mute"][aria-pressed="true"] { background: rgba(255, 177, 74, 0.25); border-color: #ffb14a; color: #ffd9a3; }
.stem-btn[data-act="solo"][aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.stems-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.4;
}
.stems-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-3);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;
}
.stems-link:hover { color: var(--ink); }

/* ---------- bands ---------- */
.bands { margin-bottom: var(--space-3); }
.band-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-2); }
.band-list:empty { display: none; }
.band-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 26px 26px;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--band);
  border-radius: var(--radius-3);
  background: var(--surface-3);
}
.band-info { min-width: 0; display: flex; flex-direction: column; }
.band-info b { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-info small { font-size: 10px; color: var(--ink-4); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-2);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 12px;
}
.band-icon:hover { background: var(--surface-4); color: var(--ink); border-color: var(--hairline-2); }
.band-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.band-editor {
  --band: var(--accent);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-4);
  background: rgba(255, 60, 120, 0.05);
}
.band-editor-head { display: grid; grid-template-columns: 1fr 90px; gap: var(--space-2); align-items: center; }
.band-meter-lg { height: 12px; }
.band-name-input,
.band-hz {
  background: var(--surface-4);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-2);
  color: var(--ink);
  font-size: 13px;
  padding: 7px 9px;
  min-width: 0;
}
.band-name-input:focus-visible,
.band-hz:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.band-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.band-chip {
  border: 1px solid var(--hairline-2);
  background: var(--surface-4);
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.band-chip small { color: var(--ink-4); font-weight: 400; font-family: var(--font-mono); font-size: 10px; }
.band-chip:hover { border-color: var(--accent); color: var(--ink); }
.band-spectrum {
  width: 100%;
  height: 120px;
  display: block;
  border-radius: var(--radius-3);
  background: #07070a;
  border: 1px solid var(--hairline);
  touch-action: none;
}
.band-ranges { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.band-range { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.band-hz { width: 78px; font-family: var(--font-mono); font-size: 12px; padding: 5px 7px; }
.band-hz-unit { font-size: 11px; color: var(--ink-4); }
.band-editor .btn-row { margin-top: 2px; }
.band-editor .select-row,
.band-editor .slider-row { padding: 2px 0; }
