/* T1 — Split flow: the top bar's content, the first-time page (design 01),
   the splitting card (design 02) and the full-page drop target.
   Sizes and colours are the design's (docs/design/studio/html/01, 02). */

.sp-slot [hidden],
.sp-top [hidden],
.sp-drop[hidden] { display: none !important; }

.sp-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min-content;
  padding: 20px 28px;
}

@keyframes sp-spin { to { transform: rotate(360deg); } }

.sp-split__spinner,
.sp-step__spinner,
.sp-stem__spinner { animation: sp-spin 1s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .sp-split__spinner,
  .sp-step__spinner,
  .sp-stem__spinner { animation: none; }
}

/* ---- Top bar ---------------------------------------------------------------- */

.sp-top {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  container: sp-top / inline-size;
}

.sp-top__title { display: flex; align-items: center; gap: 10px; }
.sp-top__name { color: var(--st-text); font-size: 15px; font-weight: 600; }
.sp-top__usage {
  padding: 4px 10px;
  border-radius: 999px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-surface);
  color: var(--st-text-dim);
  font-size: 11.5px;
}

/* ---- The link field ---------------------------------------------------------- */

.sp-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  transition: outline-color 0.15s;
}
.sp-link:focus-within { outline-color: var(--st-text-faint); }
/* One ring, on the box (Upload included): the input draws none of its own,
   so the box shows focus. An invalid link shows a thin red border, which
   becomes the 2px ring while the input has focus (still one ring). */
.sp-link:has(.sp-link__input:focus-visible) { outline: 2px solid var(--st-accent); outline-offset: -1px; }
.sp-link.is-invalid { outline: 1px solid var(--st-accent); outline-offset: -0.5px; }

.sp-link__icon { color: var(--st-text-faint); }

.sp-link__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  --st-focus-ring-style: none;
  background: none;
  color: var(--st-text);
  font: 400 15px var(--st-font);
}
.sp-link__input::placeholder { color: var(--st-text-faint); opacity: 1; }

.sp-upload {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  border: 0;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-surface-2);
  color: var(--st-text-dim);
  font-family: var(--st-font);
  white-space: nowrap;
  cursor: pointer;
}
.sp-upload:hover { color: var(--st-text); outline-color: var(--st-line-strong); }

.sp-link--hero {
  flex: 1;
  height: 52px;
  padding: 0 8px 0 16px;
  border-radius: 12px;
  outline-color: var(--st-line-strong);
  background: var(--st-panel);
}
.sp-link--hero .sp-link__icon { width: 18px; height: 18px; }
.sp-link--hero .sp-upload { height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.sp-link--hero .sp-upload__icon { width: 14px; height: 14px; }

.sp-link--bar {
  flex: 1;
  height: 40px;
  padding: 0 6px 0 14px;
  border-radius: 10px;
  background: var(--st-surface);
}
.sp-link--bar .sp-link__input { font-size: 13px; }
.sp-link--bar .sp-link__input.has-link { color: var(--st-text-dim); font-family: var(--st-font-mono); }
.sp-link--bar .sp-link__input:focus { color: var(--st-text); }
.sp-link--bar .sp-upload { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.sp-link--bar .sp-upload__icon { width: 13px; height: 13px; }

/* ---- Extract chips ------------------------------------------------------------ */

.sp-extract { display: flex; align-items: center; flex: none; }

.sp-extract__label {
  margin-right: 10px;
  color: var(--st-text-faint);
  font: 400 10px var(--st-font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-surface-2);
  color: var(--st-text);
  font: 500 12px var(--st-font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, outline-color 0.15s;
}
.sp-chip:hover:not(:disabled) { outline-color: var(--st-line-strong); }
.sp-chip:disabled { cursor: default; }
.sp-chip__dot { width: 7px; height: 7px; border-radius: 4px; background: var(--chip-color); }

.sp-chip--all { color: var(--st-text-faint); }
.sp-chip--all[aria-pressed='true'] { outline-color: transparent; background: var(--st-text); color: var(--st-bg); }

.sp-chip[data-stem][aria-pressed='true'] {
  outline-color: color-mix(in srgb, var(--chip-color) 50%, transparent);
  background: color-mix(in srgb, var(--chip-color) 12%, transparent);
}
.sp-extract.is-locked .sp-chip[aria-pressed='false'] { opacity: 0.5; } /* 0.45 in the design; 0.5 keeps 4.5:1 */
.sp-extract.is-locked .sp-chip--all[aria-pressed='false'] { opacity: 1; }

.sp-extract--hero { gap: 6px; max-width: 100%; }
.sp-extract--hero .sp-chip { height: 28px; }

.sp-extract--bar {
  gap: 4px;
  height: 40px;
  padding: 0 4px 0 12px;
  border-radius: 10px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-surface);
}
.sp-extract--bar .sp-extract__label { margin-right: 8px; }
.sp-extract--bar .sp-chip { height: 30px; }

/* ---- Split stems ------------------------------------------------------------------ */

.sp-split {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  border: 0;
  outline: 1px solid var(--st-accent-edge);
  outline-offset: -0.5px;
  /* The design's #ff4468 highlight stays at the top edge; by the text it has
     reached #e4224a, so white text keeps 4.5:1 (white on #ff4468 is 3.3:1). */
  background: linear-gradient(180deg, var(--st-accent-hi) 0%, var(--st-accent-mid) 25%, var(--st-accent-strong) 100%);
  color: var(--st-on-accent);
  font-family: var(--st-font);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.sp-split__spinner { display: none; }

.sp-split--hero {
  height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--st-accent) 31%, transparent);
}
.sp-split--hero:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--st-accent) 45%, transparent); }

