/* Cutflux beat timeline — studio UI */
:root {
  --sb-bg: #06080f;
  --sb-panel: #0c1018;
  --sb-panel-2: #121820;
  --sb-border: rgba(255, 255, 255, 0.08);
  --sb-text: #eef2f8;
  --sb-dim: #8b95a8;
  --sb-accent: #3d8ef0;
  --sb-accent-2: #6b5cff;
  --sb-warn: #f5a623;
  --sb-ok: #3fcb7e;
  --sb-pink: #ff4d8d;
  --sb-blue: #4a9cf5;
  --sb-yellow: #f0c030;
  --sb-mono: "JetBrains Mono", ui-monospace, monospace;
  --sb-track-label: 108px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--sb-bg);
  color: var(--sb-text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 720px 420px at 50% -8%, rgba(74, 139, 232, 0.14), transparent 68%),
    var(--sb-bg);
}

a {
  color: var(--sb-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sb-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.sb-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid rgba(74, 139, 232, 0.35);
  background: rgba(74, 139, 232, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

.sb-banner strong {
  color: #7db0f0;
}

.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.sb-brand span {
  opacity: 0.55;
  font-weight: 600;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.sb-sub {
  margin: 0 0 20px;
  color: var(--sb-dim);
  font-size: 14px;
  line-height: 1.5;
}

.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sb-accent), #1e3a6b);
  color: #fff;
}

.sb-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sb-border);
  color: var(--sb-text);
}

.sb-log {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--sb-border);
  font-family: var(--sb-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

/* Beat timeline panels */
.sb-bt-layout {
  max-width: 1200px;
}

.sb-bt-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .sb-bt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sb-bt-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--sb-dim);
  margin-bottom: 6px;
}

.sb-bt-field input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: var(--sb-dim);
}

.sb-bt-field input[type="range"] {
  width: 100%;
}

.sb-bt-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.sb-bt-steps .sb-btn {
  flex: 1 1 auto;
  min-width: 140px;
}

.sb-bt-steps .sb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sb-bt-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 10px 0 0;
}

.sb-bt-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sb-accent), var(--sb-ok));
  transition: width 0.2s;
}

.sb-bt-preview-stack {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.sb-bt-preview {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 42vh;
}

.sb-bt-vlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.05s ease-out;
  transform: translateZ(0);
  backface-visibility: hidden;
  pointer-events: none;
}

.sb-bt-vlayer--active {
  opacity: 1;
  z-index: 2;
  pointer-events: none;
}

.sb-bt-compose-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 360px;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

.sb-bt-compose-canvas--recording {
  visibility: hidden;
}

.sb-bt-compose-canvas--recording-visible {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0.02;
  visibility: visible;
  pointer-events: none;
  z-index: 0;
}

.sb-bt-preview-audio {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 8px 8px;
  box-sizing: border-box;
}

.sb-bt-timeline-wrap {
  margin-top: 18px;
}

.sb-bt-timeline-wrap h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sb-bt-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 4px 14px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  min-height: 108px;
  border-radius: 12px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.25);
}

.sb-bt-rail.beats {
  min-height: 96px;
  background: rgba(74, 139, 232, 0.06);
}

.sb-bt-clip {
  flex: 0 0 auto;
  width: 88px;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.sb-bt-clip:hover {
  transform: translateY(-2px);
}

.sb-bt-clip.selected {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 1px rgba(74, 139, 232, 0.35);
}

.sb-bt-clip:not(.selected) {
  opacity: 0.45;
}

.sb-bt-clip img {
  display: block;
  width: 88px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.sb-bt-clip .meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--sb-dim);
  font-family: var(--sb-mono);
  line-height: 1.3;
}

.sb-bt-slot {
  flex: 0 0 auto;
  width: 72px;
  scroll-snap-align: start;
  text-align: center;
}

.sb-bt-slot img {
  width: 72px;
  height: 41px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(74, 139, 232, 0.5);
  background: #111;
}

.sb-bt-slot .beat {
  font-size: 9px;
  color: #7db0f0;
  margin-top: 4px;
  font-family: var(--sb-mono);
}

.sb-bt-slot .dur {
  font-size: 9px;
  color: var(--sb-dim);
}

.sb-bt-hint {
  font-size: 12px;
  color: var(--sb-dim);
  margin: 8px 0 0;
  line-height: 1.45;
}

/* Fixed build strip — always visible (verify deploy without scrolling) */
body.sb-bt-page {
  padding-bottom: 52px;
}

.sb-bt-live-badge {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px 14px;
  font-family: var(--sb-mono);
  font-size: 12px;
  color: #c8d8f0;
  background: rgba(8, 14, 28, 0.96);
  border-top: 2px solid rgba(74, 139, 232, 0.55);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.sb-bt-live-pill {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(74, 139, 232, 0.25);
  border: 1px solid rgba(74, 139, 232, 0.5);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sb-bt-live-pill strong {
  color: #fff;
  font-size: 14px;
}

.sb-bt-live-detail strong {
  color: #8eb8f0;
}

.sb-bt-header-build {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--sb-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(74, 139, 232, 0.35);
  border: 1px solid rgba(74, 139, 232, 0.55);
  vertical-align: middle;
}

.sb-bt-beat-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-bt-beat-focus-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--sb-dim);
  margin-right: 4px;
}

