/* ══════════ Вкладка «Дорожки» (stems.js) ══════════
   Общая волна того, что звучит (перемотка), и дорожки компактными строками. Главное на экране — волны. */
.stm { display: flex; flex-direction: column; gap: 12px; white-space: normal; color: var(--fg); font-size: 13px; line-height: 1.35; }
.stm .pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.stm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stm-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stm-t b { font-size: 16px; }
.stm-t span { font-size: 12.5px; color: var(--muted); }
.stm-get { height: 36px; padding: 0 14px; flex-shrink: 0; }

/* переключатель раскладок: «Музыка и вокал» / «Все дорожки» */
.stm-kinds { display: flex; padding: 3px; gap: 2px; border-radius: 100px; background: var(--panel); border: 1px solid var(--line); }
:where([data-theme="light"]) .stm-kinds { background: var(--seg-track); border-color: transparent; } /* светлая */
.stm-kinds button { flex: 1; height: 34px; border: 0; border-radius: 100px; background: transparent; color: var(--fg2); font: inherit; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.stm-kinds button:hover:not(:disabled) { color: var(--fg); }
.stm-kinds button[aria-selected=true] { background: #3a3a3e; color: var(--fg); }
:where([data-theme="light"]) .stm-kinds button[aria-selected=true] { box-shadow: var(--seg-shadow); } /* светлая */
:where([data-theme="light"]) .stm-kinds button[aria-selected=true] { background-color: var(--seg-soft); } /* светлая */
.stm-kinds button:disabled { color: var(--muted); }
.stm-kinds .vw-spin { width: 14px; height: 14px; border-width: 2px; }

/* после «Музыка и вокал» — разделить на все инструменты */
.stm-up { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.stm-up > div { flex: 1; min-width: 0; }
.stm-up b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.stm-up small { display: block; font-size: 12px; line-height: 1.4; color: var(--fg2); }
.stm-up .cf-create { width: auto; height: 38px; padding: 0 14px; font-size: 13px; font-weight: 600; flex-shrink: 0; white-space: nowrap; }

/* общий плеер */
.stm-tr { display: flex; align-items: center; gap: 12px; }
.stm-play { width: 48px; height: 48px; border-radius: 50%; border: 0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--grad); box-shadow: 0 8px 22px rgba(224,69,123,.32); transition: transform .12s; }
.stm-play:active { transform: scale(.94); }
.stm-play .i:last-child, .stm-play.on .i:first-child { display: none; }
.stm-play.on .i:last-child { display: block; }
.stm-play.wait { opacity: .6; }
.stm-pos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stm-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stm-time b { font-size: 20px; color: var(--fg); }
.stm-hint { font-size: 12px; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stm-reset { flex-shrink: 0; }

/* волны: общая (узко) и у каждой дорожки (широко) */
.stm-mix, .stm-w { position: relative; cursor: pointer; touch-action: none; }
.stm-mix { height: 52px; border-radius: 12px; background: color-mix(in srgb, var(--shade) 28%, transparent); }
.stm-mix canvas, .stm-w canvas { position: absolute; left: 0; top: 0; display: block; }
.stm-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; overflow: hidden; pointer-events: none; }
.stm-fill::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: var(--fg); box-shadow: 0 0 6px color-mix(in srgb, var(--fg) 70%, transparent); }

/* дорожки — компактные строки: иконка, название, волна, «только эта», «без звука» */
.stm-lanes { display: flex; flex-direction: column; gap: 4px; }
.stm-row { display: grid; grid-template-columns: 30px minmax(64px, 96px) minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 46px; padding: 0 4px 0 8px; border-radius: 12px; background: var(--panel); transition: background .15s; }
.stm-row:hover { background: #1b1b1e; }
:where([data-theme="light"]) .stm-row:hover { background-color: var(--hover); } /* светлая */
.stm-row .stm-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #252528; }
:where([data-theme="light"]) .stm-row .stm-ic { background-color: color-mix(in srgb, var(--fg) 7%, var(--card)); } /* светлая */
.stm-n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stm-w { height: 30px; order: 3; }
.stm-btns { display: flex; gap: 0; order: 4; }
.stm-b { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--fg2); transition: background .15s, color .15s; }
.stm-b:hover { background: #2c2c30; color: var(--fg); }
:where([data-theme="light"]) .stm-b:hover { background-color: var(--hover); } /* светлая */
.stm-b[data-stsolo].on { background: var(--grad); color: #fff; }
.stm-b[data-stmute].on { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.stm-row.off .stm-w, .stm-row.off .stm-n, .stm-row.off .stm-ic { opacity: .32; }
.stm-row.quiet:not(.off) .stm-n, .stm-row.quiet:not(.off) .stm-w { opacity: .55; }
.stm-row.quiet .stm-ic { background: transparent; border: 1px dashed var(--line2); }
.stm-b:focus-visible, .stm-play:focus-visible { outline: 2px solid #E0457B; outline-offset: 2px; }

/* широко (страница трека, широкая панель): названия шире, волна выше, общая волна не нужна — у каждой дорожки своя */
@container (min-width: 600px) {
  .stm-row { grid-template-columns: 32px 150px minmax(0, 1fr) auto; height: 52px; padding: 0 6px 0 10px; }
  .stm-w { height: 36px; }
  .stm-n { font-size: 14px; }
  .stm-mix { display: none; }
}

/* разделяем… */
.stm-wait { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.stm-wait .vw-spin { width: 34px; height: 34px; flex-shrink: 0; }
.stm-wait b { display: block; font-size: 14px; margin-bottom: 3px; }
.stm-wait small { display: block; font-size: 12.5px; line-height: 1.45; color: var(--fg2); }
.stm-skel .stm-row { pointer-events: none; }
.stm-skel .stm-ic, .stm-skel .stm-n, .stm-skel .stm-w { border-radius: 8px; background: linear-gradient(90deg, #202023 0%, #2b2b2f 50%, #202023 100%); background-size: 200% 100%; animation: stm-sk 1.4s linear infinite; }
:where([data-theme="light"]) .stm-skel .stm-ic, :where([data-theme="light"]) .stm-skel .stm-n, :where([data-theme="light"]) .stm-skel .stm-w { background-image: linear-gradient(90deg, var(--line) 0%, var(--hover) 50%, var(--line) 100%); } /* светлая */
.stm-skel .stm-n { height: 12px; }
.stm-skel .stm-w { height: 22px; }
@keyframes stm-sk { to { background-position: -200% 0; } }

/* окно «Скачать дорожки» */
.smodal.stm-dlwrap .ssheet { width: 560px; max-height: calc(100dvh - 32px); overflow: auto; }
.stm-dlm { display: flex; flex-direction: column; gap: 12px; }
.stm-dlh { display: flex; align-items: center; justify-content: space-between; }
.stm-zip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; font-weight: 600; }
.stm-dll { display: flex; flex-direction: column; }
.stm-dlr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.stm-dlr .stm-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #29292c; flex-shrink: 0; }
:where([data-theme="light"]) .stm-dlr .stm-ic { background-color: color-mix(in srgb, var(--fg) 7%, var(--card)); } /* светлая */
.stm-dlr .stm-n { flex: 1; min-width: 0; font-size: 13.5px; }
.stm-dlr .stm-n small { margin-left: 8px; font-size: 12px; color: var(--muted); } /* «тишина» — подписью, а не впритык к названию */
.stm-fm { display: flex; gap: 4px; flex-shrink: 0; }
.stm-fm .pill { height: 30px; padding: 0 10px; font-size: 12px; }
.stm-dln { color: var(--muted); font-size: 12px; line-height: 1.45; }
@media (max-width: 560px) {
  .stm-dlr { flex-wrap: wrap; }
  .stm-fm { width: 100%; padding-left: 40px; }
  .stm-fm .pill { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .stm-skel .stm-ic, .stm-skel .stm-n, .stm-skel .stm-w { animation: none; } }

/* окно «Ноты» (notes.js): нотный стан партии, печать/PDF */
.smodal.vnt-wrap .ssheet { width: 900px; max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow: auto; }
.vnt-m { display: flex; flex-direction: column; gap: 10px; }
.vnt-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vnt-h small { color: var(--muted); display: block; margin-top: 2px; font-size: 12px; }
.vnt-ha { display: inline-flex; gap: 8px; flex-shrink: 0; }
.vnt-staff { display: flex; flex-direction: column; gap: 2px; }
.vnt-row { display: flex; gap: 8px; }
.vnt-bar { position: relative; flex: 1; min-width: 0; }
.vnt-bar i { position: absolute; top: 0; left: 2px; font-style: normal; font-size: 10px; color: var(--muted); }
.vnt-bar canvas { display: block; width: 100%; }
@media print {
  body.vnt-printing > *:not(.smodal) { display: none !important; }
  body.vnt-printing .smodal.vnt-wrap { position: static; }
  body.vnt-printing .smodal.vnt-wrap .ssheet { width: auto; max-width: none; max-height: none; overflow: visible; box-shadow: none; background: #fff; }
  body.vnt-printing .vnt-ha { display: none; }
  body.vnt-printing .vnt-h b, body.vnt-printing .vnt-h small { color: #000; }
  body.vnt-printing .vnt-bar i { color: #666; }
}

/* «Все дорожки одним архивом» — под списком и всегда видна внизу окна; полоса цвета окна прячет строки под кнопкой */
.stm-dlm .stm-zip { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 0 0 14px var(--card); } /* фон окна .ssheet — var(--card) */