.sp-split--bar {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--st-accent) 25%, transparent);
}
.sp-split--bar:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--st-accent) 40%, transparent); }

.sp-split.is-busy {
  padding: 0 16px;
  outline-color: color-mix(in srgb, var(--st-accent) 40%, transparent);
  background: color-mix(in srgb, var(--st-accent) 15%, transparent);
  color: var(--st-menu-chosen-ink);
  box-shadow: none;
  cursor: default;
  font-variant-numeric: tabular-nums;
}
.sp-split.is-busy .sp-split__icon { display: none; }
.sp-split.is-busy .sp-split__spinner { display: block; width: 15px; height: 15px; color: var(--st-accent-ink); }

/* ---- Signed out, or before the session answers (decision 31) --------------------------

   Split stems and Upload need a signed-in session. Signed out they keep their
   look and swap the icon for sign-in; until the session answers they wait,
   dimmed and inert, so a signed-in visitor never sees "Sign in" flash. */

.sp-split__signin,
.sp-upload__signin,
.sp-hero__hint-signin { display: none; }
.sp-split[data-access='signed-out'] .sp-split__icon,
.sp-upload[data-access='signed-out'] .sp-upload__icon,
.sp-hero__hint[data-access='signed-out'] .sp-hero__hint-icon { display: none; }
.sp-split[data-access='signed-out'] .sp-split__signin,
.sp-upload[data-access='signed-out'] .sp-upload__signin { display: block; }
.sp-hero__hint[data-access='signed-out'] .sp-hero__hint-signin { display: block; width: 13px; height: 13px; }
.sp-hero__hint[data-access='signed-out'] { color: var(--st-text-dim); }
.sp-split:disabled,
.sp-upload:disabled { opacity: 0.5; box-shadow: none; cursor: default; }
.sp-upload:disabled:hover { color: var(--st-text-dim); outline-color: var(--st-line); }

/* ---- First-time page -------------------------------------------------------------- */

.sp-first { display: flex; flex-direction: column; align-items: center; gap: 40px; width: 100%; max-width: 880px; }

.sp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 880px;
  max-width: 100%;
  padding: 40px 48px 32px;
  border-radius: 24px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: radial-gradient(ellipse 65% 70% at 50% 0% in srgb, color-mix(in srgb, var(--st-accent) 12%, transparent) 0%, var(--st-surface) 100%);
}

.sp-wave { display: flex; align-items: center; gap: 5px; height: 48px; }
.sp-wave__group { display: flex; align-items: center; gap: 2px; }
.sp-wave__bar { width: 3px; border-radius: 2px; background: var(--bar-color); }

.sp-hero__heading { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; text-align: center; }
.sp-hero__title {
  margin: 0;
  color: var(--st-text);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1.1px;
  line-height: normal;
}
.sp-hero__sub {
  width: 560px;
  max-width: 100%;
  margin: 0;
  color: var(--st-text-dim);
  font-size: 15px;
  line-height: 23px;
  text-align: center;
}