.sb-bt-focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sb-text);
  cursor: pointer;
  user-select: none;
}

.sb-bt-focus-chip input {
  accent-color: #5b9cf5;
}

.sb-bt-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 13px;
  color: var(--sb-dim);
  margin-top: 12px;
}

.sb-bt-meta-row strong {
  color: var(--sb-text);
}

/* Two-column workspace: clips (larger) left, beats right */
.sb-bt-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

@media (min-width: 960px) {
  .sb-bt-workspace {
    grid-template-columns: minmax(320px, 1fr) minmax(300px, 380px);
  }
}

.sb-bt-col h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sb-bt-hint-tight {
  margin: 0 0 14px;
}

.sb-bt-clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.28);
  min-height: 200px;
  max-height: min(62vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sb-bt-clip-card {
  border-radius: 12px;
  border: 2px solid var(--sb-border);
  background: rgba(14, 20, 34, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, opacity 0.15s;
}

.sb-bt-clip-card.selected {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 1px rgba(74, 139, 232, 0.35);
}

.sb-bt-clip-card:not(.selected) {
  opacity: 0.5;
}

.sb-bt-clip-card .sb-bt-clip-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

.sb-bt-clip-card .sb-bt-clip-toggle img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}

.sb-bt-clip-card .sb-bt-clip-meta {
  padding: 8px 10px 6px;
  font-size: 11px;
  color: var(--sb-dim);
  font-family: var(--sb-mono);
  line-height: 1.35;
}

.sb-bt-clip-drag {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #7db0f0;
  background: rgba(74, 139, 232, 0.1);
  border-top: 1px solid var(--sb-border);
  cursor: grab;
  user-select: none;
}

.sb-bt-clip-drag:active {
  cursor: grabbing;
}

.sb-bt-beat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--sb-border);
  background: rgba(74, 139, 232, 0.06);
  min-height: 200px;
  max-height: min(62vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sb-bt-plan-slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(140, 180, 250, 0.35);
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--sb-mono);
  font-size: 12px;
  color: var(--sb-dim);
  cursor: copy;
}

.sb-bt-plan-slot .plan-ix {
  font-weight: 800;
  color: var(--sb-accent);
}

.sb-bt-slot {
  display: grid;
  grid-template-columns: 36px 120px 1fr 70px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(74, 139, 232, 0.45);
  background: rgba(10, 14, 32, 0.75);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}

.sb-bt-slot:hover {
  border-color: rgba(98, 212, 255, 0.55);
}

.sb-bt-slot.sb-bt-slot--dragover {
  outline: 2px solid var(--sb-ok);
  background: rgba(63, 203, 126, 0.12);
}

.sb-bt-slot .slot-grip {
  font-size: 16px;
  color: var(--sb-dim);
  text-align: center;
  user-select: none;
  cursor: grab;
}

.sb-bt-slot .slot-grip:active {
  cursor: grabbing;
}

.sb-bt-slot.sb-bt-slot--pinned {
  border-color: rgba(63, 203, 126, 0.55);
}

.sb-bt-slot img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
  display: block;
}

.sb-bt-slot .slot-beat-meta {
  font-family: var(--sb-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--sb-dim);
}

.sb-bt-slot .slot-beat-meta strong {
  display: block;
  color: #7db0f0;
  font-size: 12px;
}

.sb-analyzing .sb-bt-progress > i {
  animation: sb-pulse-bar 1.2s ease-in-out infinite;
}

.sb-bt-building .sb-bt-progress > i {
  animation: sb-pulse-bar 1.2s ease-in-out infinite;
}

.sb-bt-build-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8ec8ff;
  font-weight: 600;
}

.sb-bt-output {
  margin: 16px 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 180, 255, 0.35);
  background: rgba(8, 18, 32, 0.85);
}

.sb-bt-output-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sb-bt-output-head h3 {
  margin: 0;
  font-size: 15px;
}

.sb-bt-output-meta {
  font-size: 12px;
  color: var(--sb-dim);
  font-family: var(--sb-mono);
}

.sb-bt-output-player {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #000;
}

.sb-bt-download-btn {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.sb-bt-download-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sb-dim);
  text-align: center;
}

.sb-bt-output-player {
  margin-bottom: 10px;
}

.sb-bt-output-dismiss {
  display: block;
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .sb-bt-output {
    padding: 16px;
  }

  .sb-bt-download-btn {
    padding: 18px 20px;
    font-size: 18px;
  }

  .sb-bt-output-player {
    max-height: 220px;
  }
}

