:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --panel-2: #181818;
  --line: #888888;
  --text: #ffffff;
  --muted: #b3b3b3;
  --accent: #1db954;
}

* { box-sizing: border-box; }
html {
  overflow-x: hidden;
  overflow-y: scroll;
  max-width: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 30% 0%, #1a3326 0%, var(--bg) 60%);
  height: 100vh;
  overflow-x: hidden;
  overflow-y: scroll;
  max-width: 100%;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

.app-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 100vh;
  overflow: visible;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
.panel {
  background: linear-gradient(180deg, #282828 0%, var(--panel-2) 100%);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.06);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  min-width: 0;
  max-width: 100%;
}
.brand {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.top-nav {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.nav-btn, .primary-btn, .secondary-btn, .control {
  border: 2px solid #a0a0a0; color: #ffffff; background: #282828;
  border-radius: 6px; padding: 7px 12px; cursor: pointer;
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.nav-btn:focus, .primary-btn:focus, .secondary-btn:focus, .control:focus {
  outline: none;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}
.nav-btn.active, .primary-btn { background: linear-gradient(#1db954, #158a3e); border-color: #1ed760; }
.control.control--transport-active {
  background: linear-gradient(#1db954, #158a3e);
  border-color: #1ed760;
}
.nav-btn--reserved {
  cursor: pointer;
}
.nav-btn--reserved.active {
  border-style: solid;
}
.nav-btn__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.nav-btn.active .nav-btn__num {
  background: rgba(255,255,255,0.30);
}
.primary-btn { font-weight: 700; }

.workspace {
  display: grid;
  grid-template-columns: clamp(260px, 26vw, 335px) minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 600px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.workspace.workspace--editing,
.workspace.workspace--tracks {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}
.workspace.workspace--editing .center-column,
.workspace.workspace--tracks .center-column {
  display: contents;
}
.workspace.workspace--editing .left-column,
.workspace.workspace--tracks .left-column {
  grid-column: 1;
  grid-row: 1;
}
.workspace.workspace--editing .preview,
.workspace.workspace--tracks .preview {
  grid-column: 2;
  grid-row: 1;
}
.workspace.workspace--editing .stems,
.workspace.workspace--tracks .stems {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
}
.left-column {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
}
.left-column.left-column--editing-match {
  align-self: start;
  overflow-y: auto;
}
.left-panel-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
}
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.left-card--lyrics {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.lyrics-editor-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  margin: 0 0 10px 0;
}
.lyrics-editor {
  width: 100%;
  flex: 1;
  min-height: 220px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(18, 18, 18, 0.85);
  border: 1px solid #909090;
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
}
.lyrics-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-family: inherit;
  white-space: pre-wrap;
  pointer-events: none;
  overflow: hidden;
  border-radius: 8px;
}
#lyrics-editor:focus ~ .lyrics-placeholder { display: none; }
.lyrics-editor:focus {
  outline: none;
  border-color: #5a8fd4;
  box-shadow: 0 0 0 1px rgba(90, 143, 212, 0.35);
}
.left-card h3 { margin: 0 0 8px; font-size: 18px; }
.left-card--split {
  min-height: 158px;
}
.left-card--media {
  margin-top: 0;
}
.left-card-media-resolution-hint {
  margin: 10px 0 10px;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}
.sync-lyrics-status.sync-lyrics-status--ok {
  color: #8fd4a8;
}
.sync-lyrics-status.sync-lyrics-status--err {
  color: #f0a0a8;
}
.muted { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

.dropzone {
  border: 1px dashed #949494; border-radius: 8px; padding: 14px; text-align: center;
  background: rgba(18, 18, 18, 0.65); display: grid; gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dropzone--over {
  border-color: #5a8fd4;
  background: rgba(20, 40, 80, 0.65);
}
.dropzone-hint {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}
.dropzone span { color: var(--muted); font-size: 12px; }
.dropzone span.dropzone-picked-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.35;
}
.dropzone span.dropzone-picked-name.dropzone-picked-name--warn {
  color: #e07070;
}
.stem-list { display: grid; gap: 8px; margin-top: 10px; }
.stem-row { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.split-btn {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  z-index: 0;
  min-height: 36px;
}
.split-btn.progress::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--split-progress, 0%);
  background: linear-gradient(90deg, #1db954, #158a3e);
  z-index: -1;
  transition: width 0.25s linear;
}
.split-btn.progress {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background: #282828;
  border-color: #7eb6ff;
}

/* Бледно-красный мерцающий бордер (подсказка «нажми») */
@keyframes split-btn-pulse-hint {
  0% {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.5),
      0 0 18px rgba(255, 255, 255, 0.35);
  }
  50% {
    border-color: rgba(255, 30, 30, 1);
    box-shadow:
      0 0 0 3px rgba(255, 20, 20, 0.6),
      0 0 18px rgba(220, 0, 0, 0.5);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.5),
      0 0 18px rgba(255, 255, 255, 0.35);
  }
}

button.split-btn.split-btn--pulse-hint:not(:disabled):not(.progress) {
  /* border-width stays at 1px – 2px would cause 1px layout shift */
  animation: split-btn-pulse-hint 0.8s ease-in-out infinite;
}

button.export-save-btn.split-btn--pulse-hint:not(:disabled):not(.progress) {
  animation: split-btn-pulse-hint 0.8s ease-in-out infinite;
}

.split-queue-msg {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.35);
  border-radius: 6px;
  color: #f5c842;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  animation: split-queue-fadein 0.3s ease;
}

@keyframes split-queue-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.editing-mode-btn {
  width: 100%;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.editing-mode-btn.editing-mode-btn--active {
  background: linear-gradient(145deg, #1a4a9e 0%, #3b6fd4 45%, #1a4a9e 100%);
  border-color: #7eb6ff;
  box-shadow:
    0 0 0 2px rgba(100, 170, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
}
.editing-mode-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
}
.editing-mode-btn.editing-mode-btn--active:disabled {
  opacity: 0.45;
}

.hidden {
  display: none !important;
}
[hidden] {
  display: none !important;
}
.mini-wave, .track-wave, .global-wave, .progress {
  height: 12px; border-radius: 10px; border: 1px solid #909090;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px);
}
.yellow { background-color: #1db954; }
.blue { background-color: #3b6fd4; }
.green { background-color: #46d07b; }
.red { background-color: #dd5d5d; }

.center-column {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  max-width: 100%;
}
.center-column.center-column--editing {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  min-height: 0;
}
.timeline { padding: 8px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.global-wave { height: 18px; background-color: #1e1e1e; }

.preview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(8px, 1.2vw, 12px);
  padding: 6px;
  padding-bottom: 11px;
  justify-content: stretch;
  align-items: stretch;
  align-self: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
}
.video-pane { position: relative; border: 1px solid #909090; overflow: hidden; border-radius: 6px; height: 100%; }
.player-pane {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  padding: 8px;
  background: #181818;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: min(720px, 100%);
  box-sizing: border-box;
  justify-self: start;
}
.player-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  border: 1px solid #909090;
  border-radius: 6px;
  overflow: hidden;
  align-self: start;
  justify-self: stretch;
}
.player-frame.media-preview-muted .preview-layer {
  opacity: 0 !important;
  pointer-events: none;
}
.preview-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-color: #000;
}
.preview-layer-b {
  z-index: 3;
}
/* mix-blend-mode убран: нижний слой всегда opacity=1.0,
   верхний фейдится – CSS normal compositing даёт корректный dissolve */
.preview-layer-b.preview-layer-b--photoblend {
  mix-blend-mode: normal;
}
.player-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.player-video.player-video--on {
  opacity: 1;
  pointer-events: auto;
}
.player-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  pointer-events: none;
}
.player-photo.player-photo--on {
  display: block;
  pointer-events: auto;
  object-fit: cover;
  object-position: center;
  min-width: 100%;
  min-height: 100%;
}
.player-photo.media-hidden {
  opacity: 0;
}
.player-controls {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  min-width: 0;
  box-sizing: border-box;
  border-color: #121212;
  background: #121212;
}
.player-controls input[type="range"] {
  width: calc(100% - 12px);
  max-width: calc(100% - 12px);
  min-width: 0;
  box-sizing: border-box;
  margin: 0 6px;
}
.right-pane {
  min-height: 100%;
  min-width: 0;
}
.right-pane--split {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 0;
}
.ad-pane {
  display: grid;
  place-items: center;
  background: #121212;
}
.ad-pane--top {
  flex: 1 1 0;
  min-height: 0;
}
.ad-wrap {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}
.ad-slot {
  border: 1px dashed #121212;
  border-radius: 6px;
  background: #121212;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-rotator-block {
  width: 100%;
  height: 100%;
}
/* Ограничение баннеров Яндекса размером контейнера */
.ad-rotator-block > div,
.ad-rotator-block > iframe {
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}
/* ── Панель позиции курсора ─────────────────────────────────── */
.cursor-time-pane {
  flex: 0 0 auto;
  height: 70px;
  background: linear-gradient(180deg, #282828 0%, #1e1e1e 100%);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
}
.cursor-tool-btn--wide {
  white-space: nowrap;
  font-size: 11px;
}
.cursor-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cursor-tool-btn {
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1;
  min-width: 34px;
  text-align: center;
}
.cursor-tool-btn--active {
  background: linear-gradient(#1db954, #158a3e);
  border-color: #1ed760;
}
.cursor-tool-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed !important;
  pointer-events: none;
}
.cursor-time-display {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #e9f1ff);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 20%, #ffc77b 0%, #a45f3a 20%, #1e1e1e 65%, #121212 100%);
}
/* Цвет фона из вкладки «Текст» – только в режимах Текст/Редактирование без клипов */
#live-player-frame.live-player-frame--text-tab-preview:not(.has-timeline-media) .stage-bg,
#live-player-frame.live-player-frame--editing-preview:not(.has-timeline-media) .stage-bg {
  background: var(--preview-bg-color, #000000);
}
/* При скрытом Видео/Фото – тоже цвет фона */
#live-player-frame.media-preview-muted .stage-bg {
  background: var(--preview-bg-color, #000000);
}
/* Непрозрачный чёрный под клипами: при фейде не просвечивает градиент stage-bg */
.preview-media-matte {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.player-frame.has-timeline-media .preview-media-matte {
  opacity: 1;
}
/* Когда Видео/Фото скрыто – прячем чёрный матте, показываем выбранный цвет фона */
.player-frame.media-preview-muted .preview-media-matte {
  opacity: 0 !important;
}
.lyrics {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 8px;
  box-sizing: border-box;
  text-align: center;
  font-weight: 800;
  font-family: var(--preview-lyrics-font, "Segoe UI", Arial, sans-serif);
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lyrics:empty {
  display: none;
}
.player-frame.has-timeline-media .lyrics,
.player-frame.has-timeline-audio .lyrics {
  opacity: 0;
  visibility: hidden;
}
/* Вкладка «Текст»: демо поверх превью, даже при загруженных треках/медиа на «Треки». */
#live-player-frame.live-player-frame--text-tab-preview.has-timeline-media .lyrics,
#live-player-frame.live-player-frame--text-tab-preview.has-timeline-audio .lyrics,
#live-player-frame.live-player-frame--editing-preview.has-timeline-media .lyrics,
#live-player-frame.live-player-frame--editing-preview.has-timeline-audio .lyrics {
  opacity: 1;
  visibility: visible;
}
.lyrics-line {
  margin: 0;
  max-width: 92%;
  justify-self: center;
  font-size: var(--preview-lyrics-size, 24px);
  line-height: 1.35;
}
.lyrics-line--karaoke {
  font-size: var(--preview-lyrics-size, 24px);
}
.lyrics-line--karaoke .lyrics-line__outer {
  position: relative;
  display: inline-block;
  max-width: 100%;
  text-align: center;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}
.lyrics-line--karaoke .lyrics-line__base {
  position: relative;
  z-index: 0;
  color: var(--preview-lyrics-base, #ffffff);
  -webkit-text-stroke: var(--preview-lyrics-outline-width, 2px) var(--preview-lyrics-outline, #000000);
  paint-order: stroke fill;
}
.lyrics-line--karaoke .lyrics-line__fill-wrap {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.lyrics-line--karaoke .lyrics-line__fill {
  display: inline-block;
  color: var(--preview-lyrics-fill, #00ff00);
  -webkit-text-stroke: var(--preview-lyrics-outline-width, 2px) var(--preview-lyrics-outline, #000000);
  paint-order: stroke fill;
  white-space: nowrap;
}
/* Демо на «Текст»: строки на всю ширину окна превью (с небольшим внутренним полем). */
#live-player-frame.live-player-frame--text-tab-preview .lyrics,
#live-player-frame.live-player-frame--editing-preview .lyrics {
  z-index: 10;
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  place-content: end center;
  padding: 0 clamp(6px, 3%, 20px) 40px;
  justify-items: stretch;
  gap: 4px;
}
/* Полоса под текстом: во всех режимах превью (настройки – вкладка «Текст»). */
#live-player-frame .lyrics::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - (40px + (var(--preview-lyrics-size, 24px) * 1.12) + 2px));
  transform: translateY(-50%);
  height: calc((var(--preview-lyrics-size, 24px) * 2.25 + 10px) * var(--preview-lyrics-stripe-height-scale, 1));
  background: var(--preview-lyrics-stripe-color, #a0a0a0);
  opacity: var(--preview-lyrics-stripe-opacity, 0.55);
  border-radius: 0;
  z-index: 0;
  pointer-events: none;
}
#live-player-frame .lyrics-line {
  position: relative;
  z-index: 1;
}
#live-player-frame.live-player-frame--text-tab-preview .lyrics-line--text-tab-demo-slot,
#live-player-frame.live-player-frame--editing-preview .lyrics-line--text-tab-demo-slot {
  opacity: 0;
}
#live-player-frame.live-player-frame--text-tab-preview .lyrics-line--text-tab-demo,
#live-player-frame.live-player-frame--editing-preview .lyrics-line--text-tab-demo {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  box-sizing: border-box;
  line-height: 1.12;
}
#live-player-frame.live-player-frame--text-tab-preview .lyrics-line--text-tab-demo .lyrics-line__outer,
#live-player-frame.live-player-frame--editing-preview .lyrics-line--text-tab-demo .lyrics-line__outer {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
#live-player-frame.live-player-frame--text-tab-preview .lyrics-line--text-tab-demo .lyrics-line__fill,
#live-player-frame.live-player-frame--editing-preview .lyrics-line--text-tab-demo .lyrics-line__fill {
  white-space: normal;
  max-width: 100%;
}
/* Плавная закраска демо на «Текст»: clip-path + rAF в app.js (анимация width на abspos часто не даёт эффекта). */
/* Закраска в превью только на вкладке «Текст»; на «Треки» слой закраски скрыт. */
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics-line__fill-wrap {
  display: none !important;
  animation: none !important;
}
.lyrics .lyrics-line:first-of-type .lyrics-line__outer {
  white-space: nowrap;
  max-width: 100%;
  padding: 0 6px;
  box-sizing: border-box;
}
/* Вкладка «Треки» / экспорт: полоса как на «Текст»; блок строк центрируется по вертикали на полосе (::before). */
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 0 clamp(6px, 3%, 20px) 40px;
}
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics-tracks-billboard {
  position: absolute;
  left: clamp(6px, 3%, 20px);
  right: clamp(6px, 3%, 20px);
  top: calc(100% - (40px + (var(--preview-lyrics-size, 24px) * 1.12) + 2px));
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 1;
}
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics-tracks-billboard .lyrics-line {
  line-height: 1.12;
}
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview)
  .lyrics-tracks-billboard
  .lyrics-line:first-of-type
  .lyrics-line__outer {
  white-space: normal;
}
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics .lyrics-line {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}
#live-player-frame:not(.live-player-frame--text-tab-preview):not(.live-player-frame--editing-preview) .lyrics .lyrics-line .lyrics-line__outer {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  box-sizing: border-box;
}
.line { font-size: 24px; color: #fff; }
.line.active { color: #ffe84e; }

.transport {
  padding: 2px 6px !important;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  align-items: center;
  min-height: 0;
  height: auto;
  border-radius: 4px;
  box-shadow: none;
  overflow: visible;
}
.time { color: #ffffff; font-size: 13px; line-height: normal; }
.progress { height: 8px; background-color: #282828; }
.transport .control,
.transport .time,
.transport .progress {
  margin: 0;
}

.stems {
  padding: 6px;
  display: grid;
  gap: 8px;
  border-radius: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.stems.stems--editing,
.stems.stems--tracks {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: none;
  padding: 6px;
}
.center-panel-tracks {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.track-add-btn {
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
  height: 24px;
  min-width: 28px;
  flex-shrink: 0;
}

/* Track lanes – same visual style as editing-lane */
.tl-lane {
  border: 1px solid #909090;
  border-radius: 6px;
  background: #222222;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.tl-lane__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 3px;
  border-bottom: 1px solid #909090;
  flex-shrink: 0;
}
.tl-lane__title {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 4px;
}
.tl-lane__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.tl-lane__add-btn {
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
  min-width: 28px;
  height: 24px;
}
.tl-lane__wave {
  width: 100%;
  flex: 1;
  min-height: 40px;
  display: block;
  background: transparent;
}
.tl-lane--media .tl-lane__media {
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* Left panel in Треки – align to top, no vertical stretch */
.left-panel--tracks {
  flex: 0 0 auto;
  align-self: start;
}
.center-panel-placeholder {
  min-height: 120px;
  border: 2px solid #909090;
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(18, 18, 18, 0.65);
}
.center-panel-export {
  min-height: 120px;
  border: 2px solid #909090;
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(18, 18, 18, 0.65);
  display: grid;
  gap: 10px;
  align-content: start;
}
.export-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
}
.export-toolbar .split-btn {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.export-save-btn {
  min-height: 36px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.export-save-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.export-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.left-panel--export .export-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.left-panel--export .export-option-row input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: #2f7dff;
}
.center-panel-placeholder--editing {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 6px;
}
.center-panel-placeholder--editing .muted {
  margin: 0;
}
.editing-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
}
.editing-zoom-btn {
  width: 34px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  font-weight: 700;
  line-height: 1;
}
.editing-zoom-label {
  font-size: 13px;
  color: #b3b3b3;
  font-weight: 600;
}
.editing-lanes-scroll {
  min-height: 0;
  height: 100%;
  overflow-x: scroll; /* нативный скролл тачпадом/трекпадом */
  overflow-y: hidden;
  border: 2px dashed #121212;
  border-radius: 6px;
  background: #1a1a1a;
  max-width: 100%;
  scrollbar-width: none;       /* Firefox: скрываем системный скроллбар */
  -webkit-overflow-scrolling: touch; /* плавный инерционный скролл на macOS/iOS */
}
.editing-lanes-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari: скрываем системный скроллбар */
}
.editing-bottom-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.editing-scroll-bar {
  flex: 1 1 auto;
  min-width: 0;
  height: 22px;
  border: 1px solid #909090;
  border-radius: 4px;
  background: #1a1a1a;
  padding: 2px;
  position: relative;
}
.editing-scroll-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  height: 16px;
  min-width: 42px;
  border: 1px solid #909090;
  border-radius: 3px;
  background: #909090;
  cursor: grab;
  padding: 0;
  touch-action: none;
}
.editing-scroll-thumb:active {
  cursor: grabbing;
}
.editing-bottom-bar .editing-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.editing-lanes-content {
  min-height: 0;
  display: grid;
  grid-template-rows: 70px 1fr 1fr;
  height: 100%;
  gap: 4px;
  padding: 6px;
  box-sizing: border-box;
  position: relative;
}
/* CSS-курсор – обновляется через style.left в RAF (60fps), не через canvas */
.editing-cursor-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  z-index: 10;
  transform: translateX(-1px);
  will-change: left;
}
.editing-lane {
  border: 1px solid #909090;
  border-radius: 6px;
  background: #222222;
  overflow: hidden;
  position: relative;
}
.editing-lane__title {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px 3px;
}
.editing-ruler {
  display: block;
  height: 20px;
  background: #181818;
  border-bottom: 1px solid #333333;
  flex-shrink: 0;
  cursor: default;
  overflow: hidden;
}
.editing-text-track {
  height: calc(100% - 21px);
  min-height: 28px;
  position: relative;
  padding: 4px 8px 6px;
}
.editing-text-chip.chip-selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
}
.editing-rubber-band {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border: 1px dashed rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
  pointer-events: none;
  z-index: 10;
  display: none;
}
.editing-text-chip {
  position: absolute;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid #1db954;
  background: rgba(29, 185, 84, 0.15);
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  min-width: 0;
}
.editing-text-chip--word {
  padding: 0 4px;
  font-size: 11px;
  justify-content: flex-start;
}
.editing-text-chip-handle {
  position: absolute;
  top: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(29, 185, 84, 0.35);
  z-index: 2;
}
.editing-text-chip-handle--l {
  left: 0;
  border-right: 1px solid rgba(29, 185, 84, 0.4);
  border-radius: 3px 0 0 3px;
}
.editing-text-chip-handle--r {
  right: 0;
  border-left: 1px solid rgba(29, 185, 84, 0.4);
  border-radius: 0 3px 3px 0;
}
.editing-countdown-hint {
  display: none;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  flex: 1;
  padding: 0 8px;
}
.countdown-beats-spinner {
  display: none;
  flex-direction: column;
  border: 2px solid #a0a0a0;
  border-radius: 6px;
  background: #282828;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.countdown-beats-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  padding: 0 8px;
  font-size: 9px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.countdown-beats-btn:hover { background: rgba(255,255,255,0.12); }
.countdown-beats-btn:first-child { border-bottom: 1px solid #555555; }
.countdown-source {
  border-color: #7eb6ff;
  background: linear-gradient(#3b6fd4, #1a4a9e);
  letter-spacing: 2px;
  cursor: grab;
  user-select: none;
  display: none;
  justify-content: center;
  text-align: center;
}
.countdown-source:active { cursor: grabbing; opacity: 0.85; }
.editing-countdown-chip {
  position: absolute;
  height: 28px;
  top: 8px;
  border-radius: 4px;
  background: linear-gradient(#3b6fd4, #1a4a9e);
  border: 1px solid #7eb6ff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 2px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  min-width: 40px;
  z-index: 2;
}
.editing-countdown-chip.countdown-selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255,165,0,0.3);
}
.editing-countdown-chip:active { cursor: grabbing; }
.editing-countdown-chip__beat {
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  pointer-events: none;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.editing-countdown-chip__beat:last-child { border-right: none; }
.editing-vocal-wave {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  height: calc(100% - 24px);
  min-height: 40px;
  display: block;
}

/* ── Трек Видео/Фото в разделе Редактирование ──────────────────────────────── */
.editing-media-track {
  position: relative;
  height: calc(100% - 24px);
  overflow: hidden;
}
.editing-media-clip {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 4px;
  background: linear-gradient(135deg, #1e4080 0%, #2a5ca8 100%);
  border: 1px solid #3b6fd4;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  min-width: 4px;
}
.editing-media-clip--image {
  background: linear-gradient(135deg, #1e5040 0%, #2a8060 100%);
  border-color: #4ab890;
}
.editing-media-clip:active { cursor: grabbing; }
.editing-media-clip__label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.editing-media-clip-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.editing-media-clip-handle--l { left: 0; border-radius: 4px 0 0 4px; background: rgba(255,255,255,0.15); }
.editing-media-clip-handle--r { right: 0; border-radius: 0 4px 4px 0; background: rgba(255,255,255,0.15); }

.text-tab-three-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  align-content: start;
  overflow: visible;
}
.text-tab-col {
  min-height: 86px;
  min-width: 0;
  border: 1px dashed #949494;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(18, 18, 18, 0.65);
  box-sizing: border-box;
  overflow: visible;
}
.text-tab-col--style {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}
.text-tab-col--overlay {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.text-tab-col--timing {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.text-style-row.text-style-row--overlay-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}
.text-tab-col--overlay .text-style-stack-item__label {
  color: var(--text);
  font-size: 14px;
}
.text-style-row.text-style-row--timing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}
.text-tab-col--overlay .text-style-field {
  font-size: 14px;
  color: var(--text);
}
.text-tab-col--timing .text-style-field {
  font-size: 14px;
  color: var(--text);
}
.text-style-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: end;
}
.text-style-field--range .text-style-field__label {
  white-space: normal;
}
.text-style-range {
  width: 100%;
  margin: 0;
}
.text-style-number {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #909090;
  background: #1e1e1e;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.text-style-field__label--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-style-field--number {
  position: relative;
}
.text-style-number-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}
.text-style-number-unit {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}
.text-style-color-input {
  width: 100%;
  height: 32px;
  padding: 2px;
  border: 1px solid #909090;
  border-radius: 6px;
  background: #1e1e1e;
  cursor: pointer;
  box-sizing: border-box;
}
.text-style-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}
.text-style-color-input::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}
/* Подписи полей – как основной текст в подсказке дропзоны (.dropzone-hint). */
.text-tab-col--style .text-style-field,
.text-tab-col--style .text-style-stack-item {
  font-size: 14px;
  color: var(--text);
}
.text-style-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.text-style-row--font {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.text-style-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
  overflow: visible;
}
.text-style-stack-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: visible;
}
.text-style-stack-item .text-style-select {
  width: 100%;
  min-width: 0;
}
.text-style-stack-item__label {
  line-height: 1.25;
}
.text-style-stack-item--palette .color-palette {
  position: relative;
  min-width: 0;
  overflow: visible;
}
.color-palette__current {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 1px solid #909090;
  border-radius: 6px;
  background: #242424;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.color-palette__current:focus-visible {
  outline: 2px solid #5b8cff;
  outline-offset: 2px;
}
.color-palette__panel {
  position: absolute;
  bottom: calc(100% + 6px);
  top: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 20px);
  z-index: 60;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #909090;
  background: #181818;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.42);
  box-sizing: border-box;
}
.color-palette__grid {
  display: grid;
  grid-template-columns: repeat(8, 22px);
  grid-template-rows: repeat(8, 22px);
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
}
.color-palette__swatch {
  width: 22px;
  height: 22px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}
.color-palette__swatch:hover {
  filter: brightness(1.08);
}
.color-palette__swatch:focus-visible {
  outline: 2px solid #5b8cff;
  outline-offset: 1px;
}
.color-palette__swatch--selected {
  box-shadow: 0 0 0 2px #e8eef8, inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.color-palette__custom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px dashed #949494;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.color-palette__custom:hover {
  border-color: #5b8cff;
  color: var(--text);
}
.color-palette__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}
.color-palette__custom-text {
  position: relative;
  pointer-events: none;
}
.text-style-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.text-style-field__label {
  white-space: nowrap;
}
.text-style-select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #909090;
  background: #1e1e1e;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.text-style-select--narrow {
  width: 100%;
  min-width: 72px;
}
.track-block {
  min-width: 0;
  max-width: 100%;
  --track-row-head: 44px;
  --track-row-tools: 34px;
  --track-row-gap: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: var(--track-row-head) var(--track-row-tools);
  column-gap: 12px;
  row-gap: var(--track-row-gap);
  align-items: start;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
}
.track-head {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: 14px;
  height: 44px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 4px;
}
.track-toolbar {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  height: 34px;
  box-sizing: border-box;
}
.track-toolbar .mute-btn {
  align-self: center;
  flex-shrink: 0;
}
.track-block .track-wave-wrap {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}
.track-wave-wrap {
  display: flex;
  align-items: stretch;
  align-content: stretch;
  min-width: 0;
  border: 2px solid #909090;
  border-radius: 6px;
  padding: 6px 10px;
  background: rgba(18, 18, 18, 0.65);
}
.track-wave-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: block;
}
.vol-range {
  width: 120px;
  flex: 0 0 auto;
}
input[type="range"]:focus,
input[type="number"]:focus {
  outline: none;
}
.vol-num {
  width: 56px;
  height: 24px;
  border: 1px solid #909090;
  border-radius: 5px;
  background: #1e1e1e;
  color: #ffffff;
  text-align: center;
  flex: 0 0 auto;
}

/* Ползунки range в цвет кнопок-стрелок */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: #444444;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #909090;
  border: 1px solid #b0b0b0;
  margin-top: -5px;
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 4px;
  background: #444444;
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #909090;
  border: 1px solid #b0b0b0;
  cursor: pointer;
}

/* Вокал — зелёный трек + ползунок */
#vol-vocal-range::-webkit-slider-runnable-track { background: #1db954; }
#vol-vocal-range::-moz-range-track { background: #1db954; }
#vol-vocal-range::-webkit-slider-thumb {
  background: #1db954;
  border-color: #25e066;
}
#vol-vocal-range::-moz-range-thumb {
  background: #1db954;
  border-color: #25e066;
}

/* Инструментал, Медиа, Плеер — синий трек + ползунок */
#vol-instrumental-range::-webkit-slider-runnable-track,
#vol-media-range::-webkit-slider-runnable-track,
#player-progress::-webkit-slider-runnable-track { background: #3b6fd4; }
#vol-instrumental-range::-moz-range-track,
#vol-media-range::-moz-range-track,
#player-progress::-moz-range-track { background: #3b6fd4; }
#vol-instrumental-range::-webkit-slider-thumb,
#vol-media-range::-webkit-slider-thumb {
  background: #3b6fd4;
  border-color: #7eb6ff;
}
#vol-instrumental-range::-moz-range-thumb,
#vol-media-range::-moz-range-thumb {
  background: #3b6fd4;
  border-color: #7eb6ff;
}
#player-progress::-webkit-slider-thumb {
  background: #ffffff;
  border-color: #cccccc;
}
#player-progress::-moz-range-thumb {
  background: #ffffff;
  border-color: #cccccc;
}