.sp-hero__input { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.sp-hero__input .sp-link--hero { flex: 1 1 300px; }
.sp-extract--hero { flex-wrap: wrap; justify-content: center; }

.sp-hero__hint,
.sp-hero__error { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; }
.sp-hero__hint { color: var(--st-text-faint); }
.sp-hero__hint-icon { width: 13px; height: 13px; }
.sp-hero__error { color: var(--st-accent-ink); }

/* Examples */

.sp-examples { display: flex; flex-direction: column; gap: 12px; width: 880px; max-width: 100%; }
.sp-examples__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sp-examples__title { margin: 0; color: var(--st-text); font-size: 14px; font-weight: 600; }
.sp-examples__note { margin: 0; color: var(--st-text-faint); font-size: 12px; }
.sp-examples__cards { display: flex; gap: 12px; }

.sp-example {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: outline-color 0.15s, background 0.15s;
}
.sp-example:hover { outline-color: var(--st-line-strong); background: var(--st-surface-2); }
.sp-example:focus-visible { outline: 2px solid var(--st-accent); }

.sp-example__art {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: linear-gradient(-135deg, var(--art-from) 14.6%, var(--art-to) 85.4%);
  color: color-mix(in srgb, var(--st-on-accent) 87%, transparent);
}
.sp-example__note { width: 17px; height: 17px; }
/* A live card's video thumbnail (decision 63): over the gradient, which stays when it fails. */
.sp-example__art { position: relative; overflow: hidden; }
.sp-example__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.sp-example__thumb[data-loaded='true'] { opacity: 1; }
.sp-example[data-art='vocals'] { --art-from: var(--st-art-rose); --art-to: var(--st-art-violet); }
.sp-example[data-art='piano'] { --art-from: var(--st-art-teal); --art-to: var(--st-art-blue); }
.sp-example[data-art='drums'] { --art-from: var(--st-art-amber); --art-to: var(--st-art-red); }

.sp-example__meta { display: flex; flex-direction: column; flex: 1; gap: 2px; min-width: 0; }
.sp-example__title { color: var(--st-text); font-size: 13.5px; font-weight: 600; }
.sp-example__artist { color: var(--st-text-dim); font-size: 12px; }
.sp-example__label { color: var(--st-accent); font-size: 10.5px; font-weight: 600; }
.sp-example__info { color: var(--st-text-faint); font: 400 10.5px var(--st-font-mono); }
.sp-example__label,
.sp-example__title,
.sp-example__artist,
.sp-example__info { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sp-example__open {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  outline: 1px solid var(--st-line-strong);
  outline-offset: -0.5px;
  background: var(--st-surface-2);
  color: var(--st-text);
}
.sp-example__play { width: 13px; height: 13px; }

/* What you get */

.sp-features {
  display: flex;
  width: 880px;
  max-width: 100%;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--st-line);
  list-style: none;
}
.sp-feature {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  gap: 6px;
  box-sizing: content-box; /* equal text columns, whatever the padding */
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid var(--st-line);
}
.sp-feature:first-child { padding-left: 0; border-left: 0; }
.sp-feature:last-child { padding-right: 0; }

.sp-feature__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--feature-color) 10%, transparent);
  color: var(--feature-color);
}
.sp-feature__icon .st-icon { width: 15px; height: 15px; }
.sp-feature[data-feature='mixer'] { --feature-color: var(--st-stem-vocals); }
.sp-feature[data-feature='live'] { --feature-color: var(--st-stem-piano); }
.sp-feature[data-feature='sheet'] { --feature-color: var(--st-chord-ink); }
.sp-feature[data-feature='loops'] { --feature-color: var(--st-loop); }
.sp-feature__title { color: var(--st-text); font-size: 13.5px; font-weight: 600; }
.sp-feature__body { color: var(--st-text-faint); font-size: 12px; line-height: 17px; }

/* ---- Splitting card ------------------------------------------------------------------ */

.sp-card {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 780px;
  max-width: 100%;
  padding: 32px;
  border-radius: 22px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: radial-gradient(ellipse 65% 60% at 50% 0% in srgb, color-mix(in srgb, var(--st-accent) 8%, transparent) 0%, var(--st-surface) 100%);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--st-shadow) 50%, transparent);
}