@keyframes sb-pulse-bar {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ─── Studio shell (v17) ─── */
body.sb-bt-page {
  padding-bottom: 48px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.sb-bt-page::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Hide scrollbar chrome — scroll still works (wheel, touch, trackpad) */
body.sb-bt-page .sb-bt-clip-list,
body.sb-bt-page .sb-bt-track-scroll,
body.sb-bt-page .sb-bt-beat-list,
body.sb-bt-page .sb-bt-log,
body.sb-bt-page .sb-bt-main,
body.sb-bt-page .sb-bt-app,
body.sb-bt-page .sb-bt-sidebar,
body.sb-bt-page .sb-bt-timeline-panel,
body.sb-bt-page .sb-bt-tracks {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.sb-bt-page .sb-bt-clip-list::-webkit-scrollbar,
body.sb-bt-page .sb-bt-track-scroll::-webkit-scrollbar,
body.sb-bt-page .sb-bt-beat-list::-webkit-scrollbar,
body.sb-bt-page .sb-bt-log::-webkit-scrollbar,
body.sb-bt-page .sb-bt-main::-webkit-scrollbar,
body.sb-bt-page .sb-bt-app::-webkit-scrollbar,
body.sb-bt-page .sb-bt-sidebar::-webkit-scrollbar,
body.sb-bt-page .sb-bt-timeline-panel::-webkit-scrollbar,
body.sb-bt-page .sb-bt-tracks::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
  background: transparent;
}

.sb-bt-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 100%;
  overflow: hidden;
}

.sb-bt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--sb-border);
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sb-bt-toolbar-left,
.sb-bt-toolbar-center,
.sb-bt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-bt-toolbar-center {
  flex: 1;
  justify-content: center;
}

.sb-bt-brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--sb-text);
  text-decoration: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.sb-bt-brand:hover {
  text-decoration: none;
  color: #fff;
}

.sb-bt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff8a4c, #ff4d6d);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.sb-bt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--sb-text);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.sb-bt-btn--primary {
  background: linear-gradient(135deg, var(--sb-accent), #2563b8);
  color: #fff;
  border-color: rgba(90, 160, 255, 0.4);
  box-shadow: 0 4px 20px rgba(61, 142, 240, 0.35);
}

.sb-bt-btn--upscale {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
  font-weight: 700;
}

.sb-bt-btn--upscale:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45);
}

.sb-bt-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--sb-border);
}

.sb-bt-btn--link {
  text-decoration: none;
  padding: 8px 12px;
  font-size: 13px;
}

.sb-bt-btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

.sb-bt-btn--xs {
  padding: 5px 10px;
  font-size: 12px;
}

.sb-bt-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.sb-bt-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4d9bff, #2d6fd4);
}

.sb-bt-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sb-bt-btn-icon {
  font-size: 15px;
}

.sb-bt-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sb-bt-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sb-accent), var(--sb-ok));
  transition: width 0.2s;
}

.sb-bt-setup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.2);
}

.sb-bt-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: var(--sb-panel);
  font-size: 12px;
  cursor: pointer;
  max-width: min(220px, 42vw);
}

.sb-bt-file-chip input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.sb-bt-file-chip-label {
  font-weight: 700;
  color: var(--sb-dim);
  flex-shrink: 0;
}

.sb-bt-file-chip-name {
  color: var(--sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--sb-mono);
  font-size: 11px;
}

.sb-bt-studio {
  display: grid;
  grid-template-columns: var(--bt-clips-w, 300px) 6px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

@media (max-width: 900px) {
  .sb-bt-studio {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sb-bt-sidebar {
    max-height: 280px;
    width: 100% !important;
    border-bottom: 1px solid var(--sb-border);
  }

  .sb-bt-clip-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .sb-bt-resizer {
    display: none !important;
  }
}

.sb-bt-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--sb-panel);
  border-right: 1px solid var(--sb-border);
}

.sb-bt-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}

.sb-bt-sidebar-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.sb-bt-sidebar-count {
  font-family: var(--sb-mono);
  font-size: 12px;
  color: var(--sb-dim);
}

.sb-bt-sidebar-tools {
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-bt-search {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b95a8'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 10px center no-repeat;
  color: var(--sb-text);
  font: inherit;
  font-size: 13px;
}

.sb-bt-sidebar-bulk {
  display: flex;
  gap: 6px;
}

.sb-bt-clip-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  align-content: start;
}

.sb-bt-sidebar-hint {
  margin: 0;
  padding: 8px 12px 12px;
  font-size: 11px;
  color: var(--sb-dim);
  line-height: 1.4;
}

.sb-bt-clip-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.12s;
  min-width: 0;
}

.sb-bt-clip-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sb-bt-clip-row.selected {
  border-color: rgba(74, 139, 232, 0.55);
  background: rgba(74, 139, 232, 0.1);
}

.sb-bt-clip-row:not(.selected) {
  opacity: 0.58;
}

.sb-bt-clip-row.sb-bt-clip-row--hidden {
  display: none;
}

.sb-bt-clip-row-visual {
  position: relative;
  width: 100%;
}

.sb-bt-clip-row-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  background: #1a2030;
  display: block;
}

.sb-bt-clip-row-meta {
  min-width: 0;
  text-align: center;
  padding: 0 2px;
}

