/* ============================================================================
 * 대전 사랑하는교회 찬양팀 허브 — 사랑하는교회 유튜브 찬양 & 실시간 싱크 가사 탭
 * 디자인 토큰 상속: styles.css (Modern Two-Tone Studio Light / Midnight Dark)
 * 명암비: 라이트·다크([data-theme="dark"]) 모두 WCAG AA (4.5:1+) 준수
 * ============================================================================ */

/* ============================================================================
 * 1. 전체 2단 레이아웃 & 공통 박스 모델
 * ============================================================================ */
.bw-shell,
.bw-shell *,
.bw-shell *::before,
.bw-shell *::after,
.bw-fs-overlay,
.bw-fs-overlay *,
.bw-fs-overlay *::before,
.bw-fs-overlay *::after {
  box-sizing: border-box;
}

.bw-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bw-shell [hidden],
.bw-fs-overlay [hidden] {
  display: none !important;
}

/* 얇은 커스텀 스크롤바 */
.bw-list,
.bw-lyrics-scroll,
.bw-fs-body {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.bw-list::-webkit-scrollbar,
.bw-lyrics-scroll::-webkit-scrollbar,
.bw-fs-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.bw-list::-webkit-scrollbar-track,
.bw-lyrics-scroll::-webkit-scrollbar-track,
.bw-fs-body::-webkit-scrollbar-track {
  background: transparent;
}

.bw-list::-webkit-scrollbar-thumb,
.bw-lyrics-scroll::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 999px;
}

.bw-fs-body {
  scrollbar-color: rgba(148, 163, 184, 0.32) transparent;
}

.bw-fs-body::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.32);
  border-radius: 999px;
}

/* ============================================================================
 * 2. 좌측 곡 목록 레일
 * ============================================================================ */
.bw-rail {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.bw-rail-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 11px;
  border-bottom: 1px solid var(--border-hairline);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  flex-shrink: 0;
  min-width: 0;
}

.bw-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.bw-brand-row h2,
.bw-brand-row h3,
.bw-brand-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-primary-soft);
  color: var(--accent-primary);
  border: 1px solid rgba(29, 78, 216, 0.16);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

[data-theme="dark"] .bw-count-pill {
  border-color: rgba(96, 165, 250, 0.28);
}

/* 검색 입력 */
.bw-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.bw-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  pointer-events: none;
}

.bw-search-icon svg {
  width: 15px;
  height: 15px;
}

.bw-search-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 34px 0 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  color: var(--ink-primary);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.bw-search-input::placeholder {
  color: var(--ink-muted);
}

.bw-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

[data-theme="dark"] .bw-search-input:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.bw-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.bw-search-input::-webkit-search-decoration {
  display: none;
}

.bw-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  background-color: transparent;
  transition: background-color 140ms ease, color 140ms ease;
}

.bw-search-clear svg {
  width: 14px;
  height: 14px;
}

/* 카테고리 필터 칩 + 좌우 가로 스크롤 화살표 & 얇은 스크롤바 */
.bw-filter-rail {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.bw-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px;
  min-width: 0;
  max-width: 100%;
  scroll-behavior: smooth;
}

.bw-filter-chips::-webkit-scrollbar {
  height: 5px;
}

.bw-filter-chips::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.bw-filter-chips::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 999px;
}

.bw-filter-chips::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-primary);
}

.bw-filter-arrow {
  flex: 0 0 auto;
  width: 24px;
  height: 26px;
  margin-bottom: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.bw-filter-arrow[hidden] {
  display: none !important;
}

.bw-filter-arrow:active {
  transform: scale(0.92);
}

@media (hover: hover) and (pointer: fine) {
  .bw-filter-arrow:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--ink-on-accent);
  }
}

.bw-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out);
}

.bw-chip:active {
  transform: scale(0.96);
}

.bw-chip.is-active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--ink-on-accent);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.24);
}

[data-theme="dark"] .bw-chip.is-active {
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.24);
}

/* 곡 목록 리스트 */
.bw-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bw-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background-color: transparent;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: background-color 150ms ease, border-color 150ms ease, transform 140ms var(--ease-out);
}

.bw-item:active {
  transform: scale(0.99);
}

.bw-item.is-active {
  background-color: var(--accent-primary-soft);
  border-color: rgba(29, 78, 216, 0.24);
}

[data-theme="dark"] .bw-item.is-active {
  border-color: rgba(96, 165, 250, 0.34);
}

.bw-item.is-playing {
  background-color: var(--accent-sage-soft);
  border-color: rgba(16, 185, 129, 0.38);
}

[data-theme="dark"] .bw-item.is-playing {
  background-color: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.42);
}

/* 스포티파이 스타일 썸네일 (56x36px) */
.bw-item-thumb-wrap,
.bw-item-thumb {
  width: 56px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-player);
}

img.bw-item-thumb,
.bw-item-thumb img,
.bw-item-thumb-wrap img {
  display: block;
  width: 56px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}

/* 로컬 스튜디오 MP3 음표 썸네일 미니 앨범 커버 */
.bw-item-thumb.is-audio-cover,
.bw-item-thumb-wrap.is-audio-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 52%, #2563eb 100%);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  border: 1px solid rgba(129, 140, 248, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.bw-item-thumb.is-audio-cover svg,
.bw-item-thumb-wrap.is-audio-cover svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.36));
}

.bw-item.is-playing .bw-item-thumb.is-audio-cover,
.bw-item.is-playing .bw-item-thumb-wrap.is-audio-cover {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.bw-item-body,
.bw-item-info,
.bw-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bw-item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--ink-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bw-item.is-active .bw-item-title {
  color: var(--accent-primary);
  font-weight: 700;
}

.bw-item.is-playing .bw-item-title {
  color: #047857;
  font-weight: 700;
}

[data-theme="dark"] .bw-item.is-playing .bw-item-title {
  color: #34d399;
}

.bw-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.bw-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background-color: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-hairline);
}

.bw-item-badge.is-sync {
  background-color: var(--accent-sage-soft);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.30);
}

[data-theme="dark"] .bw-item-badge.is-sync {
  background-color: var(--accent-sage-soft);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.34);
}

.bw-item-badge.is-cat {
  background-color: var(--bg-subtle);
  color: var(--ink-secondary);
  border-color: var(--border-hairline);
}

/* 출처별 목록 뱃지 (연습 음원 / 실황 곡·새찬양 / 단곡 / 예배 실황) */
.bw-item-badge.is-studio {
  background-color: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.28);
}