.sp-card__song { display: flex; align-items: center; gap: 14px; }
.sp-card__art {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(-135deg, var(--st-art-rose) 14.6%, var(--st-art-violet) 85.4%);
  color: color-mix(in srgb, var(--st-on-accent) 87%, transparent);
}
.sp-card__art .st-icon { width: 22px; height: 22px; }
.sp-card__art { position: relative; overflow: hidden; }
/* The YouTube thumbnail over the gradient (api/thumbnail.ts): it shows once loaded, and goes if it fails. */
.sp-card__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.sp-card__thumb[data-loaded='true'] { opacity: 1; }
.sp-card__meta { display: flex; flex-direction: column; flex: 1; gap: 4px; min-width: 0; }
.sp-card__title { margin: 0; color: var(--st-text); font-size: 19px; font-weight: 600; letter-spacing: -0.3px; }
.sp-card__info { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--st-text-dim); font-size: 12.5px; }
.sp-card__origin { display: flex; color: var(--st-text-faint); }
.sp-card__origin-icon { width: 13px; height: 13px; }
.st-btn.sp-card__cancel { background: none; color: var(--st-text-dim); font-size: 12.5px; font-weight: 400; }
.st-btn.sp-card__cancel .st-icon { width: 13px; height: 13px; }
.st-btn.sp-card__cancel:hover { color: var(--st-text); }

.sp-card__overall { display: flex; flex-direction: column; gap: 10px; }
.sp-card__row { display: flex; align-items: flex-end; gap: 10px; }
.sp-card__pct {
  color: var(--st-text);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 30px;
  font-variant-numeric: tabular-nums;
}
.sp-card__now { flex: 1; padding-bottom: 2px; color: var(--st-text); font-size: 13px; font-weight: 500; }
.sp-card__eta { padding-bottom: 1px; color: var(--st-text-faint); font-size: 12.5px; }
.sp-card__bar { display: flex; height: 8px; border-radius: 4px; background: var(--st-line-strong); overflow: hidden; }
.sp-card__fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--st-accent-strong) 0%, var(--st-accent-hi) 80%, var(--st-accent-pale) 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--st-accent) 50%, transparent);
  transition: width 0.25s linear;
}
.sp-card[data-status='failed'] .sp-card__fill { background: var(--st-error-deep); box-shadow: none; }
.sp-card[data-status='failed'] .sp-card__now { color: var(--st-error-ink); }

/* Steps */

.sp-card__steps { display: flex; margin: 0; padding: 0; list-style: none; }
.sp-step { display: flex; flex-direction: column; flex: 1 1 0; gap: 8px; min-width: 0; }
.sp-step__row { display: flex; align-items: center; gap: 6px; }
.sp-step__marker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  outline: 1px solid var(--st-line-strong);
  outline-offset: -0.5px;
  background: var(--st-surface-2);
}
.sp-step__marker .st-icon { display: none; width: 12px; height: 12px; }
.sp-step__number { color: var(--st-text-faint); font: 400 10px var(--st-font-mono); }
.sp-step__line { flex: 1; height: 2px; border-radius: 1px; background: var(--st-line); }
.sp-step:last-child .sp-step__line { visibility: hidden; }
.sp-step__title { color: var(--st-text-faint); font-size: 12.5px; font-weight: 600; }
.sp-step__sub { color: var(--st-text-faint); font: 400 10.5px var(--st-font-mono); }

.sp-step[data-state='done'] .sp-step__marker { outline-color: color-mix(in srgb, var(--st-ok-strong) 50%, transparent); background: color-mix(in srgb, var(--st-ok-strong) 15%, transparent); }
.sp-step[data-state='done'] .sp-step__check { display: block; color: var(--st-ok); }
.sp-step[data-state='done'] .sp-step__line { background: color-mix(in srgb, var(--st-ok-strong) 40%, transparent); }
.sp-step[data-state='done'] .sp-step__sub { color: var(--st-ok); }

.sp-step[data-state='current'] .sp-step__marker { outline-color: var(--st-accent); background: color-mix(in srgb, var(--st-accent) 12.5%, transparent); }
.sp-step[data-state='current'] .sp-step__spinner { display: block; color: var(--st-accent-ink); }
.sp-step[data-state='current'] .sp-step__sub { color: var(--st-accent-ink); }