.sb-bt-clip-row-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-bt-clip-row-dur {
  display: block;
  font-family: var(--sb-mono);
  font-size: 10px;
  color: var(--sb-dim);
  margin-top: 2px;
}

.sb-bt-clip-row-src {
  display: block;
  font-size: 9px;
  color: var(--sb-accent);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sb-bt-add-more-clips {
  width: 100%;
  margin: -4px 0 8px;
  text-align: center;
  font-size: 12px;
}

.sb-bt-clip-row-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sb-bt-clip-row.selected .sb-bt-clip-row-check {
  background: var(--sb-ok);
  border-color: var(--sb-ok);
  color: #041208;
  font-weight: 800;
}

.sb-bt-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 12px 16px 20px;
  gap: 12px;
  overflow: hidden;
}

.sb-bt-split-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.sb-bt-split-vertical .sb-bt-player-card {
  flex-shrink: 0;
}

.sb-bt-split-vertical .sb-bt-timeline-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sb-bt-split-vertical .sb-bt-tracks {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sb-bt-player-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  font-size: 12px;
  color: var(--sb-dim);
  font-family: var(--sb-mono);
}

.sb-bt-meta-chip strong {
  color: var(--sb-text);
}

.sb-bt-meta-sep {
  margin: 0 8px;
  opacity: 0.4;
}

.sb-bt-player-card {
  border-radius: 14px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.sb-bt-player-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px var(--bt-rail-w, 280px);
  align-items: start;
  min-height: 0;
}

@media (max-width: 900px) {
  .sb-bt-player-body {
    grid-template-columns: 1fr;
  }

  .sb-bt-player-rail {
    border-top: 1px solid var(--sb-border);
  }
}

.sb-bt-player-visual {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-bt-player-rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  max-height: calc(min(52vh, 560px) + 48px);
  padding: 0;
  border-left: 1px solid var(--sb-border);
  background: linear-gradient(180deg, rgba(14, 20, 34, 0.95), rgba(8, 12, 22, 0.98));
  overflow: hidden;
}

.sb-bt-rail-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  padding: 10px 10px 0;
  border-bottom: 1px solid var(--sb-border);
}

.sb-bt-rail-tab {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--sb-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.sb-bt-rail-tab:hover {
  color: var(--sb-text);
}

.sb-bt-rail-tab--active {
  color: var(--sb-text);
  background: rgba(74, 139, 232, 0.14);
  box-shadow: inset 0 -2px 0 var(--sb-accent);
}

.sb-bt-rail-panes {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sb-bt-rail-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sb-bt-rail-pane[hidden] {
  display: none !important;
}

.sb-bt-rail-pane--setup .sb-bt-rail-foot {
  margin: 0;
  padding-top: 4px;
}

.sb-bt-rail-captions-link {
  width: 100%;
  margin-top: 4px;
  text-align: center;
}

.sb-bt-rail-back {
  align-self: flex-start;
  margin: 0 0 4px;
  padding: 4px 0;
  border: none;
  background: none;
  color: #9ec4f5;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sb-bt-rail-back:hover {
  color: #c5dcff;
}

.sb-bt-rail-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sb-dim);
}

.sb-bt-rail-title--steps {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--sb-border);
}

.sb-bt-rail-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-bt-rail-foot {
  margin: auto 0 0;
  padding-top: 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--sb-dim);
}

.sb-bt-rail-foot b {
  color: #9ec4f5;
}

.sb-bt-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sb-border);
  font-size: 12px;
}

.sb-bt-length-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sb-dim);
  font-weight: 600;
}

.sb-bt-length-control input[type="range"] {
  width: 120px;
  accent-color: var(--sb-accent);
}

.sb-bt-timecode {
  font-family: var(--sb-mono);
  font-size: 12px;
  color: var(--sb-text);
}

.sb-bt-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: min(52vh, 560px);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.sb-bt-player-empty {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(61, 142, 240, 0.12), transparent),
    rgba(6, 10, 18, 0.97);
  text-align: center;
}

.sb-bt-player-card--ready .sb-bt-player-empty {
  display: none;
}

.sb-bt-player-empty-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sb-bt-player-empty-sub {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--sb-dim);
}

.sb-bt-add-media {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  text-align: left;
  width: 100%;
}

.sb-bt-add-media--rail {
  padding: 12px 12px;
}

.sb-bt-add-media--rail .sb-bt-add-media-text strong {
  font-size: 14px;
}

.sb-bt-add-media input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.sb-bt-add-media:hover {
  border-color: rgba(90, 160, 255, 0.55);
  background: rgba(74, 139, 232, 0.1);
  transform: translateY(-2px);
}

.sb-bt-add-media--video:hover {
  border-color: rgba(255, 120, 160, 0.5);
}

.sb-bt-add-media--music:hover {
  border-color: rgba(120, 180, 255, 0.55);
}

.sb-bt-add-media--done {
  border-style: solid;
  border-color: rgba(63, 203, 126, 0.45);
  background: rgba(63, 203, 126, 0.08);
}