[data-theme="dark"] .bw-item-badge.is-studio {
  background-color: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
  border-color: rgba(165, 180, 252, 0.34);
}

.bw-item-badge.is-clip {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.30);
}

[data-theme="dark"] .bw-item-badge.is-clip {
  background-color: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.34);
}

.bw-item-badge.is-single {
  background-color: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.24);
}

[data-theme="dark"] .bw-item-badge.is-single {
  background-color: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.30);
}

.bw-item-badge.is-set {
  background-color: rgba(100, 116, 139, 0.11);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.24);
}

[data-theme="dark"] .bw-item-badge.is-set {
  background-color: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.28);
}

.bw-item-badge.is-sasamo {
  background-color: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.30);
}

[data-theme="dark"] .bw-item-badge.is-sasamo {
  background-color: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.32);
}

.bw-item-badge.is-churchtv {
  background-color: rgba(190, 24, 93, 0.10);
  color: #be185d;
  border-color: rgba(190, 24, 93, 0.26);
}

[data-theme="dark"] .bw-item-badge.is-churchtv {
  background-color: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
  border-color: rgba(244, 114, 182, 0.32);
}

/* 3막대 애니메이션 이퀄라이저 */
.bw-item-eq {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 16px;
  height: 14px;
  flex-shrink: 0;
}

.bw-item-eq > * {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background-color: #10b981;
  transform-origin: bottom center;
  animation: bwEqBounce 0.85s var(--ease-out) infinite;
}

[data-theme="dark"] .bw-item-eq > * {
  background-color: #34d399;
}

.bw-item-eq > *:nth-child(1) {
  animation-duration: 0.82s;
  animation-delay: 0s;
}

.bw-item-eq > *:nth-child(2) {
  animation-duration: 0.64s;
  animation-delay: 0.16s;
}

.bw-item-eq > *:nth-child(3) {
  animation-duration: 0.76s;
  animation-delay: 0.32s;
}

.bw-item:not(.is-playing) .bw-item-eq > * {
  animation-play-state: paused;
  transform: scaleY(0.32);
  opacity: 0.55;
}

@keyframes bwEqBounce {
  0%, 100% {
    transform: scaleY(0.24);
  }
  35% {
    transform: scaleY(1);
  }
  68% {
    transform: scaleY(0.46);
  }
  86% {
    transform: scaleY(0.84);
  }
}

.bw-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 공식 채널 폴백 검색 카드 */
.bw-official-fallback {
  margin: 10px 6px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.bw-official-fallback[hidden] {
  display: none !important;
}

.bw-official-fallback-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bw-official-fallback-sub,
.bw-official-fallback-desc {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-secondary);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bw-official-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  min-width: 0;
}

.bw-official-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(29, 78, 216, 0.24);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  color: var(--accent-primary);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out), box-shadow 150ms ease;
}

.bw-official-link-btn:active {
  transform: scale(0.97);
}

.bw-official-link-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bw-official-link-btn.is-primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--ink-on-accent);
}

[data-theme="dark"] .bw-official-link-btn {
  background-color: var(--bg-elevated);
  border-color: rgba(96, 165, 250, 0.34);
  color: #93c5fd;
}

[data-theme="dark"] .bw-official-link-btn.is-primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--ink-on-accent);
}

/* ============================================================================
 * 3. 우측 플레이어 & 실시간 싱크 가사 스테이지
 * ============================================================================ */
.bw-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.bw-player-card {
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.bw-player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.bw-now-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bw-now-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bw-now-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-secondary);
  word-break: keep-all;
  overflow-wrap: break-word;
  min-width: 0;
}

.bw-now-sub[hidden] {
  display: none !important;
}

/* 상단 이 곡만 무한반복 상태 뱃지 */
.bw-repeat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.28);
}

.bw-repeat-pill[hidden] {
  display: none !important;
}

.bw-repeat-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

[data-theme="dark"] .bw-repeat-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.36);
}

.bw-now-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.bw-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* 유튜브 반응형 스테이지 (일반 16:9 & 콤팩트 미니 영상 모드) */
.bw-yt-stage {
  position: relative;
  max-width: 720px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background-color: #0f172a;
  margin: 0 auto;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
  transition: max-width 240ms var(--ease-out), height 240ms var(--ease-out);
}

.bw-yt-stage.is-compact {
  max-width: 280px;
  width: 100%;
  height: 200px;
  aspect-ratio: 16 / 9;
}

/* v35: 유튜브 임베드는 최소 200×200px 이어야 재생이 보장된다 (휴대폰 세로 화면에서 16:9 높이가 200px 미만이 됨) */
.bw-yt-stage {
  min-height: 200px;
}

.bw-yt-frame-box {
  position: relative;
  width: 100%;
  height: 100%;
}

.bw-yt-frame-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.bw-yt-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #1e293b 0%, #0f172a 76%);
  color: var(--ink-on-dark-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.bw-yt-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.94));
  color: var(--ink-on-dark);
  font-size: 13.5px;
  line-height: 1.5;
}

.bw-yt-fallback a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background-color: #ef4444;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* 로컬 스튜디오 연습 음원 전용 스테이지 */
.bw-studio-stage {
  position: relative;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  color: #f8fafc;
  border: 1px solid rgba(147, 197, 253, 0.24);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  min-width: 0;
}

.bw-yt-stage[hidden],
.bw-studio-stage[hidden] {
  display: none !important;
}

.bw-studio-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 18%, rgba(96, 165, 250, 0.28) 0%, transparent 56%);
  pointer-events: none;
  z-index: 0;
}

.bw-studio-stage > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.bw-studio-stage > div:not(.bw-studio-eq),
.bw-studio-meta,
.bw-studio-info,
.bw-studio-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.bw-studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(191, 219, 254, 0.28);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 100%;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.bw-studio-stage.is-playing .bw-studio-badge {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.46);
  color: #a7f3d0;
}

.bw-studio-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: #ffffff;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

.bw-studio-sub {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.86);
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* 재생 중 살아 움직이는 5막대 스튜디오 EQ */
.bw-studio-eq {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 40px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid rgba(147, 197, 253, 0.22);
  flex-shrink: 0;
}

.bw-studio-eq > * {
  display: block;
  width: 4px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bfdbfe 0%, #60a5fa 100%);
  transform-origin: bottom center;
  opacity: 0.56;
  transition: opacity 200ms ease, transform 200ms ease;
}

.bw-studio-eq > *:nth-child(1) {
  transform: scaleY(0.34);
}