/* Высота полосы — зелёный */
#lyrics-stripe-height-range::-webkit-slider-runnable-track { background: #1db954; }
#lyrics-stripe-height-range::-moz-range-track { background: #1db954; }
#lyrics-stripe-height-range::-webkit-slider-thumb { background: #1db954; border-color: #25e066; }
#lyrics-stripe-height-range::-moz-range-thumb { background: #1db954; border-color: #25e066; }

/* Прозрачность полосы — синий */
#lyrics-stripe-opacity-range::-webkit-slider-runnable-track { background: #3b6fd4; }
#lyrics-stripe-opacity-range::-moz-range-track { background: #3b6fd4; }
#lyrics-stripe-opacity-range::-webkit-slider-thumb { background: #3b6fd4; border-color: #7eb6ff; }
#lyrics-stripe-opacity-range::-moz-range-thumb { background: #3b6fd4; border-color: #7eb6ff; }

.track-wave { height: 14px; }
.track-media-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  cursor: default;
}
.track-wave-wrap.track-media-wrap--over {
  border-color: #5a8fd4;
  background: rgba(20, 40, 80, 0.45);
}
.track-media-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--muted);
}
.track-media-hint--overlay {
  white-space: normal;
  line-height: 1.5;
}
.track-media-name {
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-media-wrap.has-file .track-media-hint--overlay {
  display: none;
}
.track-media-wrap .media-timeline-lane {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.track-media-hint--overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
  white-space: normal;
  overflow: visible;
}
.tl-clip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 24px;
  border-radius: 4px;
  border: 1px solid #5a8fd4;
  background: rgba(30, 60, 120, 0.55);
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  user-select: none;
}
.tl-clip--selected {
  box-shadow: 0 0 0 2px rgba(110, 179, 255, 0.95);
  border-color: #9ec8ff;
  z-index: 2;
}
.tl-clip-handle {
  flex: 0 0 8px;
  cursor: ew-resize;
  background: rgba(90, 143, 212, 0.35);
  border-radius: 2px 0 0 2px;
}
.tl-clip-handle--r {
  border-radius: 0 2px 2px 0;
}
.tl-clip-body {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: grab;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.tl-clip-body--image {
  background-size: auto 100%;
  background-repeat: repeat-x;
  background-position: left center;
}
.tl-clip-body:active {
  cursor: grabbing;
}
.tl-clip-body--video {
  background: linear-gradient(165deg, #282828 0%, #121212 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.tl-clip-fade-veil {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}
.tl-clip-fade-veil--in {
  left: 0;
  width: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
}
.tl-clip-fade-veil--out {
  right: 0;
  width: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);
}
.tl-clip-fade-handle {
  position: absolute;
  top: 0;
  width: 14px;
  height: 11px;
  margin-left: -7px;
  z-index: 6;
  cursor: ew-resize;
  touch-action: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}
.tl-clip-fade-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #ff2020;
}
.tl-clip-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: rgba(15, 35, 63, 0.6);
  border: 1px solid #909090;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
}
.tl-clip-thumb--video {
  background-image: none;
}
.tl-clip-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 6px 4px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  z-index: 4;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2) 55%, transparent);
  pointer-events: none;
}
.tl-clip-name {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: #f0f4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.mute-btn {
  appearance: none;
  border: 1px solid #909090;
  background: #1e1e1e;
  border-radius: 6px;
  width: 34px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0;
  line-height: 0;
  cursor: pointer;
  position: relative;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  vertical-align: middle;
}
.mute-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* simple stable speaker glyph via inline SVG */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7'/%3E%3Cpath d='M18.5 6a9 9 0 0 1 0 12'/%3E%3C/svg%3E");
}
.mute-btn.mute-btn--media::before {
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='11' rx='1.5'/%3E%3Cpath d='M9 20h6'/%3E%3Cpath d='M12 17v3'/%3E%3C/svg%3E");
}
.mute-btn.muted {
  background: #1e1e1e;
  border-color: #ff2020;
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.mute-btn.muted::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff2020' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7'/%3E%3Cpath d='M18.5 6a9 9 0 0 1 0 12'/%3E%3C/svg%3E");
}
.mute-btn.mute-btn--media.muted::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff2020' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='11' rx='1.5'/%3E%3Cpath d='M9 20h6'/%3E%3Cpath d='M12 17v3'/%3E%3C/svg%3E");
}
.mute-btn:focus {
  outline: none;
}
.mute-btn:focus-visible {
  outline: 2px solid #5a8fd4;
  outline-offset: 2px;
}
.silver { background-color: #d4dcf0; }
.cyan { background-color: #66b5ff; }
.lime { background-color: #88dd5b; }
.coral { background-color: #f07c6a; }

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; }
  .workspace { grid-template-columns: 1fr; }
  .workspace.workspace--editing .center-column { display: grid; }
  .workspace.workspace--editing .left-column,
  .workspace.workspace--editing .preview,
  .workspace.workspace--editing .stems {
    grid-column: auto;
    grid-row: auto;
  }
  .left-column { order: 2; }
  .center-column { order: 1; }
  .preview {
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 0 0 auto;
  }
}

@media (max-width: 820px) {
  .app-shell { padding: 8px; }
  .preview {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
  }
  .player-pane {
    padding: 4px;
    gap: 4px;
    width: 100%;
  }
  .player-frame {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
  }
  .right-pane {
    min-height: 180px;
  }
  .player-controls { grid-template-columns: auto auto auto minmax(0, 1fr); }
  .line {
    font-size: 20px;
  }
  .track-block .vol-range {
    width: 92px;
  }
  .track-block .vol-num {
    width: 52px;
  }
  
/* ── Трек Видео/Фото в разделе Редактирование ──────────────────────────────── */
.editing-media-track {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.editing-media-clip {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 4px;
  background: linear-gradient(135deg, #1e4080 0%, #2a5ca8 100%);
  border: 1px solid #3b6fd4;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  min-width: 4px;
}
.editing-media-clip--image {
  background: linear-gradient(135deg, #1e5040 0%, #2a8060 100%);
  border-color: #4ab890;
}
.editing-media-clip:active { cursor: grabbing; }
.editing-media-clip__label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.editing-media-clip-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.editing-media-clip-handle--l { left: 0; border-radius: 4px 0 0 4px; background: rgba(255,255,255,0.15); }
.editing-media-clip-handle--r { right: 0; border-radius: 0 4px 4px 0; background: rgba(255,255,255,0.15); }

.text-tab-three-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .transport { grid-template-columns: auto 1fr auto; }
  .time { display: none; }
}

@media (max-width: 520px) {
  .brand { font-size: 15px; }
  .primary-btn, .secondary-btn, .nav-btn, .control { padding: 6px 10px; font-size: 13px; }
  .line {
    font-size: 18px;
  }
  .player-controls {
    grid-template-columns: auto auto auto;
    row-gap: 6px;
  }
  .player-controls .time,
  .player-controls input[type="range"] {
    grid-column: 1 / -1;
  }
  .player-controls .time { display: block; font-size: 12px; }
  .right-pane { min-height: 140px; }
  .track-block {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
  }
  .track-block .track-head {
    grid-column: 1;
    grid-row: 1;
  }
  .track-block .track-toolbar {
    grid-column: 1;
    grid-row: 2;
  }
  .track-block .track-wave-wrap {
    grid-column: 1;
    grid-row: 3;
    min-height: 44px;
    height: auto;
    max-height: none;
  }
  .track-head {
    height: auto;
    min-height: 36px;
    white-space: normal;
  }
  .track-toolbar {
    height: auto;
    min-height: 34px;
    flex-wrap: wrap;
  }
  .track-block .vol-range {
    width: 100%;
    flex: 1 1 120px;
  }
  
/* ── Трек Видео/Фото в разделе Редактирование ──────────────────────────────── */
.editing-media-track {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.editing-media-clip {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 4px;
  background: linear-gradient(135deg, #1e4080 0%, #2a5ca8 100%);
  border: 1px solid #3b6fd4;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  min-width: 4px;
}
.editing-media-clip--image {
  background: linear-gradient(135deg, #1e5040 0%, #2a8060 100%);
  border-color: #4ab890;
}
.editing-media-clip:active { cursor: grabbing; }
.editing-media-clip__label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.editing-media-clip-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.editing-media-clip-handle--l { left: 0; border-radius: 4px 0 0 4px; background: rgba(255,255,255,0.15); }
.editing-media-clip-handle--r { right: 0; border-radius: 0 4px 4px 0; background: rgba(255,255,255,0.15); }

.text-tab-three-cols {
    grid-template-columns: 1fr;
  }
  .timeline { grid-template-columns: auto 1fr; }
  .timeline-controls { display: none; }
}

/* ── Guided workflow ──────────────────────────────────────────── */
.nav-btn--locked {
  opacity: 0.35;
  cursor: not-allowed !important;
  pointer-events: none;
}

.nav-btn--guide-pulse {
  animation: nav-btn-pulse-hint 0.8s ease-in-out infinite;
}

@keyframes nav-btn-pulse-hint {
  0% {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  }
  50% {
    border-color: rgba(255, 30, 30, 1);
    box-shadow: inset 0 0 0 2px rgba(255, 20, 20, 0.7), inset 0 0 10px rgba(220, 0, 0, 0.35);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  }
}

.ad-wrap {
  max-height: 100%;
  max-width: 100%;
}

@media (max-width: 1280px) {
  .yandex_rtb_ad {
    max-width: 240px;
  }
}

/* ── Кастомные тултипы ──────────────────────────────────────── */
#vt {
  position: fixed;
  z-index: 99999;
  background: #2a2a2a;
  color: #ffffff;
  border: 1px solid #909090;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 230px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.18s ease;
  white-space: normal;
  text-align: center;
  display: none;
}
#vt.vt-on {
  display: block;
  opacity: 1;
}
#vt.vt-fade {
  display: block;
  opacity: 0;
}
#vt::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}
#vt.vt-top::after {
  top: 100%;
  border-top-color: #909090;
}
#vt.vt-bot::after {
  bottom: 100%;
  border-bottom-color: #909090;
}
/* ── Редактор вокального трека ──────────────────────────────── */
.vocal-edit-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 6px;
  box-sizing: border-box;
}
.vocal-edit-lanes-content {
  height: 100%;
  position: relative;
  padding: 4px 0 2px;
  box-sizing: border-box;
}
.vocal-edit-lane {
  height: 100%;
  position: relative;
}
.vocal-edit-wave-canvas-inside {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  height: calc(100% - 24px);
  min-height: 40px;
  display: block;
}



/* ── Кнопка «Создать новый проект» — синий цвет ──────────────────────────── */
#btn-new-project {
  background: linear-gradient(#3b6fd4, #1a4a9e);
  border-color: #7eb6ff;
}
#btn-new-project:hover {
  background: linear-gradient(#4a7fe4, #2558b8);
}

/* ── Кнопка-призыв читать Мануал ──────────────────────────────────────────── */
.manual-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #158a3e 0%, #0d6b2e 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  border: 2px solid #4a8fff;
  animation: manual-cta-pulse 1.2s ease-in-out infinite;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
@keyframes manual-cta-pulse {
  0%   { border-color: #ffffff; box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 0 22px rgba(255,255,255,0.2); }
  50%  { border-color: #ff4444; box-shadow: 0 0 0 3px rgba(255,40,40,0.55), 0 0 22px rgba(220,0,0,0.4); }
  100% { border-color: #ffffff; box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 0 22px rgba(255,255,255,0.2); }
}