.sp-step[data-state='failed'] .sp-step__marker { outline-color: var(--st-error); background: color-mix(in srgb, var(--st-error) 15%, transparent); }
.sp-step[data-state='failed'] .sp-step__x { display: block; color: var(--st-error-ink); }
.sp-step[data-state='failed'] .sp-step__sub,
.sp-step[data-state='failed'] .sp-step__title { color: var(--st-error-ink); }

.sp-step:is([data-state='done'], [data-state='current']) .sp-step__title { color: var(--st-text); }
/* An upload's chord request failed alone: Retry under the step (decision 41). */
.sp-step__retry { align-self: flex-start; }
.sp-step__retry[hidden] { display: none; }
.sp-step:not([data-state='todo']) .sp-step__number { display: none; }

/* Stems */

.sp-card__stems { display: flex; flex-direction: column; gap: 6px; }
.sp-card__stems-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4px; }
.sp-card__stems-title {
  margin: 0;
  color: var(--st-text-faint);
  font: 400 10px var(--st-font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.sp-card__stems-note { margin: 0; color: var(--st-text-faint); font-size: 11.5px; }
.sp-card__stem-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }

.sp-stem {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  outline: 1px solid var(--st-line);
  outline-offset: -0.5px;
  background: var(--st-panel);
}
.sp-stem__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--stem-color) 12%, transparent);
  color: var(--stem-color);
}
.sp-stem__icon .st-icon { width: 14px; height: 14px; }
.sp-stem__name { flex: none; width: 90px; color: var(--st-text); font-size: 13px; font-weight: 500; }
.sp-stem__bar {
  display: flex;
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--stem-color) 15%, transparent);
  overflow: hidden;
}
.sp-stem__fill { height: 100%; border-radius: 3px; background: var(--stem-color); transition: width 0.25s linear; }
.sp-stem__pct {
  flex: none;
  width: 36px;
  color: var(--stem-color);
  font: 400 11px var(--st-font-mono);
  text-align: right;
}
.sp-stem__status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  gap: 5px;
  width: 72px;
  height: 26px;
  color: var(--st-text-faint);
  font-size: 11.5px;
}
.sp-stem__spinner { width: 13px; height: 13px; color: var(--stem-color); }
.sp-stem__missing { flex: 1; color: var(--st-text-faint); font-size: 12px; }

.sp-stem__preview {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  outline: 1px solid color-mix(in srgb, var(--stem-color) 40%, transparent);
  outline-offset: -0.5px;
  background: color-mix(in srgb, var(--stem-color) 12%, transparent);
  color: var(--st-text);
  font: 500 11.5px var(--st-font);
  cursor: pointer;
}
.sp-stem__preview:hover { outline-color: var(--stem-color); }
.sp-stem__preview .st-icon { width: 11px; height: 11px; color: var(--stem-color); }
.sp-stem__preview .sp-stem__stop,
.sp-stem__preview[aria-pressed='true'] .sp-stem__play { display: none; }
.sp-stem__preview[aria-pressed='true'] .sp-stem__stop { display: block; }

.st-btn.sp-stem__add {
  height: 26px;
  padding: 0 9px;
  gap: 5px;
  outline-color: var(--st-line-strong);
  color: var(--st-text-dim);
  font-size: 11.5px;
  font-weight: 400;
}
.st-btn.sp-stem__add .st-icon { width: 12px; height: 12px; }

/* What each row shows, by state */
.sp-stem__missing,
.sp-stem__pct,
.sp-stem__status,
.sp-stem__preview,
.sp-stem__add { display: none; }
.sp-stem[data-state='not-extracted'] .sp-stem__bar { display: none; }
.sp-stem[data-state='not-extracted'] .sp-stem__missing { display: block; }
.sp-stem[data-state='not-extracted'] .sp-stem__add { display: inline-flex; }
.sp-stem:not([data-state='not-extracted']) .sp-stem__pct { display: block; }
.sp-stem:is([data-state='working'], [data-state='queued'], [data-state='failed']) .sp-stem__status { display: flex; }
.sp-stem[data-state='done'] .sp-stem__preview { display: inline-flex; }
.sp-stem[data-state='done'] .sp-stem__pct { color: var(--st-text-dim); }
.sp-stem:is([data-state='queued'], [data-state='failed']) .sp-stem__spinner { display: none; }
.sp-stem[data-state='failed'] .sp-stem__status { color: var(--st-error-ink); }
.sp-stem[data-state='failed'] { outline-color: color-mix(in srgb, var(--st-error) 40%, transparent); }