.bw-studio-eq > *:nth-child(2) {
  transform: scaleY(0.62);
}

.bw-studio-eq > *:nth-child(3) {
  transform: scaleY(0.46);
}

.bw-studio-eq > *:nth-child(4) {
  transform: scaleY(0.72);
}

.bw-studio-eq > *:nth-child(5) {
  transform: scaleY(0.38);
}

.bw-studio-stage.is-playing .bw-studio-eq > *,
.bw-studio-eq.is-playing > *,
.bw-player-card.is-playing .bw-studio-eq > * {
  opacity: 1;
  background: linear-gradient(180deg, #a7f3d0 0%, #34d399 55%, #10b981 100%);
  animation: bwStudioEqBounce 0.85s var(--ease-out) infinite;
}

.bw-studio-stage.is-playing .bw-studio-eq > *:nth-child(1),
.bw-studio-eq.is-playing > *:nth-child(1),
.bw-player-card.is-playing .bw-studio-eq > *:nth-child(1) {
  animation-duration: 0.86s;
  animation-delay: 0s;
}

.bw-studio-stage.is-playing .bw-studio-eq > *:nth-child(2),
.bw-studio-eq.is-playing > *:nth-child(2),
.bw-player-card.is-playing .bw-studio-eq > *:nth-child(2) {
  animation-duration: 0.66s;
  animation-delay: 0.12s;
}

.bw-studio-stage.is-playing .bw-studio-eq > *:nth-child(3),
.bw-studio-eq.is-playing > *:nth-child(3),
.bw-player-card.is-playing .bw-studio-eq > *:nth-child(3) {
  animation-duration: 0.78s;
  animation-delay: 0.24s;
}

.bw-studio-stage.is-playing .bw-studio-eq > *:nth-child(4),
.bw-studio-eq.is-playing > *:nth-child(4),
.bw-player-card.is-playing .bw-studio-eq > *:nth-child(4) {
  animation-duration: 0.60s;
  animation-delay: 0.08s;
}

.bw-studio-stage.is-playing .bw-studio-eq > *:nth-child(5),
.bw-studio-eq.is-playing > *:nth-child(5),
.bw-player-card.is-playing .bw-studio-eq > *:nth-child(5) {
  animation-duration: 0.82s;
  animation-delay: 0.18s;
}

@keyframes bwStudioEqBounce {
  0%, 100% {
    transform: scaleY(0.22);
  }
  28% {
    transform: scaleY(0.96);
  }
  54% {
    transform: scaleY(0.42);
  }
  78% {
    transform: scaleY(0.84);
  }
}

/* ============================================================================
 * 4. 커스텀 트랜스포트, 시크바 & 연습 툴바
 * ============================================================================ */
.bw-transport {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.bw-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.bw-time {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  min-width: 42px;
  flex-shrink: 0;
  line-height: 1;
}

.bw-progress-row > .bw-time:last-child {
  text-align: right;
}

.bw-seek-wrap {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 0;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
}

.bw-seek-bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background-color: var(--bg-subtle-hover);
  cursor: pointer;
  overflow: visible;
}

[data-theme="dark"] .bw-seek-bar {
  background-color: var(--bg-subtle);
}

.bw-seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary) 0%, #3b82f6 100%);
  pointer-events: none;
}

[data-theme="dark"] .bw-seek-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

/* 앰버 골드 A-B 구간 표시 */
.bw-seek-ab {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 0%;
  border-radius: 999px;
  background-color: rgba(245, 158, 11, 0.42);
  border-left: 2.5px solid #d97706;
  border-right: 2.5px solid #d97706;
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.25);
  pointer-events: none;
  z-index: 2;
}

[data-theme="dark"] .bw-seek-ab {
  background-color: rgba(251, 191, 36, 0.36);
  border-left-color: #fbbf24;
  border-right-color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.30);
}

.bw-seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 3px solid var(--accent-primary);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
  pointer-events: none;
  z-index: 3;
  transition: transform 140ms var(--ease-out), box-shadow 140ms ease;
}

.bw-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* 공통 플레이어 버튼 */
.bw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.bw-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.bw-btn:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.bw-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bw-btn.is-primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--ink-on-accent);
}

.bw-btn.is-active {
  background-color: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

.bw-btn.is-playing {
  background-color: #10b981;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.24), 0 4px 12px rgba(16, 185, 129, 0.34);
}

.bw-btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.bw-btn-sm svg {
  width: 14px;
  height: 14px;
}

.bw-btn-icon {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.bw-btn-icon.bw-btn-sm {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: var(--radius-sm);
}

/* 46px 메인 원형 재생 버튼 (인디고 -> 재생 중 에메랄드 #10b981 + 글로우 링) */
.bw-play-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: var(--accent-primary);
  border: 2px solid transparent;
  color: var(--ink-on-accent);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background-color 180ms ease, box-shadow 200ms ease, color 180ms ease;
}

.bw-play-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.bw-play-btn svg {
  width: 20px;
  height: 20px;
}

.bw-play-btn.is-playing {
  background-color: #10b981;
  background-image: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.26), 0 6px 18px rgba(16, 185, 129, 0.38);
}

[data-theme="dark"] .bw-play-btn.is-playing {
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.30), 0 6px 20px rgba(16, 185, 129, 0.44);
}

/* 보조 도구 행 (A-B 반복 / 속도 / 재생 모드) */
.bw-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-hairline);
  min-width: 0;
  max-width: 100%;
}

.bw-ab-group,
.bw-speed-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  max-width: 100%;
}

.bw-ab-group .bw-btn.is-active {
  background-color: var(--accent-brass-soft);
  border-color: var(--accent-brass);
  color: var(--accent-brass);
}

.bw-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out);
}

.bw-mode-btn:active {
  transform: scale(0.96);
}

.bw-mode-btn.is-active {
  background-color: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

/* 원터치 핵심 버튼: [이 곡만 무한반복] */
.bw-repeat-one-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-pill, 999px);
  border: 1.5px solid var(--border-strong);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.bw-repeat-one-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.bw-repeat-one-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.36);
}

.bw-repeat-one-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

[data-theme="dark"] .bw-repeat-one-btn {
  background-color: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.bw-repeat-one-btn.is-active,
.bw-btn.bw-repeat-one-btn.is-active,
.bw-mode-btn.bw-repeat-one-btn.is-active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.35);
  text-shadow: 0 1px 1px rgba(120, 53, 15, 0.28);
}