.sb-bt-add-media-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.sb-bt-add-media-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sb-bt-add-media-text strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--sb-text);
}

.sb-bt-add-media-hint {
  font-size: 12px;
  color: var(--sb-dim);
  font-family: var(--sb-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-bt-workflow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-bt-btn--workflow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  min-height: 0;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid rgba(90, 160, 255, 0.3);
  background: linear-gradient(135deg, rgba(61, 142, 240, 0.18), rgba(30, 55, 100, 0.35));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.sb-bt-btn--workflow:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(77, 155, 255, 0.28), rgba(40, 75, 140, 0.45));
  border-color: rgba(120, 180, 255, 0.5);
  transform: translateX(2px);
}

.sb-bt-btn--workflow-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--sb-border);
  box-shadow: none;
}

.sb-bt-workflow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sb-bt-workflow-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sb-bt-workflow-copy strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--sb-text);
}

.sb-bt-workflow-copy span {
  font-size: 11px;
  font-weight: 500;
  color: var(--sb-dim);
  line-height: 1.3;
}

/** Analyze beats row: primary action + Deep beat toggle */
.sb-bt-beats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}
.sb-bt-beats-row > .sb-bt-btn--workflow {
  flex: 1 1 220px;
  min-width: 200px;
}
.sb-bt-deep-beats-switch {
  flex: 1 1 150px;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 170, 255, 0.22);
  background: rgba(6, 10, 20, 0.45);
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) {
  .sb-bt-deep-beats-switch:hover {
    border-color: rgba(150, 200, 255, 0.45);
    background: rgba(20, 40, 80, 0.35);
  }
}
.sb-bt-deep-beats-switch:focus-within {
  outline: 2px solid rgba(93, 173, 255, 0.55);
  outline-offset: 2px;
}
.sb-bt-deep-beats-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.sb-bt-deep-beats-visual {
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background 0.18s ease;
}
.sb-bt-deep-beats-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(240, 246, 255, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s;
}
.sb-bt-deep-beats-checkbox:checked + .sb-bt-deep-beats-visual {
  background: linear-gradient(90deg, #3d8ef0, #5ec4ff);
}
.sb-bt-deep-beats-checkbox:checked + .sb-bt-deep-beats-visual .sb-bt-deep-beats-thumb {
  transform: translateX(18px);
  background: #fff;
}
.sb-bt-deep-beats-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sb-bt-deep-beats-meta strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--sb-text);
  line-height: 1.25;
}
.sb-bt-deep-beats-meta small {
  font-size: 10px;
  font-weight: 500;
  color: var(--sb-dim);
  line-height: 1.35;
}

.sb-bt-player-card--ready .sb-bt-play-fab {
  z-index: 5;
}

body:not(.sb-bt-has-media) .sb-bt-play-fab {
  display: none;
}

.sb-bt-play-fab {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, opacity 0.15s;
}

.sb-bt-play-fab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sb-bt-play-fab:not(:disabled):hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.sb-bt-play-fab-icon {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #0a1020;
  transform: translateX(3px);
}

body.sb-bt-previewing:not(.sb-bt-preview-playing) .sb-bt-play-fab,
body.sb-bt-preview-paused .sb-bt-play-fab {
  opacity: 1;
  pointer-events: auto;
}

body.sb-bt-preview-playing .sb-bt-play-fab {
  opacity: 0;
  pointer-events: none;
}

.sb-bt-preview-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--sb-border);
}

.sb-bt-transport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--sb-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sb-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.sb-bt-transport-btn:not(:disabled):hover {
  background: rgba(74, 139, 232, 0.18);
  border-color: rgba(74, 139, 232, 0.45);
}

.sb-bt-transport-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sb-bt-transport-btn--main {
  width: 48px;
  height: 40px;
  background: rgba(74, 139, 232, 0.22);
  border-color: rgba(74, 139, 232, 0.5);
}

.sb-bt-transport-icon {
  display: block;
}

.sb-bt-transport-icon--play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #e8f0ff;
  transform: translateX(2px);
}

.sb-bt-transport-icon--pause {
  display: none;
  width: 14px;
  height: 16px;
  border-left: 4px solid #e8f0ff;
  border-right: 4px solid #e8f0ff;
  box-sizing: border-box;
}

body.sb-bt-preview-playing .sb-bt-transport-icon--play {
  display: none;
}

body.sb-bt-preview-playing .sb-bt-transport-icon--pause {
  display: block;
}

body.sb-bt-preview-playing .sb-bt-play-fab-icon {
  border-width: 0;
  width: 18px;
  height: 20px;
  border-left: 5px solid #0a1020;
  border-right: 5px solid #0a1020;
  transform: none;
}

.sb-bt-preview-audio,
.sb-bt-preview-music-video {
  display: none;
}

.sb-bt-timeline-panel {
  border-radius: 14px;
  border: 1px solid var(--sb-border);
  background: rgba(8, 12, 22, 0.85);
  overflow: hidden;
}

.sb-bt-resizer--row {
  height: 6px;
  cursor: row-resize;
  margin: 2px 0;
  flex-shrink: 0;
}