/* The design dims the whole row to 60%; the text stays at full strength in
   the faint colour so it keeps 4.5:1, and only the frame and icon dim. */
.sp-stem[data-state='not-extracted'] { outline-color: color-mix(in srgb, var(--st-line) 60%, transparent); background: none; }
.sp-stem[data-state='not-extracted'] .sp-stem__icon { opacity: 0.6; background: var(--st-surface-2); color: var(--st-text-faint); }
.sp-stem[data-state='not-extracted'] .sp-stem__name { color: var(--st-text-faint); }
.st-btn.sp-stem__add { outline-color: color-mix(in srgb, var(--st-line-strong) 60%, transparent); color: var(--st-text-faint); }

/* Footer */

.sp-card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--st-line);
}
.sp-card__bell { width: 14px; height: 14px; color: var(--st-text-faint); }
.sp-card__leave { flex: 1; margin: 0; color: var(--st-text-dim); font-size: 12.5px; }
.sp-card__when { display: flex; align-items: center; gap: 8px; color: var(--st-text-dim); font-size: 12px; cursor: pointer; }
.sp-card__audio { display: none; }

/* ---- Drop target ---------------------------------------------------------------------- */

.sp-drop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--st-bg) 80%, transparent);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.sp-drop__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(560px, 100%);
  padding: 56px 24px;
  border: 2px dashed var(--st-accent);
  border-radius: var(--st-radius-hero);
  background: color-mix(in srgb, var(--st-accent) 6%, transparent);
}
.sp-drop__icon { width: 28px; height: 28px; color: var(--st-accent); }
.sp-drop__title { margin: 0; color: var(--st-text); font-size: 22px; font-weight: 600; }
.sp-drop__sub { margin: 0; color: var(--st-text-dim); font-size: 13px; }

/* ---- Keyboard focus ---------------------------------------------------------------------

   These controls draw their borders with outline, so each needs its ring
   stated here, at a specificity above its pressed and hover rules. */

.sp-upload:focus-visible,
.sp-split:focus-visible,
.sp-chip:focus-visible,
.sp-chip[data-stem][aria-pressed]:focus-visible,
.sp-extract.is-locked .sp-chip:focus-visible,
.sp-stem__preview:focus-visible,
.st-btn.sp-stem__add:focus-visible,
.st-btn.sp-card__cancel:focus-visible,
.sp-example:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }

/* ---- Narrower windows -------------------------------------------------------------------

   The top bar gives up the Extract chips first (the first-time page and the
   card still choose stems), then the Upload and Split stems labels. */

@container sp-top (max-width: 1040px) {
  .sp-extract--bar { display: none; }
}

@container sp-top (max-width: 520px) {
  .sp-link--bar .sp-upload__label,
  .sp-split--bar .sp-split__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sp-link--bar { padding-left: 10px; gap: 8px; }
  .sp-link--bar .sp-upload { padding: 0 7px; }
  .sp-split--bar,
  .sp-split.is-busy { padding: 0 12px; }
}

.sp-center { container: sp-center / inline-size; }

@container sp-center (max-width: 700px) {
  .sp-hero { padding: 28px 20px 24px; }
  .sp-examples__head { flex-wrap: wrap; }
  .sp-examples__cards { flex-wrap: wrap; }
  .sp-example { flex-basis: 220px; }
  .sp-features { flex-wrap: wrap; gap: 16px 0; }
  .sp-feature { flex-basis: 160px; }
  .sp-card { padding: 20px; }
  .sp-card__steps { flex-wrap: wrap; gap: 12px 0; }
  .sp-step { flex-basis: 100px; }
}

@container sp-center (max-width: 480px) {
  .sp-link--hero .sp-upload__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sp-link--hero .sp-upload { padding: 0 10px; }
  .sp-wave { max-width: 100%; overflow: hidden; }
  .sp-card__song { flex-wrap: wrap; }
  .sp-stem { gap: 8px; }
  .sp-stem__name { flex: 1; width: auto; min-width: 0; }
  .sp-stem[data-state] .sp-stem__bar,
  .sp-stem[data-state] .sp-stem__missing { display: none; }
}