[data-theme="dark"] .bw-repeat-one-btn.is-active,
[data-theme="dark"] .bw-btn.bw-repeat-one-btn.is-active,
[data-theme="dark"] .bw-mode-btn.bw-repeat-one-btn.is-active {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #ffffff;
  border-color: #fbbf24;
  box-shadow: 0 2px 14px rgba(245, 158, 11, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.28);
  text-shadow: 0 1px 1px rgba(69, 26, 3, 0.35);
}

/* ============================================================================
 * 5. 챕터 칩 & 아카이브 콘티 힌트
 * ============================================================================ */
.bw-chapters-card {
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
}

.bw-chapters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.bw-chapters-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.bw-chapter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-elevated);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out);
}

.bw-chapter-chip:active {
  transform: scale(0.96);
}

.bw-chapter-chip.is-active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--ink-on-accent);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.24);
}

[data-theme="dark"] .bw-chapter-chip.is-active {
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.26);
}

.bw-conti-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary-soft);
  border: 1px solid rgba(29, 78, 216, 0.16);
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.45;
  min-width: 0;
  max-width: 100%;
}

[data-theme="dark"] .bw-conti-hint {
  border-color: rgba(96, 165, 250, 0.26);
}

.bw-conti-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 1px solid rgba(29, 78, 216, 0.26);
  color: var(--accent-primary);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

[data-theme="dark"] .bw-conti-hint-pill {
  border-color: rgba(96, 165, 250, 0.34);
}

/* ============================================================================
 * 6. 실시간 싱크 가사 카드 (핵심 히어로 영역)
 * ============================================================================ */
.bw-lyrics-card {
  position: relative;
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.bw-lyrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-hairline);
  background-color: var(--bg-elevated);
  min-width: 0;
}

.bw-lyrics-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.bw-lyrics-title-group h3,
.bw-lyrics-title-group strong {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
}

.bw-lyrics-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  background-color: var(--accent-sage-soft);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.30);
}

[data-theme="dark"] .bw-lyrics-badge {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.34);
}

.bw-lyrics-badge.is-muted,
.bw-lyrics-badge.is-plain {
  background-color: var(--bg-subtle);
  color: var(--ink-secondary);
  border-color: var(--border-hairline);
}

.bw-lyrics-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* 수동 스크롤 시 뜨는 현재 가사 복귀 플로팅 필 버튼 */
.bw-lyrics-return-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-primary);
  color: var(--ink-on-accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 8px 22px rgba(29, 78, 216, 0.34);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease;
}

.bw-lyrics-return-btn:active {
  transform: scale(0.96);
}

[data-theme="dark"] .bw-lyrics-return-btn {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
}

.bw-lyrics-scroll {
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bw-lyric-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  border-left: 3.5px solid transparent;
  background-color: transparent;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease, font-size 180ms ease, transform 180ms var(--ease-out);
}

.bw-lyric-line.is-past {
  opacity: 0.52;
}

.bw-lyric-line.is-active {
  opacity: 1;
  background-color: var(--accent-primary-soft);
  border-left-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.14);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--accent-primary);
}

[data-theme="dark"] .bw-lyric-line.is-active {
  background-color: rgba(37, 99, 235, 0.22);
  border-left-color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

.bw-lyric-line.is-loop-target {
  opacity: 1;
  background-color: var(--accent-brass-soft);
  border-color: rgba(217, 119, 6, 0.45);
  border-left-color: var(--accent-brass);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.14);
}

[data-theme="dark"] .bw-lyric-line.is-loop-target {
  background-color: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.48);
  border-left-color: #fbbf24;
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.16);
}

.bw-lyric-line.is-active.is-loop-target {
  border-left-color: var(--accent-brass);
  box-shadow: 0 0 0 1.5px rgba(217, 119, 6, 0.42);
}

[data-theme="dark"] .bw-lyric-line.is-active.is-loop-target {
  border-left-color: #fbbf24;
  box-shadow: 0 0 0 1.5px rgba(251, 191, 36, 0.48);
}

.bw-lyric-ts {
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  flex-shrink: 0;
  color: var(--ink-muted);
  line-height: 1.2;
}

.bw-lyric-line.is-active .bw-lyric-ts {
  color: var(--accent-primary);
  font-weight: 700;
}

[data-theme="dark"] .bw-lyric-line.is-active .bw-lyric-ts {
  color: #93c5fd;
}

.bw-lyric-line.is-loop-target .bw-lyric-ts {
  color: var(--accent-brass);
  font-weight: 700;
}

.bw-lyric-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bw-lyric-loop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface, var(--surface-card, #ffffff));
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.36;
  transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.bw-lyric-line.is-active .bw-lyric-loop-btn,
.bw-lyric-line:focus-within .bw-lyric-loop-btn,
.bw-lyric-line.is-loop-target .bw-lyric-loop-btn,
.bw-lyric-loop-btn.is-active {
  opacity: 1;
}

.bw-lyric-line.is-loop-target .bw-lyric-loop-btn,
.bw-lyric-loop-btn.is-active {
  background-color: var(--accent-brass-soft);
  border-color: var(--accent-brass);
  color: var(--accent-brass);
}

.bw-lyrics-empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================================
 * 7. 애플뮤직 스타일 풀스크린 가사 오버레이
 * ============================================================================ */
.bw-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: linear-gradient(165deg, #0b1120 0%, #132043 52%, #0f172a 100%);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bw-fs-overlay[hidden] {
  display: none !important;
}

.bw-fs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  background: rgba(11, 17, 32, 0.58);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  flex-shrink: 0;
  min-width: 0;
}

.bw-fs-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-fs-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: rgba(226, 232, 240, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-fs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 28vh 20px 32vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000000 10%, #000000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000000 10%, #000000 90%, transparent 100%);
}

.bw-fs-line {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: clamp(18px, 3.2vw, 26px);
  font-weight: 600;
  line-height: 1.42;
  color: rgba(248, 250, 252, 0.42);
  padding: 12px 16px;
  border-radius: 14px;
  border: 0;
  background-color: transparent;
  text-align: center;
  cursor: pointer;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: transform 220ms ease, color 220ms ease, background-color 220ms ease, text-shadow 220ms ease;
}

.bw-fs-line.is-past {
  color: rgba(248, 250, 252, 0.28);
}

.bw-fs-line.is-active {
  color: #ffffff;
  font-weight: 800;
  transform: scale(1.06);
  background-color: rgba(59, 130, 246, 0.18);
  text-shadow: 0 2px 18px rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.24);
}