.sb-bt-resizer--rail {
  margin: 0;
}

/* ─── Panel resize handles (optional drag — default layout unchanged) ─── */
.sb-bt-resizer {
  position: relative;
  z-index: 30;
  touch-action: none;
  user-select: none;
  background: transparent;
  transition: background 0.15s;
}

.sb-bt-resizer--col {
  width: 6px;
  cursor: col-resize;
}

.sb-bt-resizer:hover,
.sb-bt-resizer:focus-visible,
.sb-bt-resizer.sb-bt-resizer--active {
  background: rgba(61, 142, 240, 0.22);
}

.sb-bt-resizer::before {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.15s;
}

.sb-bt-resizer--col::before {
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 3px;
  transform: translateX(-50%);
}

.sb-bt-resizer--row::before {
  top: 50%;
  left: 12%;
  right: 12%;
  height: 3px;
  transform: translateY(-50%);
}

.sb-bt-resizer:hover::before,
.sb-bt-resizer:focus-visible::before,
.sb-bt-resizer--active::before {
  opacity: 1;
}

.sb-bt-resizer::after {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #b8d4ff;
  background: rgba(8, 14, 28, 0.92);
  border: 1px solid rgba(90, 160, 255, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 1;
}

.sb-bt-resizer--col::after {
  content: "↔";
  padding: 10px 4px;
  letter-spacing: -2px;
}

.sb-bt-resizer--row::after {
  content: "↕";
  padding: 4px 10px;
}

.sb-bt-resizer:hover::after,
.sb-bt-resizer:focus-visible::after,
.sb-bt-resizer--active::after {
  opacity: 1;
}

body.sb-bt-resizing {
  cursor: col-resize;
  user-select: none;
}

body.sb-bt-resizing--y {
  cursor: row-resize;
}

body.sb-bt-resizing * {
  cursor: inherit !important;
}

.sb-bt-waveform {
  height: 48px;
  background:
    linear-gradient(180deg, rgba(61, 142, 240, 0.12), transparent),
    repeating-linear-gradient(
      90deg,
      rgba(74, 156, 245, 0.35) 0,
      rgba(74, 156, 245, 0.35) 2px,
      transparent 2px,
      transparent 14px
    );
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  opacity: 0.85;
}

.sb-bt-tracks {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sb-bt-track {
  display: grid;
  grid-template-columns: var(--sb-track-label) 1fr;
  align-items: stretch;
  border-top: 1px solid var(--sb-border);
  min-height: 52px;
}

.sb-bt-track-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sb-dim);
  cursor: pointer;
  user-select: none;
  border-right: 1px solid var(--sb-border);
}

.sb-bt-track-head--static {
  cursor: default;
}

.sb-bt-track-toggle {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sb-bt-track-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.sb-bt-track-toggle:checked {
  background: var(--sb-pink);
}

.sb-bt-track--bass .sb-bt-track-toggle:checked {
  background: var(--sb-blue);
}

.sb-bt-track--snare .sb-bt-track-toggle:checked {
  background: #5b8cff;
}

.sb-bt-track--clap .sb-bt-track-toggle:checked {
  background: var(--sb-yellow);
}

.sb-bt-track-toggle:checked::after {
  transform: translateX(16px);
}

.sb-bt-track-head--static .sb-bt-track-name {
  padding-left: 44px;
}

.sb-bt-track-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  -webkit-overflow-scrolling: touch;
}

.sb-bt-type-lane,
.sb-bt-montage-lane {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 36px;
  align-items: stretch;
}

.sb-bt-type-pill {
  flex: 0 0 44px;
  height: 32px;
  border-radius: 8px;
  opacity: 0.9;
}

.sb-bt-type-pill--empty {
  flex: 0 0 44px;
  height: 32px;
}

