:root {
  --bg: #0b0d12;
  --surface: #16181f;
  --surface-subtle: #1e212a;
  --border: #2c3140;
  --border-strong: #3d4456;
  --text: #f4f6fb;
  --text-secondary: #c5cad6;
  --text-muted: #8b93a7;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: #3a1520;
  --primary-border: #9f1239;
  --indigo: #2563eb;
  --indigo-soft: #172033;
  --emerald: #34d399;
  --emerald-soft: #052e26;
  --amber: #fbbf24;
  --amber-soft: #3a2a0c;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 베타 상단 안내 바 */
.beta-ribbon {
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.84rem;
  padding: 8px 0;
}

.beta-ribbon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
}

.beta-pill {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.beta-link {
  color: #fda4af;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* 헤더 */
.site-header {
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.main-nav a:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.main-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-switch-btn {
  white-space: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
}

.provider-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.provider-kakao { background: #FEE500; color: #191919; }
.provider-naver { background: #03C75A; color: #ffffff; }
.provider-google { background: #ffffff; color: #1f2937; border: 1px solid #cbd5e1; }
.provider-local { background: #0f172a; color: #ffffff; }

.role-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
}

.role-badge.free {
  background: var(--emerald-soft);
  color: var(--emerald);
}

/* 버튼 공통 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.btn-indigo {
  background: var(--indigo);
  color: #fff;
}

.btn-indigo:hover {
  background: #1d4ed8;
}

/* 메인 컨텐츠 영역 */
.site-main {
  padding: 28px 0 60px;
  min-height: calc(100vh - 220px);
}

/* 히어로 & 검색 필터 박스 */
.hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-strip h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero-strip p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.search-bar-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  background: var(--bg);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 86px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.12s ease;
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-chip.active {
  background: #f4f6fb;
  color: #111318;
}

/* 비디오 카드 그리드 */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.section-count {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: var(--shadow-sm);
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  display: block;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.thumb-seg-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.thumb-seg-badge.is-unregistered {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-weight: 600;
}

.card-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.tag-music { background: #172033; color: #93c5fd; }
.tag-type { background: #052e26; color: #6ee7b7; }
.tag-intensity-warmup { background: #3a2a0c; color: #fcd34d; }
.tag-intensity-boost { background: #3a1520; color: #fda4af; }
.tag-intensity-light { background: #0c2a3a; color: #7dd3fc; }
.tag-intensity-standard { background: #2e1065; color: #d8b4fe; }
.tag-intensity-cooldown { background: #042f2e; color: #5eead4; }

.card-title {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-sub {
  margin: 0 0 12px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* 노래 카드: 썸네일 두 장을 겹쳐 두고 번갈아 서서히 바꾼다 */
.song-thumb .st-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.song-thumb .st-img.is-on {
  opacity: 1;
}

.song-card-title {
  -webkit-line-clamp: 1;
}

.song-card-artist {
  color: var(--text-secondary);
}

.song-card-views {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.song-card-special {
  background: var(--surface-subtle);
}

.song-back-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.song-back-link:hover {
  color: var(--primary);
}

.song-hero h1 {
  word-break: keep-all;
}

/* 연습 화면: 노래 정보 + 관리자 수정 */
.song-info {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.song-info a {
  font-weight: 700;
  color: var(--text);
}

.song-info a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.song-admin {
  margin: 0 0 12px;
  font-size: 0.82rem;
}

.song-admin summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.song-admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.song-admin-form input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.85rem;
}

.song-admin-status {
  flex-basis: 100%;
  color: var(--text-muted);
}

.card-seg-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.mini-seg {
  font-size: 0.74rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.card-foot {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.bookmark-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* 보기/연습 화면 레이아웃 */
.watch-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.player-column {
  position: sticky;
  top: 76px;
}

/* 연습 화면: 오른쪽 영역 없이 가운데 한 줄, 노트북 한 화면에 영상 + 구간 숫자 줄이 다 보이도록 너비를 화면 높이에 맞춰 제한 */
.watch-layout.watch-single {
  display: block;
  max-width: clamp(560px, calc((100vh - 380px) * 16 / 9), 1000px);
  margin: 0 auto;
}

.watch-single .player-column {
  position: static;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  /* 유튜브 이동 직후 4초간 한가운데에 뜨는 56px 고정 크기 ⏸ 아이콘을 1/N로 줄이기 위한 배율.
     평소에는 스마트폰 데이터 절약을 위해 1(기존 100% × 300%, 360p)로 두고,
     다시 켤 때는 8(또는 JS에서 videoStage.style.setProperty('--yt-scale', '8'))로 바꾸면 된다. */
  --yt-scale: 1;
}

.video-stage.mirrored iframe {
  transform: scaleX(-1);
}

/* 두 번 누른 곳을 중심으로 2배 확대 (transform-origin은 스크립트가 누른 위치로 정한다) */
.yt-zoom {
  position: absolute;
  inset: 0;
  transition: transform 0.2s ease;
}

.yt-zoom.zoomed {
  transform: scale(2);
}

.yt-zoom-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  pointer-events: none;
}

.yt-zoom-badge[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .yt-zoom {
    transition: none;
  }
}

.video-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  transition: transform 0.2s ease;
}

/* 유튜브의 제목·채널·로고·자막·정지 시 추천 등은 플레이어 위/아래 가장자리에 붙는다.
   iframe을 3배 높이로 키우면 16:9 영상은 가운데 1/3에 그대로 놓이므로 그 부분만 보이게 잘라낸다.
   여기에 --yt-scale 배만큼 크게 그린 뒤 1/--yt-scale 로 축소해 가운데 56px 고정 아이콘도 함께 줄인다. */
.video-stage.yt-clean iframe {
  position: absolute;
  left: 50%;
  top: -100%;
  width: calc(100% * var(--yt-scale));
  height: calc(300% * var(--yt-scale));
  translate: -50% 0;
  transform-origin: 50% 0;
  transform: scale(calc(1 / var(--yt-scale)));
}

.video-stage.mirrored.yt-clean iframe {
  transform: scale(calc(-1 / var(--yt-scale)), calc(1 / var(--yt-scale)));
}

.yt-frame:fullscreen,
.yt-frame:-webkit-full-screen,
.yt-frame.is-fake-fs {
  display: flex;
  flex-direction: column;
  background: #000;
}

.yt-frame.is-fake-fs {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100dvh;
}

html.yt-fake-fs,
html.yt-fake-fs body {
  overflow: hidden;
}

.yt-frame > .quick-seg-bar {
  flex: none;
  background: #0f172a;
  border-bottom: 0;
}

.yt-frame > .set-popup {
  z-index: 80;
}

.yt-frame:fullscreen .video-stage,
.yt-frame:-webkit-full-screen .video-stage,
.yt-frame.is-fake-fs .video-stage {
  flex: 1;
  aspect-ratio: auto;
  container-type: size;
}

/* 전체화면은 16:9가 아니므로 영상 너비를 높이에 맞춰 잘리지 않게 가운데 둔다 */
.yt-frame:fullscreen .video-stage.yt-clean iframe,
.yt-frame:-webkit-full-screen .video-stage.yt-clean iframe,
.yt-frame.is-fake-fs .video-stage.yt-clean iframe {
  width: calc(min(100cqw, 177.78cqh) * var(--yt-scale));
  left: 50%;
  translate: -50% 0;
}

/* 예비 박자 카운트다운: 거울모드는 iframe만 뒤집으므로 숫자는 뒤집히지 않는다 */
.preroll-countdown {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.preroll-countdown[hidden] {
  display: none;
}

.preroll-countdown.is-word {
  font-size: 1.05rem;
}

.preroll-countdown.pop {
  animation: preroll-pop 0.35s ease-out;
}

@keyframes preroll-pop {
  from { transform: scale(1.25); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .preroll-countdown {
    right: 10px;
    bottom: 10px;
    width: 46px;
    height: 46px;
    font-size: 1.45rem;
  }

  .preroll-countdown.is-word {
    font-size: 0.88rem;
  }
}

/* 전체화면은 좌우에 검은 여백이 생길 수 있으므로 영상 안쪽 모서리에 맞춘다 */
.yt-frame:fullscreen .preroll-countdown {
  right: calc((100cqw - min(100cqw, 177.78cqh)) / 2 + 3cqh);
  bottom: 3cqh;
  width: 14cqh;
  height: 14cqh;
  border-width: 0.6cqh;
  font-size: 8cqh;
}

.yt-frame:fullscreen .preroll-countdown.is-word {
  font-size: 4.4cqh;
}

.yt-time {
  flex: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.yt-shield {
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  /* 두 번 누르기를 브라우저 화면 확대가 아니라 영상 확대로 쓴다 */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.yt-shield.is-cued,
.yt-shield.is-ended {
  background: #000 var(--yt-thumb) center / cover no-repeat;
}

.yt-shield-play {
  display: none;
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 1.4rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.yt-shield.is-cued .yt-shield-play,
.yt-shield.is-ended .yt-shield-play {
  display: flex;
}

.yt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  background: #0f172a;
}

.yt-bar-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.yt-bar-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.yt-bar-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.yt-seek {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

@media (max-width: 420px) {
  .yt-bar {
    gap: 6px;
    padding: 8px;
  }
  .yt-time {
    font-size: 0.72rem;
  }
  .yt-bar-btn {
    width: 34px;
  }
}

/* 연습 컨트롤 덱 */
/* 영상 바로 아래 구간 바로가기 (한 번: 점프, 두 번: 그 구간 계속 반복) */
.quick-seg-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: var(--surface);
}

.quick-seg-bar::-webkit-scrollbar {
  display: none;
  height: 0;
}

#quickSegBar {
  overflow: hidden;
  align-items: flex-end;
}

.quick-seg-scroll {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.quick-seg-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
}

/* 영상 아래 첫 줄: 반복 · 속도 · 예비박자 · 거울 */
.practice-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.top-group {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.practice-tools {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-tools .icon-btn {
  flex: none;
}

.combo {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin: 0;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
  cursor: pointer;
}

.combo select {
  appearance: none;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 2px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
}

.combo select:focus {
  outline: none;
}

.combo::after {
  content: "▾";
  flex: none;
  margin-left: 1px;
  font-size: 0.62rem;
  line-height: 1;
  color: var(--text-muted);
  pointer-events: none;
}

.combo:hover {
  border-color: #94a3b8;
}

.combo:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.14);
}

.combo.is-on {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  box-shadow: none;
}

.combo.is-on select,
.combo.is-on::after {
  color: #fecdd3;
}

.practice-top .pill-group {
  flex: none;
  flex-wrap: nowrap;
  gap: 4px;
}

.practice-top .ctrl-btn {
  padding: 5px 8px;
  font-size: 0.8rem;
}

.practice-top .ctrl-btn.num-btn {
  min-width: 34px;
}

.practice-top .ctrl-btn.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
}

.practice-top .ctrl-btn.sec-loop-btn {
  flex: none;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.practice-top .ctrl-btn.sec-loop-btn:disabled,
.practice-top .ctrl-btn.sec-loop-btn:disabled:hover {
  background: var(--surface);
  color: var(--text-secondary);
  opacity: 0.4;
  cursor: not-allowed;
}

/* 좁은 휴대폰: 첫 줄 칸 글자(1.25×, 3초 전)가 잘리지 않게 여백을 줄인다 */
@media (max-width: 400px) {
  .practice-tools {
    gap: 6px;
  }

  .practice-tools .combo {
    padding: 0 6px 0 9px;
  }

  .practice-top .ctrl-btn.sec-loop-btn {
    padding: 0 7px;
  }
}

@media (max-width: 359px) {
  .practice-top {
    padding-left: 8px;
    padding-right: 8px;
  }

  .practice-tools {
    gap: 4px;
  }

  .practice-tools .combo {
    padding: 0 5px 0 7px;
  }

  .practice-top .ctrl-btn.sec-loop-btn {
    padding: 0 6px;
  }
}

.set-pick-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.set-pick-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.set-pick-btn:hover,
.set-pick-btn[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 480px) {
  .practice-top {
    gap: 8px 10px;
  }
}

.qseg-all {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qseg-all .qseg-num svg {
  display: block;
}

.qseg-all.is-on {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.qseg-all.is-on .qseg-num {
  background: var(--primary);
  color: #fff;
}

/* 세트 선택 작은 창 (위치·크기는 스크립트가 세트 버튼 기준으로 정한다) */
.set-popup {
  position: fixed;
  z-index: 70;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.set-popup[hidden] {
  display: none;
}

.set-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}

.set-popup-close {
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.set-popup-close:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.set-popup .set-tabs {
  flex-direction: column;
}

.set-popup .set-tab {
  flex-wrap: wrap;
}

.set-tab-check {
  margin-left: auto;
  font-weight: 800;
}

.set-popup-empty {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.set-popup-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

.set-popup-sub {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.set-popup .segment-list {
  gap: 5px;
}

.set-popup .segment-item {
  padding: 6px 8px 6px 10px;
  border-radius: 10px;
}

.set-popup .seg-title {
  margin: 0;
  font-size: 0.88rem;
}

.set-popup .seg-loop-btn.seg-play-only {
  width: 30px;
  height: 30px;
}

/* A~B 반복 범위 표시: 숫자 줄 위쪽에 A 버튼 ~ B 버튼 길이의 빨간 선 (left·width는 스크립트가 버튼 위치로 정한다) */
.quick-seg-scroll.has-ab {
  padding-top: 20px;
}

.qseg-ab-line {
  position: absolute;
  top: 9px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  pointer-events: none;
}

.qseg-ab-line[hidden],
.qseg-ab-count[hidden] {
  display: none;
}

.qseg-ab-line::before,
.qseg-ab-line::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--primary);
}

.qseg-ab-line::before {
  left: -1px;
}

.qseg-ab-line::after {
  right: -1px;
}

.qseg-ab-count {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.qseg-hint {
  flex: none;
  padding-right: 4px;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: nowrap;
}

.qseg-btn,
.qdrill-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 170px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qseg-btn:hover {
  border-color: var(--primary);
}

.qseg-num {
  flex: none;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.qseg-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px 0 2px;
  line-height: 24px;
}

.qseg-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.qseg-btn.active .qseg-num {
  background: var(--primary);
  color: #fff;
}

.qseg-btn.looping {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.qseg-btn.looping .qseg-num {
  background: var(--surface);
  color: var(--primary);
}

/* 숫자 버튼의 지금 구간: 두꺼운 테두리가 구간 진행률 그래프 (12시부터 시계 방향, 빨강 = 지난 시간, 회색 = 남은 시간) */
.qseg-btn.qseg-round.active,
.qseg-btn.qseg-round.looping {
  border-color: transparent;
  background: conic-gradient(var(--primary) var(--seg-progress, 0%), var(--border-strong) 0) border-box;
  color: var(--primary);
}

.qseg-btn.qseg-round.active .qseg-num,
.qseg-btn.qseg-round.looping .qseg-num {
  background: var(--surface);
  color: var(--primary);
}

/* 이름 있는 구간: 번호 동그라미 테두리가 같은 진행률 (12시부터 시계 방향) */
.qseg-btn:not(.qseg-round).active .qseg-num,
.qseg-btn:not(.qseg-round).looping .qseg-num {
  border: 3px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(var(--primary) var(--seg-progress, 0%), var(--border-strong) 0) border-box;
  color: var(--primary);
}

/* 두 번 눌러 계속 반복 중인 구간은 번호 대신 ∞ */
.qseg-btn.qseg-round.looping .qseg-num {
  font-size: 0;
}

.qseg-btn.qseg-round.looping .qseg-num::after {
  content: '∞';
  font-size: 0.95rem;
}

/* 영상 아래 반복 연습 바로가기 (구간 줄 바로 밑, 파란색 계열) */
.quick-drill-bar {
  padding-top: 0;
}

.qdrill-btn:hover {
  border-color: var(--indigo);
}

.qdrill-btn.active {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #fff;
}

.practice-deck {
  padding: 14px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.deck-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 72px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.ctrl-btn {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.ctrl-btn:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.ctrl-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.ctrl-btn.active-rose {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ctrl-btn.num-btn {
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ctrl-btn.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  flex-shrink: 0;
}

.ctrl-btn.icon-btn svg {
  display: block;
  width: 1.55em;
  height: 1.55em;
}

@media (max-width: 480px) {
  .deck-label {
    min-width: 52px;
  }

  .deck-row .ctrl-btn {
    padding: 7px 8px;
  }

  .ctrl-btn.num-btn {
    min-width: 34px;
  }
}

/* 구간 목록 패널 */
.segments-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.set-selector-box {
  background: var(--surface-subtle);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.set-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.set-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.83rem;
  font-weight: 600;
}

.set-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.src-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.src-admin { background: #172033; color: #93c5fd; }
.src-ai { background: #2e1065; color: #d8b4fe; }
.src-member { background: #052e26; color: #6ee7b7; }

/* 구간 사이(A~B) 반복: 연습 덱의 한 줄, 켜져 있는 동안 분홍 바탕 */
.ab-range-box {
  margin: 0 -8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.ab-range-box.ab-active {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.ab-range-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.ab-select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  flex: 1 1 90px;
  min-width: 0;
  max-width: 220px;
  text-overflow: ellipsis;
}

.ab-tilde {
  font-weight: 700;
  color: var(--text-muted);
}

.ab-apply-btn,
.ab-clear-btn {
  flex: none;
}

/* 구간 리스트 아이템 */
.segment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.14s ease;
  cursor: pointer;
}

.segment-item:hover {
  border-color: var(--primary);
  background: var(--surface-subtle);
}

.segment-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.12);
}

.seg-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.seg-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.segment-item.active .seg-num {
  background: var(--primary);
  color: #fff;
}

.seg-info {
  min-width: 0;
  flex: 1;
}

.seg-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.seg-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.seg-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.seg-loop-btn {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.seg-loop-btn.looping {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.seg-loop-btn.seg-play-only {
  width: 36px;
  height: 36px;
  padding: 0 0 0 3px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--primary);
}

@media (hover: hover) {
  .seg-loop-btn.seg-play-only:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }
}

/* 비회원이 구간을 누르면 뜨는 가입 안내 창 */
.join-ask {
  width: min(340px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
}

.join-ask::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.join-ask-body {
  padding: 18px 16px 14px;
}

.join-ask-body p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
  word-break: keep-all;
}

.join-ask-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.join-ask-actions .btn {
  min-width: 84px;
  justify-content: center;
}

/* 미구독/비회원 5등분 안내 박스 */
.locked-teaser-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a1218 0%, #3a1520 100%);
  border: 1px solid var(--primary-border);
}

.locked-teaser-box h4 {
  margin: 0 0 6px;
  font-size: 0.96rem;
  color: #fecdd3;
}

.locked-teaser-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.locked-chip {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #fecdd3;
  font-weight: 600;
}

/* 공유 & 유튜브 타임스탬프 박스 */
.share-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.yt-stamp-box {
  margin-top: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.yt-stamp-textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  background: var(--surface);
  resize: vertical;
  margin-top: 8px;
}

/* 에디터 전용 스타일 */
.one-touch-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.cut-big-btn {
  padding: 15px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.cut-big-btn:hover {
  background: var(--primary-hover);
}

.editor-seg-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  margin-bottom: 10px;
}

.editor-seg-card.editing-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.editor-seg-card.time-invalid {
  border-color: #e11d48;
  background: #3a1520;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.18);
}

.editor-seg-card.time-invalid .time-wheel-group {
  border-color: #f43f5e;
}

/* 구간 편집기 (단순화 레이아웃) */
.ed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ed-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ed-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ed-deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ed-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ed-now-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  padding: 2px 8px;
  cursor: ns-resize;
  user-select: none;
}

.ed-state {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.ed-step-group {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
  flex-wrap: wrap;
}

.ed-step-btn {
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
}

.ed-step-btn:hover {
  background: var(--surface-subtle);
}

.ed-play-btn {
  font-size: 0.9rem;
  padding: 4px 12px;
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.ed-cut-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22);
}

.ed-cut-btn:hover {
  background: var(--primary-hover);
}

.ed-cut-btn kbd,
.ed-help-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}

.ed-help-body kbd {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.ed-set-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ed-set-title {
  flex: 1;
  font-weight: 700;
  padding: 8px 11px;
}

.ed-settings {
  position: relative;
  flex-shrink: 0;
}

.ed-settings > summary,
.mini-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.ed-settings > summary::-webkit-details-marker,
.mini-menu > summary::-webkit-details-marker {
  display: none;
}

.ed-settings > summary {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.ed-settings[open] > summary {
  border-color: var(--primary);
  color: var(--primary);
}

.ed-settings-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.ed-settings-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ed-settings-body .form-control {
  padding: 7px 10px;
  font-size: 0.86rem;
}

.ed-set-row {
  position: relative;
}

.ed-set-title {
  min-width: 0;
}

.ed-settings.ed-names {
  position: static;
}

.ed-names-body {
  left: 0;
  right: 0;
  width: auto;
  max-width: 420px;
  margin-left: auto;
}

.ed-names-body label {
  font-size: 0.8rem;
}

.ed-names-body textarea.form-control {
  min-height: 72px;
  resize: vertical;
  font-size: 0.92rem;
  line-height: 1.45;
}

.ed-names-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.ed-names-note.is-error {
  color: #fda4af;
}

.ed-names-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ed-list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.ed-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-menu {
  position: relative;
}

.mini-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.mini-menu[open] > summary {
  border-color: var(--primary);
  color: var(--primary);
}

.mini-menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.mini-menu-body button {
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mini-menu-body button:hover {
  background: var(--surface-subtle);
}

.mini-menu-body button.danger {
  color: #fda4af;
}

.ed-help-body {
  width: min(320px, 86vw);
  padding: 12px 14px;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ed-help-body p {
  margin: 0;
}

.editor-seg-card {
  padding: 10px 12px;
  margin-bottom: 0;
}

.editor-seg-card.editing-active .seg-num {
  background: var(--primary);
  color: #fff;
}

.ed-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ed-seg-title {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

.ed-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.ed-icon-btn:hover {
  background: var(--surface-subtle);
}

.ed-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ed-tilde {
  font-weight: 800;
  color: var(--text-muted);
}

.ed-pin-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.ed-pin-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.ed-seg-note {
  margin-top: 8px;
  padding: 5px 9px;
  font-size: 0.8rem;
  background: var(--bg);
}

/* 마우스가 있는 기기에서는 ▲▼를 시간 위에 올렸을 때만 표시 (터치 기기는 항상 표시) */
@media (hover: hover) {
  .time-wheel-group .step-arrows {
    visibility: hidden;
  }
  .time-wheel-group:hover .step-arrows,
  .time-wheel-group:focus-within .step-arrows {
    visibility: visible;
  }
}

#editorSegmentsContainer .seg-link-connector {
  margin: 0;
  height: 22px;
}

#editorSegmentsContainer .seg-link-connector::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
  transform: translateX(-50%);
}

#editorSegmentsContainer .seg-link-connector.is-linked::before {
  background: #10b981;
}

.seg-link-icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.seg-link-icon.linked {
  border-color: #10b981;
  background: var(--emerald-soft);
  color: var(--emerald);
}

.seg-link-icon.unlinked {
  opacity: 0.75;
}

.seg-link-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* 박자로 나누기 (관리자) */
.ed-list-bar {
  gap: 8px;
}

.ed-list-bar > strong {
  flex-shrink: 0;
  white-space: nowrap;
}

.ed-list-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.beat-panel {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #312e81;
  border-radius: 12px;
  background: #172033;
  font-size: 0.84rem;
}

.beat-status {
  margin: 0;
  font-weight: 700;
  color: #c7d2fe;
}

.beat-status.is-error {
  color: #fda4af;
}

.beat-shift,
.beat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.beat-shift {
  margin: 0 0 10px;
}

.beat-steps {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 420px;
}

.beat-steps > .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 2px;
}

.beat-steps > .beat-offset {
  flex: none;
  min-width: 3.4em;
}

.beat-apply-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.beat-apply-group[hidden] {
  display: none;
}

.beat-tools {
  margin-top: 8px;
}

.beat-bars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: #c7d2fe;
}

.beat-bars[hidden] {
  display: none;
}

.beat-bars select {
  height: 30px;
  border: 1px solid #4338ca;
  border-radius: 8px;
  background: var(--surface);
  color: #e0e7ff;
  font-weight: 700;
  padding: 0 6px;
}

.beat-tools[hidden],
.beat-hint[hidden],
.beat-panel[hidden] {
  display: none;
}

.beat-offset {
  min-width: 4.5em;
  text-align: center;
  font-weight: 800;
  color: #c7d2fe;
}

.beat-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.song-import {
  position: fixed;
  z-index: 80;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.song-import[hidden] {
  display: none;
}

.song-import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
}

.song-import-close {
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.song-import-note,
.song-import-empty {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.song-import-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.song-import-thumb {
  flex: none;
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #0f172a center / 28px 28px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238b93a7' d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E");
  overflow: hidden;
}

.song-import-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-import-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.song-import-item:hover {
  border-color: #6366f1;
  background: #172033;
}

.song-import-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.84rem;
}

.song-import-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.seg-merge-btn {
  position: absolute;
  left: calc(50% + 22px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  height: 22px;
  padding: 0 10px;
  border: 1.5px solid #6366f1;
  border-radius: 999px;
  background: var(--surface);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.seg-merge-btn:hover {
  background: #172033;
}

@media (pointer: coarse) {
  .seg-merge-btn {
    height: 28px;
    padding: 0 14px;
  }

  #editorSegmentsContainer .seg-link-connector:has(.seg-merge-btn) {
    height: 30px;
  }
}

/* 반복 연습 구간 (편집 화면) */
.ed-drill-section {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}

.ed-drill-hint {
  margin: -2px 0 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ed-drill-card + .ed-drill-card {
  margin-top: 8px;
}

.ed-drill-card {
  border-left: 3px solid var(--indigo);
}

.ed-drill-card.is-previewing {
  background: var(--indigo-soft);
  border-color: var(--indigo);
}

.ed-drill-num {
  background: var(--indigo-soft);
}

.ed-drill-len {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ed-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 14px;
  padding: 10px 0;
  background: linear-gradient(to top, var(--surface) 70%, rgba(255, 255, 255, 0));
}

.ed-save-bar .btn {
  width: 100%;
}

@media (max-width: 720px) {
  .ed-save-bar {
    bottom: 62px;
  }
  .ed-step-group {
    margin-left: 0;
  }
}

.seg-time-warn {
  margin: -2px 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: #fecdd3;
  font-size: 0.78rem;
  font-weight: 700;
}

.nudge-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nudge-btn {
  padding: 3px 7px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  border-radius: 5px;
  cursor: pointer;
}

.nudge-btn:hover {
  background: var(--border);
}

/* 정밀 0.01초 스크롤 타임 컨트롤 & 구간 링크(🔗) UI */
.jog-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
}

.jog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

/* 편집 눈금자: 가운데 빨간 선이 지금 시각, 좌우로 밀어서 이동 (세로로 쓸면 페이지 스크롤) */
.ed-ruler {
  position: relative;
  height: 64px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.ed-ruler.dragging {
  cursor: grabbing;
  border-color: var(--primary-border);
}

.ed-ruler:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ed-ruler-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ed-ruler-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--primary);
  pointer-events: none;
}

.ed-ruler-needle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--primary);
}

/* 편집 조작부: 손가락으로 누르기 좋게 (두 번 눌러 확대·누름 번쩍임 없음, 누르면 살짝 눌림) */
.ed-deck button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ed-step-btn:active,
.ed-cut-btn:active {
  transform: scale(0.97);
}

@media (pointer: coarse) {
  .ed-step-btn {
    min-height: 40px;
    min-width: 44px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .ed-now-time {
    font-size: 1.3rem;
    padding: 4px 10px;
  }

  .ed-cut-btn {
    min-height: 54px;
  }
}

@media (max-width: 720px) {
  .ed-step-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .ed-step-btn {
    min-width: 0;
    padding-left: 2px;
    padding-right: 2px;
  }
}

.time-scroll-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.time-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-box-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.time-wheel-group {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  color: #fff;
  padding: 3px 7px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  user-select: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  border: 2px solid transparent;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.time-wheel-group.linked-endpoint {
  border-color: #10b981;
  background: #064e3b;
}

.time-wheel-group:hover {
  border-color: var(--primary);
}

.time-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 4px;
  border-radius: 5px;
  cursor: ns-resize;
  position: relative;
  line-height: 1.15;
  transition: background 0.12s ease, color 0.12s ease;
}

.time-unit:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fda4af;
}

.time-unit-centi {
  color: #38bdf8;
}

.time-sep {
  opacity: 0.55;
  padding: 0 1px;
  font-weight: 700;
}

.step-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 3px;
}

.step-arrow-btn {
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.56rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
}

.step-arrow-btn:hover {
  background: var(--primary);
}

/* 구간 사이 링크(🔗) 커넥터 바 */
.seg-link-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 8px;
  position: relative;
  z-index: 2;
}

.seg-link-line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.seg-link-connector.is-linked .seg-link-line {
  background: #10b981;
  height: 2px;
}

.seg-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.seg-link-btn.linked {
  background: var(--emerald-soft);
  border-color: #10b981;
  color: #6ee7b7;
}

.seg-link-btn.unlinked {
  background: var(--primary-soft);
  border-color: #fda4af;
  color: #fecdd3;
}

.seg-link-btn:hover {
  transform: translateY(-1px);
}

/* 폼/카드 공통 */
.form-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  background: var(--surface);
  color: var(--text);
}

.social-login-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease;
}

.social-btn:hover {
  transform: translateY(-1px);
}

.social-kakao { background: #FEE500; color: #191919; }
.social-naver { background: #03C75A; color: #ffffff; }
.social-google { background: #ffffff; color: #1f2937; border-color: var(--border-strong); }

.notice-box {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--indigo-soft);
  color: #bfdbfe;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-note {
  margin: 6px 0 0;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 모바일 하단 내비게이션 (앱 전환 대비) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 960px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .player-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .user-area {
    margin-left: auto;
    justify-content: flex-end;
  }
  .main-nav {
    display: none;
  }
  .site-main {
    padding-bottom: 84px;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    background: rgba(12, 14, 18, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 60;
  }
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    gap: 2px;
  }
  .mobile-bottom-nav a.active {
    color: var(--primary);
  }
  .m-icon {
    font-size: 1.05rem;
  }
}

/* 앱 틀: 스마트폰부터 아이패드 가로폭(1180px)까지 반응형으로 넓어지고 하단 탭은 유지 */
body {
  background: #000;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
}

.app-shell .site-main {
  flex: 1;
  padding: 12px 0 calc(72px + env(safe-area-inset-bottom));
  min-height: 0;
}

.app-shell .site-footer {
  display: none;
}

.app-shell .main-nav {
  display: none;
}

.app-shell .header-inner {
  min-height: 52px;
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
}

.app-shell .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.app-shell .brand-text small {
  display: none;
}

.app-shell .user-area {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

.app-shell .user-area .inline-form {
  display: inline-flex;
  flex: none;
}

.app-shell .user-chip {
  min-width: 0;
  flex: 0 1 auto;
}

.app-shell .user-nick {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 5.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .provider-dot,
.app-shell .role-badge {
  flex: none;
}

.app-shell .mode-switch-btn {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.app-shell .beta-ribbon {
  font-size: 0.78rem;
  padding: 6px 0;
}

.app-shell .beta-ribbon[hidden] {
  display: none !important;
}

.app-shell .beta-close {
  border: 0;
  background: transparent;
  color: #fda4af;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.app-shell .hero-strip {
  margin-bottom: 12px;
}

.app-shell .hero-strip h1 {
  font-size: 1.28rem;
}

.app-shell .hero-strip p {
  font-size: 0.86rem;
}

.mobile-bottom-nav {
  display: grid;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1180px, 100%);
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(12, 14, 18, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
  z-index: 60;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  gap: 2px;
}

.mobile-bottom-nav a.active {
  color: var(--primary);
}

.m-icon {
  font-size: 1.05rem;
}

.ed-save-bar {
  bottom: calc(58px + env(safe-area-inset-bottom));
}

.watch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 6px;
}

.watch-toolbar .tag {
  display: none;
}

.watch-page {
  padding: 0;
  max-width: none;
}

.watch-page .watch-layout.watch-single {
  max-width: none;
}

.app-shell .player-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.watch-page .share-card {
  margin: 4px 12px 12px;
  padding: 8px 2px 0;
  border: 0;
  background: transparent;
}

.watch-page .locked-teaser-box {
  margin: 12px;
}

.app-shell .beta-ribbon-inner {
  flex-wrap: nowrap;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
}

.app-shell .beta-ribbon-inner > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .beta-pill,
.app-shell .beta-link,
.app-shell .beta-close {
  flex-shrink: 0;
}

.app-shell .home-hero {
  margin-bottom: 8px;
}

.app-shell .home-hero p,
.app-shell .home-hero .hero-actions {
  display: none !important;
}

.app-shell .filter-panel {
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: none;
}

.app-shell .filter-row {
  flex-wrap: nowrap;
}

.app-shell .filter-label {
  min-width: 0;
  white-space: nowrap;
}

.app-shell .chip-list {
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
}

.app-shell .chip-list::-webkit-scrollbar {
  display: none;
  height: 0;
}

.app-shell .filter-chip {
  flex-shrink: 0;
}

.app-shell .search-input-wrap {
  min-width: 0;
  width: 100%;
}

.app-shell .search-bar-row {
  flex-direction: column;
  align-items: stretch;
}

.app-shell .search-bar-row .btn {
  width: 100%;
}

.app-shell .watch-layout {
  display: block;
}

.app-shell .player-column {
  position: static;
}

.app-shell .ed-save-bar {
  bottom: calc(72px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav.is-5 {
  grid-template-columns: repeat(5, 1fr);
}

.my-videos-h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 800;
}

.my-videos-list-title {
  margin: 26px 0 12px;
}

.yt-channel-state {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.yt-channel-state.is-on {
  color: #6ee7b7;
}

.yt-channel-state.is-error,
.upload-text.is-error {
  color: #fda4af;
}

.yt-channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.yt-setup {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.yt-setup summary {
  cursor: pointer;
  font-weight: 700;
}

.yt-setup ol {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.6;
}

.upload-hint,
.upload-rights {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.upload-rights {
  margin: 12px 0 0;
  font-size: 0.8rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-file {
  padding: 8px 10px;
}

.upload-progress {
  margin-top: 12px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.3s ease;
}

.upload-text {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.my-videos-empty {
  text-align: center;
  color: var(--text-secondary);
}

.my-video-thumb-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / 44px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M19 15v4H5v-4H3v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4h-2zM11 5.8V16h2V5.8l3.6 3.6L18 8l-6-6-6 6 1.4 1.4L11 5.8z'/%3E%3C/svg%3E");
}

.my-video-status.status-ready { background: #052e26; color: #6ee7b7; }
.my-video-status.status-processing { background: #172033; color: #93c5fd; }
.my-video-status.status-uploading { background: #3a2a0c; color: #fcd34d; }
.my-video-status.status-failed { background: #3a1520; color: #fda4af; }

.my-video-note {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.my-video-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.my-video-actions .my-video-delete {
  margin-left: auto;
  color: #fda4af;
}

/* =========================================================
   내 연습루틴 (/routines.php, 연습 화면 루틴 진행 바, 루틴 담기 창)
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.routine-tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.routine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.routine-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
}

.routine-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.routine-tab-count {
  font-size: 0.75rem;
  opacity: 0.85;
}

.routine-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.routine-create-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 8px 11px;
  font-size: 0.88rem;
}

.routine-create-gap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.routine-create-gap select {
  width: auto;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.routine-title-bar {
  margin-bottom: 10px;
}

.routine-rename-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.routine-title-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 7px 11px;
  font-size: 0.96rem;
  font-weight: 700;
}

.routine-del-btn {
  color: #fda4af;
}

.routine-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.routine-summary-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.routine-summary-meta strong {
  color: var(--text);
}

.routine-summary-meta small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.routine-summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.routine-bulk-gap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.routine-bulk-gap select {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.routine-status-msg {
  margin: 0 0 10px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #052e26;
  color: #6ee7b7;
  font-size: 0.83rem;
  font-weight: 600;
}

.routine-status-msg.is-error {
  background: #3a1520;
  color: #fda4af;
}

.routine-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.routine-empty-box {
  padding: 24px 14px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.routine-item-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.routine-item-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.routine-item-thumb-wrap {
  position: relative;
  width: 76px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.routine-item-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.routine-item-dur {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
}

.routine-item-body {
  flex: 1;
  min-width: 0;
}

.routine-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.routine-item-song {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fda4af;
}

.routine-item-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.32;
}

.routine-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.routine-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.routine-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.routine-ctrl-btn.is-del {
  color: #fda4af;
}

.routine-gap-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
}

.routine-gap-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #131826;
  border: 1px dashed var(--border-strong);
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
}

.routine-gap-select {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.routine-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1.25;
}

.routine-mini-badge.is-official {
  background: rgba(225, 29, 72, 0.9);
  color: #fff;
}

.routine-mini-badge.is-unreg {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.routine-picker-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.routine-picker-head p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.routine-song-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.routine-song-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routine-song-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.routine-song-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.routine-song-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.routine-song-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.routine-song-thumb {
  width: 64px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
}

.routine-song-info {
  flex: 1;
  min-width: 0;
}

.routine-song-title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.routine-song-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.routine-song-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.routine-song-arrow {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.routine-song-videos {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.routine-song-videos[hidden] {
  display: none !important;
}

.routine-cand-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.routine-cand-thumb {
  width: 68px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  background: #000;
  flex-shrink: 0;
}

.routine-cand-info {
  flex: 1;
  min-width: 0;
}

.routine-cand-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.routine-cand-dur {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.routine-cand-chan {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.routine-cand-title {
  font-size: 0.81rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.routine-cand-add {
  flex-shrink: 0;
}

/* 연습 화면(.watch-page) 루틴 진행 바 & 자동 다음 영상 카운트다운 */
.routine-play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 12px 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #131826;
  border: 1px solid var(--border-strong);
}

.routine-play-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.routine-play-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.routine-play-title:hover {
  color: #fda4af;
}

.routine-play-pos {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.routine-play-gap {
  font-size: 0.74rem;
  color: #93c5fd;
  font-weight: 600;
}

.routine-play-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.routine-next-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(11, 13, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.routine-next-overlay[hidden] {
  display: none !important;
}

.routine-next-card {
  width: min(340px, 100%);
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  text-align: center;
  box-shadow: var(--shadow);
}

.routine-next-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #fda4af;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.routine-next-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.35;
  margin-bottom: 8px;
}

.routine-next-timer {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #93c5fd;
  font-weight: 700;
}

.routine-next-timer span {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.routine-next-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 루틴에 담기 모달 (.routine-pick-dialog) */
.routine-pick-dialog {
  width: min(380px, calc(100vw - 24px));
}

.routine-pick-body {
  text-align: left;
}

.routine-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.routine-pick-vtitle {
  margin: 0 0 10px !important;
  font-size: 0.8rem !important;
  color: var(--text-secondary);
  text-align: left !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.routine-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.routine-pick-item {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.routine-pick-item:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.routine-pick-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-pick-item-meta {
  font-size: 0.76rem;
  color: #fda4af;
  font-weight: 700;
  flex-shrink: 0;
}

.routine-pick-empty {
  margin: 0 !important;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.82rem !important;
  color: var(--text-muted);
}

.routine-pick-new {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-bottom: 10px;
}

.routine-pick-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.routine-pick-new-row {
  display: flex;
  gap: 6px;
}

.routine-pick-new-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.routine-pick-msg {
  margin: 0 0 10px !important;
  padding: 7px 10px;
  border-radius: 8px;
  background: #052e26;
  color: #6ee7b7;
  font-size: 0.81rem !important;
  font-weight: 600;
}

.routine-pick-msg.is-error {
  background: #3a1520;
  color: #fda4af;
}

.routine-pick-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 420px) {
  .routine-item-card {
    flex-wrap: wrap;
  }
  .routine-item-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* =========================================================
   유튜브 검색 결과 선택 등록 & 내 등록 영상/삭제 버튼
   ========================================================= */
.tag-my-video {
  background: var(--primary-soft);
  color: #fda4af;
  border: 1px solid var(--primary-border);
}

.video-del-btn,
.watch-del-btn,
.yt-reg-del-btn {
  color: #fda4af !important;
  border-color: rgba(244, 63, 94, 0.35) !important;
}

.card-foot .bookmark-btn {
  padding: 5px 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.card-foot .btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.video-del-btn:hover,
.watch-del-btn:hover,
.yt-reg-del-btn:hover {
  background: var(--primary-soft) !important;
}

.yt-search-panel {
  border-color: var(--primary-border);
}

.yt-search-head {
  margin-bottom: 14px;
}

.yt-search-head strong {
  font-size: 1rem;
}

.yt-search-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.yt-search-empty {
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* 유튜브 스타일 카드 그리드: 모바일 1열, 태블릿/아이패드 이상 2열 */
.yt-search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.yt-search-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.yt-search-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}

.yt-search-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-search-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.yt-search-reg-pill {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.yt-search-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 2px;
}

.yt-search-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
}

.yt-search-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-search-info {
  flex: 1;
  min-width: 0;
}

.yt-search-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.yt-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.yt-meta-views {
  white-space: nowrap;
}

.yt-search-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* =========================================================
   태블릿 · 아이패드 세로/가로 반응형 대응
   ========================================================= */
@media (max-width: 639px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (min-width: 640px) {
  .app-shell .header-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .app-shell .user-nick {
    max-width: 12em;
  }

  .app-shell .filter-panel {
    padding: 16px 18px;
    margin-bottom: 16px;
  }

  .app-shell .search-bar-row {
    flex-direction: row;
    align-items: center;
  }

  .app-shell .search-input-wrap {
    flex: 1 1 260px;
    width: auto;
  }

  .app-shell .search-bar-row .btn {
    width: auto;
    flex-shrink: 0;
  }

  .yt-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .watch-page {
    padding: 0 20px;
  }

  .watch-page .watch-layout.watch-single {
    max-width: clamp(640px, calc((100vh - 280px) * 16 / 9), 1040px);
    margin: 0 auto;
  }

  .watch-toolbar {
    padding: 10px 0 8px;
  }

  .watch-toolbar .tag {
    display: inline-flex;
  }

  .routine-play-bar {
    margin: 0 0 10px;
  }

  .app-shell .player-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  .watch-page .share-card {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
}

@media (min-width: 960px) {
  .app-page-editor .app-shell .watch-layout {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 20px;
    align-items: start;
  }

  .app-page-editor .app-shell .player-column {
    position: sticky;
    top: 64px;
  }
}

@media (min-width: 1024px) {
  .yt-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 16px;
  }

  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}