.bw-fs-line.is-loop-target {
  box-shadow: 0 0 0 1.5px rgba(251, 191, 36, 0.58);
}

.bw-fs-ts {
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: rgba(148, 163, 184, 0.68);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.bw-fs-line.is-active .bw-fs-ts {
  color: #93c5fd;
}

.bw-fs-text {
  display: block;
  width: 100%;
  word-break: keep-all;
}

.bw-fs-foot {
  flex-shrink: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 17, 32, 0.74);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bw-fs-progress {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bw-fs-controls {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* 풀스크린 다크 글래스 내부 컨트롤 명암비 보장 (앱 라이트모드에서도 선명) */
.bw-fs-overlay .bw-time {
  color: rgba(226, 232, 240, 0.88);
}

.bw-fs-overlay .bw-seek-bar {
  background-color: rgba(148, 163, 184, 0.28);
}

.bw-fs-overlay .bw-seek-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.bw-fs-overlay .bw-seek-thumb {
  background-color: #ffffff;
  border-color: #60a5fa;
}

.bw-fs-overlay .bw-btn {
  background-color: rgba(248, 250, 252, 0.10);
  border-color: rgba(148, 163, 184, 0.24);
  color: #f8fafc;
}

.bw-fs-overlay .bw-btn.is-active {
  background-color: rgba(59, 130, 246, 0.26);
  border-color: #60a5fa;
  color: #bfdbfe;
}

.bw-fs-overlay .bw-repeat-pill {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.38);
}

.bw-fs-overlay .bw-repeat-one-btn {
  background-color: rgba(248, 250, 252, 0.10);
  border-color: rgba(148, 163, 184, 0.34);
  color: #f8fafc;
}

.bw-fs-overlay .bw-repeat-one-btn.is-active,
.bw-fs-overlay .bw-btn.bw-repeat-one-btn.is-active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 2px 14px rgba(245, 158, 11, 0.45);
}

.bw-fs-overlay .bw-play-btn {
  background-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.38);
}

.bw-fs-overlay .bw-play-btn.is-playing {
  background-color: #10b981;
  background-image: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.30), 0 6px 20px rgba(16, 185, 129, 0.44);
}

/* ============================================================================
 * 8. 포인터 호버 인터랙션 (터치 기기 잔상 방지)
 * ============================================================================ */
@media (hover: hover) and (pointer: fine) {
  .bw-search-clear:hover {
    background-color: var(--bg-subtle-hover);
    color: var(--ink-primary);
  }

  .bw-chip:hover:not(.is-active) {
    background-color: var(--bg-subtle-hover);
    color: var(--ink-primary);
  }

  .bw-item:hover:not(.is-active):not(.is-playing) {
    background-color: var(--bg-subtle);
  }

  .bw-seek-wrap:hover .bw-seek-thumb {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.20);
  }

  [data-theme="dark"] .bw-seek-wrap:hover .bw-seek-thumb {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.28);
  }

  .bw-btn:hover:not(:disabled):not(.is-primary):not(.is-playing):not(.is-active) {
    background-color: var(--bg-subtle-hover);
    border-color: var(--border-strong);
  }

  .bw-btn.is-primary:hover:not(:disabled) {
    background-color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
  }

  .bw-play-btn:hover:not(:disabled):not(.is-playing) {
    background-color: var(--accent-primary-hover);
    transform: scale(1.05);
  }

  .bw-play-btn.is-playing:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.32), 0 6px 22px rgba(16, 185, 129, 0.46);
  }

  .bw-mode-btn:hover:not(.is-active),
  .bw-chapter-chip:hover:not(.is-active) {
    background-color: var(--bg-subtle-hover);
    color: var(--ink-primary);
  }

  .bw-repeat-one-btn:hover:not(:disabled):not(.is-active),
  .bw-btn.bw-repeat-one-btn:hover:not(:disabled):not(.is-active) {
    background-color: rgba(245, 158, 11, 0.10);
    border-color: #d97706;
    color: #b45309;
  }

  [data-theme="dark"] .bw-repeat-one-btn:hover:not(:disabled):not(.is-active),
  [data-theme="dark"] .bw-btn.bw-repeat-one-btn:hover:not(:disabled):not(.is-active) {
    background-color: rgba(245, 158, 11, 0.16);
    border-color: #fbbf24;
    color: #fcd34d;
  }

  .bw-repeat-one-btn.is-active:hover:not(:disabled),
  .bw-btn.bw-repeat-one-btn.is-active:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.44);
  }

  .bw-official-link-btn:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--ink-on-accent);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.22);
  }

  [data-theme="dark"] .bw-official-link-btn:hover {
    background-color: rgba(59, 130, 246, 0.28);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.26);
  }

  .bw-conti-hint-pill:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--ink-on-accent);
  }

  .bw-lyrics-return-btn:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-2px);
  }

  .bw-lyric-line:hover:not(.is-active):not(.is-loop-target) {
    background-color: var(--bg-subtle);
    opacity: 0.92;
  }

  .bw-lyric-line:hover .bw-lyric-loop-btn {
    opacity: 1;
  }

  .bw-lyric-loop-btn:hover {
    opacity: 1;
    background-color: var(--accent-brass-soft);
    border-color: var(--accent-brass);
    color: var(--accent-brass);
  }

  .bw-fs-line:hover:not(.is-active) {
    color: rgba(248, 250, 252, 0.80);
    background-color: rgba(248, 250, 252, 0.06);
  }

  .bw-fs-overlay .bw-btn:hover:not(:disabled):not(.is-active) {
    background-color: rgba(248, 250, 252, 0.18);
    border-color: rgba(248, 250, 252, 0.34);
  }
}

@media (hover: none) {
  .bw-lyric-loop-btn {
    opacity: 0.82;
  }
}

/* ============================================================================
 * 9. 반응형 & 모바일 390px 가로 넘침 0px 보장
 * ============================================================================ */
@media (max-width: 980px) {
  .bw-shell,
  .bw-shell * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bw-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .bw-play-btn {
    min-width: 46px;
  }

  .bw-time,
  .bw-lyric-ts {
    min-width: 42px;
  }

  .bw-rail {
    position: static;
    top: auto;
    max-height: 360px;
  }

  .bw-lyrics-scroll {
    max-height: 380px;
  }
}