.sb-bt-type-pill--beat {
  background: linear-gradient(135deg, #ff6b4a, #ff3d8a);
}

.sb-bt-type-pill--bass {
  background: linear-gradient(135deg, #4a7cff, #7b5cff);
}

.sb-bt-type-pill--snare {
  background: linear-gradient(135deg, #3d9eff, #5b6cff);
}

.sb-bt-type-pill--clap {
  background: linear-gradient(135deg, #f0c030, #ff8a40);
}

.sb-bt-track--edit {
  min-height: 72px;
  background: rgba(0, 0, 0, 0.25);
}

.sb-bt-track-scroll--montage {
  padding: 10px 12px;
}

.sb-bt-montage-lane {
  gap: 8px;
  min-height: 52px;
}

.sb-bt-playhead {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--sb-yellow);
  box-shadow: 0 0 8px var(--sb-yellow);
  z-index: 4;
  pointer-events: none;
  left: 12px;
}

.sb-bt-slot {
  flex: 0 0 auto;
  width: 56px;
  min-height: 52px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
  cursor: default;
  display: flex;
  flex-direction: column;
  background: var(--sb-panel-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sb-bt-slot:hover {
  border-color: rgba(98, 180, 255, 0.55);
}

.sb-bt-slot.sb-bt-slot--dragover {
  outline: 2px solid var(--sb-ok);
  box-shadow: 0 0 0 3px rgba(63, 203, 126, 0.25);
}

.sb-bt-slot.sb-bt-slot--pinned {
  border-color: rgba(63, 203, 126, 0.6);
}

.sb-bt-slot--beat .sb-bt-cell-fill {
  background: linear-gradient(145deg, #ff6b4a, #ff3d8a);
}

.sb-bt-slot--bass .sb-bt-cell-fill {
  background: linear-gradient(145deg, #4a7cff, #7b5cff);
}

.sb-bt-slot--snare .sb-bt-cell-fill {
  background: linear-gradient(145deg, #3d9eff, #5b6cff);
}

.sb-bt-slot--clap .sb-bt-cell-fill {
  background: linear-gradient(145deg, #f0c030, #ff8a40);
}

.sb-bt-cell-fill {
  flex: 1;
  min-height: 36px;
  background-size: cover;
  background-position: center;
}

.sb-bt-slot img.sb-bt-cell-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.sb-bt-slot .slot-grip {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  cursor: grab;
  z-index: 2;
  padding: 2px;
  line-height: 1;
}

.sb-bt-slot .slot-dur {
  font-family: var(--sb-mono);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 2px;
  background: rgba(0, 0, 0, 0.5);
}

.sb-bt-plan-slot {
  flex: 0 0 auto;
  width: 56px;
  min-height: 52px;
  border-radius: 10px;
  border: 2px dashed rgba(140, 180, 250, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--sb-mono);
  font-size: 9px;
  color: var(--sb-dim);
  text-align: center;
  padding: 4px;
  cursor: copy;
}

.sb-bt-plan-slot .plan-ix {
  font-weight: 800;
  color: var(--sb-accent);
  font-size: 11px;
}

.sb-bt-timeline-hint {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--sb-dim);
  border-top: 1px solid var(--sb-border);
}

.sb-bt-log-panel {
  margin-top: 4px;
}

.sb-bt-log-panel summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--sb-dim);
  font-weight: 600;
  padding: 6px 0;
}

.sb-bt-log-panel .sb-log {
  margin-top: 8px;
  max-height: 160px;
}

.sb-bt-live-badge {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 8px 14px;
  font-family: var(--sb-mono);
  font-size: 11px;
  color: #c8d8f0;
  background: rgba(8, 14, 28, 0.96);
  border-top: 1px solid rgba(74, 139, 232, 0.4);
  pointer-events: none;
}

.sb-bt-header-build {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--sb-mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(74, 139, 232, 0.35);
  border: 1px solid rgba(74, 139, 232, 0.45);
  vertical-align: middle;
}

.sb-bt-build-status {
  margin: 0;
  padding: 6px 18px;
  font-size: 12px;
  color: #8ec8ff;
  font-weight: 600;
  background: rgba(61, 142, 240, 0.08);
}

.sb-bt-output {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 180, 255, 0.35);
  background: rgba(8, 18, 32, 0.85);
}

.sb-bt-download-btn {
  width: 100%;
  margin-bottom: 10px;
  padding: 16px;
  font-size: 16px;
}

.sb-bt-analyzing .sb-bt-progress > i,
.sb-bt-building .sb-bt-progress > i {
  animation: sb-pulse-bar 1.2s ease-in-out infinite;
}

/* ── Lyric captions ── */
.sb-bt-caption-overlay {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  padding: 0 4px;
}

.sb-bt-caption-overlay--dragging {
  cursor: grabbing;
}

.sb-bt-caption-canvas {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sb-bt-output-video-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.sb-bt-output-video-wrap .sb-bt-output-player {
  margin-bottom: 0;
  display: block;
}

.sb-bt-caption-overlay--output {
  z-index: 3;
}

.sb-bt-caption-canvas--output {
  z-index: 3;
}

.sb-bt-captions-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.sb-bt-caption-enable {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sb-text);
  cursor: pointer;
}

.sb-bt-caption-enable input {
  accent-color: var(--sb-accent);
}

.sb-bt-upscale-control {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(74, 139, 232, 0.22);
  background: rgba(74, 139, 232, 0.06);
}

.sb-bt-music-start {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.07);
}

.sb-bt-music-start-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sb-bt-music-start-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sb-dim);
}

.sb-bt-music-start-val {
  font-family: var(--sb-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fcd34d;
}

.sb-bt-music-start-slider {
  width: 100%;
  accent-color: #f59e0b;
}

.sb-bt-music-start-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--sb-dim);
}

.sb-bt-upscale-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sb-dim);
  margin: 0 0 8px;
}

.sb-bt-upscale-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sb-bt-upscale-pill {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--sb-dim);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sb-bt-upscale-pill:hover {
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--sb-text);
}

.sb-bt-upscale-pill--active {
  border-color: rgba(124, 58, 237, 0.65);
  background: rgba(124, 58, 237, 0.22);
  color: #e9d5ff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.25);
}

.sb-bt-upscale-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--sb-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sb-bt-upscale-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--sb-dim);
}