@media (max-width: 640px) {
  .bw-shell,
  .bw-shell * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bw-shell {
    gap: 12px;
  }

  .bw-rail {
    max-height: 330px;
    border-radius: var(--radius-md);
  }

  .bw-rail-head {
    padding: 12px 12px 9px;
    gap: 8px;
  }

  .bw-list {
    padding: 6px;
  }

  .bw-item {
    padding: 7px 8px;
    gap: 9px;
  }

  .bw-official-fallback {
    margin: 8px 4px;
    padding: 12px;
  }

  .bw-official-fallback-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bw-official-link-btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .bw-player-card {
    padding: 12px;
    gap: 11px;
    border-radius: var(--radius-md);
  }

  .bw-player-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .bw-now-title {
    font-size: 16px;
  }

  .bw-now-sub {
    font-size: 12px;
  }

  .bw-head-actions {
    justify-content: flex-start;
  }

  .bw-yt-stage.is-compact {
    max-width: 260px;
    height: 200px;
  }

  .bw-studio-stage {
    padding: 16px;
    border-radius: 12px;
    gap: 12px;
  }

  .bw-studio-title {
    font-size: 16px;
  }

  .bw-studio-sub {
    font-size: 12px;
  }

  .bw-studio-eq {
    height: 34px;
    padding: 6px 8px;
    gap: 3px;
  }

  .bw-studio-eq > * {
    width: 3.5px;
    height: 20px;
  }

  .bw-progress-row {
    gap: 7px;
  }

  .bw-time {
    min-width: 38px;
    font-size: 11.5px;
  }

  .bw-controls-row {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .bw-controls-row .bw-btn {
    padding: 5px 7px;
    font-size: 11.5px;
    min-height: 32px;
  }

  .bw-controls-row .bw-btn-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
  }

  .bw-play-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .bw-tools-row {
    gap: 6px;
    justify-content: flex-start;
  }

  .bw-ab-group,
  .bw-speed-group {
    width: 100%;
    justify-content: flex-start;
  }

  .bw-ab-group .bw-btn,
  .bw-speed-group .bw-btn {
    padding: 5px 8px;
    font-size: 11.5px;
    min-height: 29px;
  }

  .bw-repeat-one-btn {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12.5px;
    gap: 5px;
    max-width: 100%;
  }

  .bw-chapters-card {
    padding: 11px 12px;
    border-radius: var(--radius-md);
  }

  .bw-chapters-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .bw-chapters-list::-webkit-scrollbar {
    display: none;
  }

  .bw-lyrics-card {
    border-radius: var(--radius-md);
  }

  .bw-lyrics-head {
    padding: 11px 12px;
    gap: 8px;
  }

  .bw-lyrics-scroll {
    max-height: 360px;
    padding: 10px 8px;
  }

  .bw-lyric-line {
    gap: 8px;
    padding: 9px 10px;
  }

  .bw-lyric-line.is-active {
    font-size: 1.05rem;
  }

  .bw-lyric-ts {
    min-width: 38px;
    font-size: 11px;
  }

  .bw-lyric-loop-btn {
    padding: 3px 7px;
    font-size: 10.5px;
  }

  .bw-lyrics-return-btn {
    right: 12px;
    bottom: 12px;
    padding: 7px 12px;
    font-size: 12px;
  }

  .bw-fs-head {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  }

  .bw-fs-body {
    padding: 24vh 14px 28vh;
  }

  .bw-fs-line {
    padding: 10px 12px;
  }

  .bw-fs-line.is-active {
    transform: scale(1.03);
  }

  .bw-fs-foot {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

/* 모션 축소 접근성 대응 */
@media (prefers-reduced-motion: reduce) {
  .bw-item-eq > * {
    animation: none;
    transform: scaleY(0.75);
  }

  .bw-studio-stage.is-playing .bw-studio-eq > *,
  .bw-studio-eq.is-playing > *,
  .bw-player-card.is-playing .bw-studio-eq > * {
    animation: none;
  }

  .bw-lyrics-scroll,
  .bw-fs-body {
    scroll-behavior: auto;
  }

  .bw-fs-line.is-active {
    transform: none;
  }
}

/* ============================================================================
 * 10. OLED 주머니 절전 듣기 오버레이 (.bw-pocket-overlay)
 * ============================================================================ */
.bw-pocket-overlay,
.bw-pocket-overlay *,
.bw-pocket-overlay *::before,
.bw-pocket-overlay *::after {
  box-sizing: border-box;
}

.bw-pocket-overlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: #000000;
  color: rgba(248, 250, 252, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.bw-pocket-overlay[hidden],
.bw-pocket-overlay [hidden] {
  display: none !important;
}

.bw-pocket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  flex-shrink: 0;
  min-width: 0;
  transition: opacity 220ms ease;
}

.bw-pocket-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.68);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-pocket-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  min-width: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.78);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms ease;
}

.bw-pocket-close:active {
  transform: scale(0.96);
}

.bw-pocket-center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 12px 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 0;
  min-width: 0;
}

.bw-pocket-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.78);
  line-height: 1.35;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: opacity 220ms ease;
}

.bw-pocket-sub {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.65);
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: opacity 220ms ease;
}

.bw-pocket-lyric-cur {
  margin: 12px 0 0;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  color: rgba(248, 250, 252, 0.86);
  line-height: 1.45;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: opacity 220ms ease, color 220ms ease;
}

.bw-pocket-lyric-next {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.45);
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: opacity 220ms ease;
}

.bw-pocket-time {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-variant-numeric: tabular-nums;
  color: rgba(148, 163, 184, 0.6);
  line-height: 1.25;
  transition: opacity 220ms ease;
}

.bw-pocket-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  flex-shrink: 0;
  transition: opacity 220ms ease;
}

.bw-pocket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.85);
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms ease;
}

.bw-pocket-btn:active {
  transform: scale(0.96);
}

.bw-pocket-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bw-pocket-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bw-pocket-btn.is-playing {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

.bw-pocket-btn.is-active {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.bw-pocket-lock-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  flex-shrink: 0;
}

.bw-pocket-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 200px;
  max-width: 100%;
  padding: 0 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(248, 250, 252, 0.84);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 220ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms ease;
}

.bw-pocket-lock-btn:active {
  transform: scale(0.97);
}

.bw-pocket-unlock-hint {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  color: rgba(148, 163, 184, 0.55);
  word-break: keep-all;
  transition: opacity 220ms ease, color 220ms ease;
}

.bw-pocket-close:focus-visible,
.bw-pocket-btn:focus-visible,
.bw-pocket-lock-btn:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.72);
  outline-offset: 2px;
}

/* 오터치 잠금 상태 (OLED 초저전력 & 오터치 차단) */
.bw-pocket-overlay.is-locked .bw-pocket-top,
.bw-pocket-overlay.is-locked .bw-pocket-controls,
.bw-pocket-overlay.is-locked .bw-pocket-lock-btn {
  opacity: 0.12;
  pointer-events: none;
}

.bw-pocket-overlay.is-locked .bw-pocket-title,
.bw-pocket-overlay.is-locked .bw-pocket-sub,
.bw-pocket-overlay.is-locked .bw-pocket-lyric-next,
.bw-pocket-overlay.is-locked .bw-pocket-time {
  opacity: 0.30;
}

.bw-pocket-overlay.is-locked .bw-pocket-lyric-cur {
  opacity: 0.45;
}

.bw-pocket-overlay.is-locked .bw-pocket-unlock-hint {
  opacity: 1;
  color: rgba(148, 163, 184, 0.65);
}

@media (hover: hover) and (pointer: fine) {
  .bw-pocket-close:hover,
  .bw-pocket-btn:hover:not(:disabled):not(.is-playing):not(.is-active),
  .bw-pocket-lock-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    color: rgba(248, 250, 252, 0.94);
  }

  .bw-pocket-btn.is-playing:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.36);
    border-color: rgba(52, 211, 153, 0.68);
  }

  .bw-pocket-btn.is-active:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.32);
    border-color: rgba(251, 191, 36, 0.68);
  }
}

@media (max-width: 640px) {
  .bw-pocket-overlay {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .bw-pocket-controls {
    gap: 8px;
  }

  .bw-pocket-btn {
    min-height: 42px;
    padding: 0 13px;
    font-size: 13px;
  }

  .bw-pocket-lock-btn {
    min-height: 46px;
    min-width: 184px;
    padding: 0 20px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-pocket-top,
  .bw-pocket-close,
  .bw-pocket-title,
  .bw-pocket-sub,
  .bw-pocket-lyric-cur,
  .bw-pocket-lyric-next,
  .bw-pocket-time,
  .bw-pocket-controls,
  .bw-pocket-btn,
  .bw-pocket-lock-btn,
  .bw-pocket-unlock-hint {
    transition: none;
  }
}

/* ============================================================================
 * 11. 안드로이드 PiP 미니창 전용 뷰 (body.is-android-pip)
 * ============================================================================ */
body.is-android-pip {
  background: #000000 !important;
  overflow: hidden !important;
}

body.is-android-pip .topbar,
body.is-android-pip .bw-rail,
body.is-android-pip .bw-player-head,
body.is-android-pip .bw-transport,
body.is-android-pip .bw-chapters-card,
body.is-android-pip .bw-lyrics-card,
body.is-android-pip #playerDock {
  display: none !important;
}

body.is-android-pip .main-wrap,
body.is-android-pip .bw-shell,
body.is-android-pip .bw-stage,
body.is-android-pip .bw-player-card {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000000 !important;
  box-shadow: none !important;
  gap: 0 !important;
}

body.is-android-pip .bw-shell {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
}

body.is-android-pip .bw-yt-stage,
body.is-android-pip .bw-yt-stage.is-compact {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000000 !important;
  box-shadow: none !important;
}

/* ============================================================================
 * 12. 음량 조절 슬라이더 · 음소거 컨트롤 (유튜브 + 연습 음원 통합 연동)
 * ============================================================================ */
.bw-vol-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-elevated);
  min-height: 32px;
  max-width: 100%;
  box-sizing: border-box;
}

.bw-vol-mute-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: var(--ink-secondary);
}

.bw-vol-mute-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--ink-primary);
}

.bw-vol-mute-btn.is-muted {
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .bw-vol-mute-btn.is-muted {
  color: #f87171;
  background-color: rgba(248, 113, 113, 0.16);
}

.bw-vol-slider {
  width: 82px;
  height: 5px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin: 0;
  flex-shrink: 1;
}

.bw-vol-pct {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  min-width: 34px;
  text-align: right;
}

@media (max-width: 640px) {
  .bw-vol-group {
    width: 100%;
    padding: 3px 10px 3px 5px;
    justify-content: space-between;
  }
  .bw-vol-slider {
    flex: 1;
    width: auto;
    min-width: 100px;
  }
}

/* ============================================================================
 * 13. [찬양 듣기] 하단 고정 도킹 플레이어 (#bwPlayerDock) & 이동식 미니 가사 창
 *     공통 레이아웃(.player-dock / .floating-lyric-bar 등)은 styles.css 상속
 * ============================================================================ */
.bw-player-dock,
.bw-player-dock *,
.bw-player-dock *::before,
.bw-player-dock *::after,
.bw-floating-lyric-bar,
.bw-floating-lyric-bar *,
.bw-floating-lyric-bar *::before,
.bw-floating-lyric-bar *::after {
  box-sizing: border-box;
}

.bw-player-dock {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bw-player-dock[hidden],
.bw-player-dock [hidden],
.bw-floating-lyric-bar[hidden],
.bw-floating-lyric-bar [hidden] {
  display: none !important;
}

/* 곡 선택 팝업(#bwDockSongPickerMenu)이 이동식 미니 가사 창(z-index: 95) 위로 뜨도록 보장 */
.bw-player-dock.is-picker-open {
  z-index: 125;
}

/* 안드로이드 PiP 미니창에서는 하단 독·미니 가사 창 숨김 */
body.is-android-pip #bwPlayerDock,
body.is-android-pip #bwFloatingLyricBar {
  display: none !important;
}

/* [찬양 듣기] 탭 활성화 시 본문 하단 여백 확보 (고정 도킹 플레이어 가림 방지) */
body.is-beloved-tab .main-wrap {
  padding-bottom: 112px;
}

/* ----------------------------------------------------------------------------
 * 13-1. 하단 독 인터랙티브 시크바 (.bw-dock-seek-*)
 * ---------------------------------------------------------------------------- */
.bw-dock-seek-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: #0A111D;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.bw-dock-seek-wrap:focus-visible {
  outline: 2px solid #60A5FA;
  outline-offset: 2px;
  border-color: rgba(96, 165, 250, 0.65);
}

.bw-dock-seek-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
}

.bw-dock-seek-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8 0%, #3B82F6 100%);
  pointer-events: none;
  z-index: 1;
}

.bw-dock-seek-ab {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(251, 191, 36, 0.48);
  border-left: 2px solid #FBBF24;
  border-right: 2px solid #FBBF24;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

.bw-dock-seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #38BDF8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.72);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.bw-dock-seek-wrap.is-seeking .bw-dock-seek-thumb {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.92);
}