.sb-bt-btn--caption {
  width: 100%;
}

.sb-bt-caption-status {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--sb-dim);
}

.sb-bt-caption-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.sb-bt-caption-controls label {
  display: block;
  font-size: 11px;
  color: var(--sb-dim);
  font-weight: 600;
}

.sb-bt-caption-controls input[type="range"] {
  width: 100%;
  margin-top: 4px;
  accent-color: var(--sb-accent);
}

.sb-bt-caption-style-label {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sb-dim);
}

.sb-bt-caption-style-count {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

.sb-bt-caption-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.sb-bt-caption-tpl {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: rgba(0, 0, 0, 0.25);
  font-size: 10px;
  cursor: pointer;
  min-width: 0;
}

.sb-bt-caption-tpl input {
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--sb-accent);
}

.sb-bt-caption-tpl span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-bt-caption-tpl:has(input:checked) {
  border-color: rgba(74, 139, 232, 0.65);
  background: rgba(74, 139, 232, 0.12);
}

.sb-bt-caption-drag-hint {
  margin: 0;
  font-size: 10px;
  color: var(--sb-dim);
  line-height: 1.35;
}

/* Auth, settings, owner secret taps */
.sb-bt-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 8, 14, 0.92);
  color: var(--sb-dim);
  font-size: 14px;
}

.sb-bt-auth-loading[hidden] {
  display: none;
}

.sb-bt-auth-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--sb-accent);
  animation: sb-bt-spin 0.8s linear infinite;
}

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

.sb-bt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sb-bt-user-bar,
.sb-bt-guest-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sb-bt-user-bar[hidden],
.sb-bt-guest-bar[hidden] {
  display: none !important;
}

.sb-bt-uname {
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-text);
  cursor: default;
  user-select: none;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-bt-premium-badge {
  font-size: 11px;
  color: #e8a000;
}

.sb-bt-premium-badge[hidden] {
  display: none !important;
}

.sb-bt-secret-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.sb-bt-secret-modal.active {
  opacity: 1;
  pointer-events: all;
}

.sb-bt-secret-modal .secret-modal-inner {
  background: #060616;
  border: 1px solid rgba(0, 220, 255, 0.25);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 0 40px rgba(0, 220, 255, 0.16);
  font-family: var(--sb-mono);
  transform: translateY(-18px);
  transition: transform 0.22s;
}

.sb-bt-secret-modal.active .secret-modal-inner {
  transform: none;
}

.sb-bt-secret-modal .secret-modal-inner.shake {
  animation: sb-bt-sm-shake 0.45s ease both;
}

@keyframes sb-bt-sm-shake {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translateX(-9px);
  }
  40% {
    transform: translateX(9px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

.sb-bt-secret-modal .secret-prompt {
  font-size: 0.68rem;
  color: rgba(0, 220, 255, 0.5);
  margin-bottom: 0.65rem;
  letter-spacing: 0.1em;
}

.sb-bt-secret-modal .secret-input-row {
  display: flex;
  gap: 0.5rem;
}

.sb-bt-secret-modal #secret-input {
  flex: 1;
  background: #03030d;
  border: 1px solid rgba(0, 220, 255, 0.38);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  color: #0df;
  font-family: var(--sb-mono);
  font-size: 1.2rem;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
}

.sb-bt-secret-modal #secret-submit {
  background: rgba(0, 220, 255, 0.1);
  border: 1px solid rgba(0, 220, 255, 0.28);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  color: #0df;
  cursor: pointer;
  font-size: 0.85rem;
}

.sb-bt-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3.5rem 1.25rem 1.25rem;
  background: rgba(4, 6, 14, 0.78);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sb-bt-settings-modal.active {
  opacity: 1;
  pointer-events: all;
}

.sb-bt-settings-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--sb-panel);
  border: 1px solid var(--sb-border);
  border-radius: 14px;
  padding: 1.2rem 1.35rem 1.35rem;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
  transform: translateY(-14px);
  transition: transform 0.2s;
}

.sb-bt-settings-modal.active .sb-bt-settings-panel {
  transform: none;
}

.sb-bt-settings-panel h2 {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 2rem 0.85rem 0;
}

.sb-bt-settings-section {
  margin-bottom: 1rem;
}

.sb-bt-settings-section h3 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sb-dim);
  margin: 0 0 0.4rem;
}

.sb-bt-settings-email {
  font-size: 0.86rem;
  word-break: break-word;
}

.sb-bt-settings-hint {
  font-size: 0.8rem;
  color: var(--sb-dim);
  margin: 0 0 0.7rem;
  line-height: 1.45;
}

.sb-bt-settings-billing {
  width: 100%;
}

.sb-bt-settings-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--sb-dim);
  font-size: 1.4rem;
  cursor: pointer;
}

.sb-bt-settings-signout {
  width: 100%;
  padding: 0.58rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--sb-border);
  border-radius: 10px;
  background: transparent;
  color: #f87171;
  cursor: pointer;
}

.sb-bt-settings-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sb-border);
}