@media (hover: hover) and (pointer: fine) {
  .bw-dock-seek-wrap:hover {
    border-color: rgba(148, 163, 184, 0.44);
  }
  .bw-dock-seek-wrap:hover .bw-dock-seek-thumb {
    transform: translate(-50%, -50%) scale(1.12);
  }
}

/* ----------------------------------------------------------------------------
 * 13-2. 상향 곡 선택 팝업(#bwDockSongPickerMenu) 검색 & 배지
 * ---------------------------------------------------------------------------- */
.bw-dock-picker-search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.55);
}

.bw-dock-picker-search {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  color: #F8FAFC;
  font-size: 12.5px;
  line-height: 1.35;
  font-family: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.bw-dock-picker-search::placeholder {
  color: #94A3B8;
}

.bw-dock-picker-search:focus {
  border-color: #60A5FA;
  outline: none;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.24);
}

.bw-dock-lyric-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.20);
  color: #6EE7B7;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

.bw-dock-picker-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: #94A3B8;
}

#bwDockSongPickerMenu .dock-song-picker-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}

#bwDockSongPickerMenu .dock-song-picker-list::-webkit-scrollbar {
  width: 6px;
}

#bwDockSongPickerMenu .dock-song-picker-list::-webkit-scrollbar-track {
  background: transparent;
}

#bwDockSongPickerMenu .dock-song-picker-list::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.34);
  border-radius: 999px;
}

/* ----------------------------------------------------------------------------
 * 13-3. 이동식 미니 가사 창 (#bwFloatingLyricBar / .bw-floating-lyric-bar)
 * ---------------------------------------------------------------------------- */
.bw-floating-lyric-bar {
  z-index: 95;
}

.bw-floating-lyric-bar:not(.is-dragged) {
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.bw-floating-lyric-bar.is-dragged {
  transform: none;
  bottom: auto;
}

/* ----------------------------------------------------------------------------
 * 13-4. 커스텀 글자 색상(html[data-custom-ink="1"]) 다크 독·미니 가사 가독성 보호
 * ---------------------------------------------------------------------------- */
html[data-custom-ink="1"] .bw-player-dock,
html[data-mood][data-custom-ink="1"] .bw-player-dock,
html[data-custom-ink="1"] .bw-floating-lyric-bar,
html[data-mood][data-custom-ink="1"] .bw-floating-lyric-bar {
  --ink-primary: #F8FAFC;
  --ink-secondary: #CBD5E1;
  --ink-muted: #94A3B8;
  color: #F8FAFC;
}

html[data-custom-ink="1"] .bw-player-dock .player-track-title,
html[data-custom-ink="1"] .bw-player-dock .dock-song-picker-trigger,
html[data-custom-ink="1"] .bw-player-dock .dock-song-picker-name,
html[data-custom-ink="1"] .bw-player-dock .bw-dock-picker-search,
html[data-custom-ink="1"] .bw-player-dock .player-time-readout .time-cur,
html[data-custom-ink="1"] .bw-floating-lyric-bar .float-lyric-cur {
  color: #FFFFFF;
}

html[data-custom-ink="1"] .bw-player-dock .dock-song-picker-head-title,
html[data-custom-ink="1"] .bw-player-dock .player-btn-dark:not(.is-active):not(.is-loop-on):not(.is-blue),
html[data-custom-ink="1"] .bw-player-dock .dock-vol-btn,
html[data-custom-ink="1"] .bw-player-dock .dock-vol-pct,
html[data-custom-ink="1"] .bw-floating-lyric-bar .float-lyric-btn {
  color: #E2E8F0;
}

html[data-custom-ink="1"] .bw-player-dock .player-btn-dark.is-active {
  color: #0F172A;
}

html[data-custom-ink="1"] .bw-player-dock .player-btn-dark.is-loop-on,
html[data-custom-ink="1"] .bw-player-dock .player-btn-dark.is-blue,
html[data-custom-ink="1"] .bw-player-dock .play-btn-main {
  color: #FFFFFF;
}

html[data-custom-ink="1"] .bw-player-dock .player-time-readout,
html[data-custom-ink="1"] .bw-player-dock .dock-song-picker-meta,
html[data-custom-ink="1"] .bw-player-dock .bw-dock-picker-empty {
  color: #94A3B8;
}

html[data-custom-ink="1"] .bw-floating-lyric-bar .float-lyric-next {
  color: rgba(203, 213, 225, 0.82);
}

html[data-custom-ink="1"] .bw-floating-lyric-bar .float-lyric-grip {
  color: #93C5FD;
}

/* ----------------------------------------------------------------------------
 * 13-5. 반응형 & 모션 축소 (모바일 <= 720px)
 * ---------------------------------------------------------------------------- */
@media (max-width: 720px) {
  body.is-beloved-tab .main-wrap {
    padding-bottom: 156px;
  }

  .bw-dock-seek-wrap {
    height: 28px;
    padding: 0 8px;
  }

  .bw-floating-lyric-bar:not(.is-dragged) {
    bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-dock-seek-wrap,
  .bw-dock-seek-thumb,
  .bw-dock-picker-search {
    transition: none;
  }
}

/* v34: 모바일 유튜브 자동재생 대기·무한로딩 복구 배너 (16:9 영상 밖 상단 배치, 비가림) */
.bw-yt-tap-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 10px;
  padding: 10px 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #F59E0B;
  color: #78350F;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.16);
  box-sizing: border-box;
}

.bw-yt-tap-hint[hidden] {
  display: none !important;
}

.bw-yt-tap-hint strong {
  color: #DC2626;
  font-weight: 800;
}

.bw-yt-tap-hint-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bw-yt-hint-btn {
  appearance: none;
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: #FFFFFF;
  color: #78350F;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.bw-yt-hint-btn.is-primary {
  background: #D97706;
  border-color: #B45309;
  color: #FFFFFF;
}

[data-theme="dark"] .bw-yt-tap-hint {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.20) 100%);
  border-color: rgba(251, 191, 36, 0.55);
  color: #FEF3C7;
}

[data-theme="dark"] .bw-yt-tap-hint strong {
  color: #FCA5A5;
}

[data-theme="dark"] .bw-yt-hint-btn {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(251, 191, 36, 0.45);
  color: #FEF3C7;
}

[data-theme="dark"] .bw-yt-hint-btn.is-primary {
  background: #F59E0B;
  border-color: #FBBF24;
  color: #0F172A;
}


