/* 디자인 B — 몰입형 연습 스튜디오
   레이아웃: 위 유리 내비게이션 + 가운데 본문(최대 1200px) + 아래 고정 미니 플레이어(모바일은 아래 탭바).
   연습 화면은 화면 전체를 쓰는 어두운 무대(밝은 테마에서도 영상 플레이어처럼 어둡게 유지). */

/* ============ 토큰: 어두운 화면(기본) — 밤 연습실: 차분한 청록 + 따뜻한 스탠드 불빛 ============ */
/* 원칙: 강조색은 청록 하나만 단색으로 쓴다(그라데이션·색 번짐·빛 번짐 없음). 상태색(초록·주황·빨강)은 판정에만. */
:root,
.stage-root {
  color-scheme: dark;
  --bg: #0d1015;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.1);
  --solid-1: #141920;
  --solid-2: #1b2129;
  --glass: rgba(13, 16, 21, 0.8);
  --glass-strong: rgba(15, 18, 24, 0.92);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #ebe8e1;
  --text-2: #a6abb1;
  --text-3: #7c828a;
  --accent-1: #6fa8b9;
  --accent-hover: #82b6c5;
  --accent-ink: #9cc7d4;
  --accent-soft: rgba(111, 168, 185, 0.14);
  --on-accent: #0b1215;
  --focus: #9cc7d4;
  --ok: #7fbf95;
  --ok-soft: rgba(127, 191, 149, 0.13);
  --ok-line: rgba(127, 191, 149, 0.45);
  --warn: #d9a862;
  --warn-soft: rgba(217, 168, 98, 0.13);
  --bad: #df8277;
  --bad-soft: rgba(223, 130, 119, 0.13);
  --info: #8fb3d6;
  --info-soft: rgba(143, 179, 214, 0.13);
  --neutral-soft: rgba(255, 255, 255, 0.07);
  --heart: #e3a86b; /* 즐겨찾기 하트: 스탠드 불빛 색 */
  --shadow-1: none;
  --shadow-2: 0 20px 48px -16px rgba(0, 0, 0, 0.72);
  --tip-bg: #e9e6df;
  --tip-text: #0d1015;
  --toast-bg: #1d232a;
  --toast-text: #ebe8e1;
  /* 토스트는 두 테마 모두 어두운 바탕이라 아이콘 색을 따로 둔다 */
  --toast-ok: #8fd3a6;
  --toast-bad: #f0a097;
  --toast-info: #a9cfd9;
  --seg-on: #2a313a;
  /* 입력 칸: 바탕·테두리. --input-fill은 같은 색을 불투명하게(브라우저 자동 완성 색을 덮을 때) */
  --input-bg: var(--surface-2);
  --input-line: var(--line);
  --input-line-hover: var(--line-2);
  --input-fill: #1c1e23;
  --skel-1: rgba(255, 255, 255, 0.045);
  --skel-2: rgba(255, 255, 255, 0.1);
  /* 앨범 커버: 제목마다 색상(--hue)만 다르고 밝기·채도는 같은 차분한 단색 타일 */
  --cover-l: 0.36;
  --cover-c: 0.05;
  --glyph-l: 0.88;
  --glyph-c: 0.04;
  /* 차트 */
  --c-note: #6fa8b9; /* 부른 음(강조색과 같은 청록) */
  --c-lane-sharp: rgba(255, 255, 255, 0.03);
  --c-grid: rgba(255, 255, 255, 0.05);
  --c-grid-strong: rgba(255, 255, 255, 0.12);
  --c-label: #858b93;
  --c-label-strong: #e4e1da;
  --c-note-off: rgba(160, 166, 174, 0.3);
  --c-note-user: #e3a86b; /* 내가 그려 넣은 음 */
  --c-note-removed: rgba(223, 130, 119, 0.85); /* 내가 뺀 음(고치는 중에 점선으로) */
  --c-band: rgba(111, 168, 185, 0.06);
  --c-me: #cfd3d6;
  --c-hatch: rgba(255, 255, 255, 0.075);
  --c-playhead: #ffffff;
  --c-marker-bg: rgba(20, 25, 32, 0.94);
  --c-key-white: rgba(255, 255, 255, 0.17);
  --c-key-black: rgba(255, 255, 255, 0.045);
  --c-hover-lane: rgba(111, 168, 185, 0.12);
  /* 음역 막대 */
  --rb-track: rgba(255, 255, 255, 0.1);
  --rb-song: rgba(214, 218, 222, 0.4);
  --rb-me: rgba(111, 168, 185, 0.18);
  --rb-me-edge: rgba(156, 199, 212, 0.55);
  /* 건반 눈금 */
  --kr-line: #0d1015;
  --kr-white: #343b45;
  --kr-black: #15191e;
  --kr-me: #6198a8;
  --kr-me-b: #2b4f59;
  /* 건반 */
  --key-white: #d9dcdf;
  --key-white-line: #b8bcc0;
  --key-black: #161a1f;
  --key-label: #3d434a;
  --key-saved-white: #a9cfd9;
  --key-saved-black: #3d6f7c;
  --key-drop-white: rgba(20, 45, 55, 0.4);
  --key-drop-black: rgba(255, 255, 255, 0.42);
  --key-add-white: #a8dcb9;
  --key-add-black: #2f6e47;
  /* 글꼴·크기. 글자 크기는 본문 15px에서 장3도(×1.25)씩 올린 단계(음정 이름을 딴 비율), 그 사이 한 칸만 장2도(×1.125) */
  --font: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --fs-caption: 12px;
  --fs-body: 15px;
  --fs-lead: 17px;
  --fs-h3: 19px;
  --fs-h2: 23px;
  --fs-h1: 29px;
  --fs-display: 37px;
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --nav-h: 64px;
  --mini-h: 76px;
  --tab-h: 62px;
  /* 움직임: 짧고 일정하게. 들어올 때는 빠르게 시작해 부드럽게 멈추고, 나갈 때는 더 짧게 */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-in: cubic-bezier(0.3, 0, 0.8, 0.15);
  --t-fast: 120ms;
  --t-mid: 200ms;
  --t-slow: 320ms;
}

/* ============ 토큰: 밝은 화면 — 낮 연습실: 따뜻한 종이색 + 짙은 청록 ============ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #efefeb;
  --surface-3: #e4e4df;
  --solid-1: #ffffff;
  --solid-2: #f2f2ee;
  --glass: rgba(245, 245, 242, 0.84);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(20, 24, 28, 0.08);
  --line-2: rgba(20, 24, 28, 0.15);
  --text: #1a1e22;
  --text-2: #4c5258;
  --text-3: #686e74;
  --accent-1: #2f7385;
  --accent-hover: #285f6f;
  --accent-ink: #2a6676;
  --accent-soft: rgba(47, 115, 133, 0.1);
  --on-accent: #ffffff;
  --focus: #2a6676;
  --ok: #2e7d4f;
  --ok-soft: rgba(46, 125, 79, 0.1);
  --ok-line: rgba(46, 125, 79, 0.4);
  --warn: #94600f;
  --warn-soft: rgba(196, 138, 40, 0.13);
  --bad: #b8483b;
  --bad-soft: rgba(184, 72, 59, 0.1);
  --info: #2f6596;
  --info-soft: rgba(47, 101, 150, 0.1);
  --neutral-soft: rgba(20, 24, 28, 0.06);
  --heart: #c26a1c;
  --shadow-1: 0 1px 2px rgba(20, 24, 28, 0.04);
  --shadow-2: 0 18px 44px -18px rgba(20, 24, 28, 0.28), 0 2px 8px rgba(20, 24, 28, 0.06);
  --tip-bg: #1a1e22;
  --tip-text: #f5f5f2;
  --toast-bg: #1f2428;
  --toast-text: #f5f5f2;
  --seg-on: #ffffff;
  /* 밝은 테마 입력 칸은 흰 바탕 + 보이는 테두리(옅은 종이색 바탕 #f5f5f2와 구분되게) */
  --input-bg: #ffffff;
  --input-line: rgba(20, 24, 28, 0.18);
  --input-line-hover: rgba(20, 24, 28, 0.32);
  --input-fill: #ffffff;
  --skel-1: rgba(20, 24, 28, 0.05);
  --skel-2: rgba(20, 24, 28, 0.1);
  --cover-l: 0.9;
  --cover-c: 0.035;
  --glyph-l: 0.42;
  --glyph-c: 0.06;
  --c-note: #2f7385;
  --c-lane-sharp: rgba(20, 24, 28, 0.035);
  --c-grid: rgba(20, 24, 28, 0.05);
  --c-grid-strong: rgba(20, 24, 28, 0.13);
  --c-label: #6e747a;
  --c-label-strong: #1f2428;
  --c-note-off: rgba(104, 110, 116, 0.3);
  --c-note-user: #b86e1f;
  --c-note-removed: rgba(184, 72, 59, 0.8);
  --c-band: rgba(47, 115, 133, 0.05);
  --c-me: #3d4349;
  --c-hatch: rgba(20, 24, 28, 0.08);
  --c-playhead: #1a1e22;
  --c-marker-bg: rgba(255, 255, 255, 0.96);
  --c-key-white: rgba(20, 24, 28, 0.08);
  --c-key-black: rgba(20, 24, 28, 0.3);
  --c-hover-lane: rgba(47, 115, 133, 0.09);
  --rb-track: rgba(20, 24, 28, 0.1);
  --rb-song: rgba(60, 66, 72, 0.38);
  --rb-me: rgba(47, 115, 133, 0.13);
  --rb-me-edge: rgba(42, 102, 118, 0.5);
  --kr-line: #d6d6d1;
  --kr-white: #ffffff;
  --kr-black: #3a4046;
  --kr-me: #c4e0e8;
  --kr-me-b: #2f7385;
  --key-white: #ffffff;
  --key-white-line: #d6d6d1;
  --key-black: #24292e;
  --key-label: #5a6066;
  --key-saved-white: #cfe3e8;
  --key-saved-black: #2f7385;
  --key-drop-white: rgba(30, 60, 70, 0.36);
  --key-drop-black: rgba(255, 255, 255, 0.5);
  --key-add-white: #cdebd8;
  --key-add-black: #2e7d4f;
}

/* ============ 기본 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  /* 내용이 길어져 스크롤바가 생겨도 화면 폭이 줄어 옆으로 흔들리지 않게 스크롤바 자리를 늘 비워 둔다 */
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* 위에서 아래로 쌓고 본문이 남는 높이를 채운다: 짧은 화면에서도 약관 줄이 화면 맨 아래에 붙는다 */
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4, p, ol, ul, dl, dd {
  margin: 0;
}
ol, ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
img, svg, canvas {
  display: block;
  max-width: 100%;
}
.icon {
  flex: none;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-soft);
}
.muted {
  color: var(--text-3);
}
/* 화면에는 안 보이고 화면 읽기 프로그램만 읽는 글 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--solid-2);
  color: var(--text);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t-fast) var(--ease);
}
.skip-link:focus-visible {
  transform: none;
}
.show-mobile {
  display: none !important;
}
/* 아래 탭이 보이는 폭(위쪽 메뉴 대신)에서만 보이는 것: 아래 탭 5칸에서 빠진 보관함·노래 추가로 가는 단추 */
.tabbar-only {
  display: none !important;
}
@media (max-width: 960px) {
  .tabbar-only {
    display: flex !important;
  }
}

/* ============ 위쪽 내비게이션 ============ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1248px;
  height: var(--nav-h);
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-1);
  color: var(--on-accent);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14.5px;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-link[aria-current="page"] .icon {
  color: var(--accent-ink);
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ============ 본문 ============ */
main {
  flex: 1 0 auto;
  outline: none;
}
/* 화면 아래에 고정된 막대들의 높이(약관 줄·알림·저장 막대가 그만큼 비켜 선다). 미니 플레이어는 곡이 있을 때만(body.has-mini) */
body {
  --bottom-bars: 0px;
}
body.has-mini {
  --bottom-bars: calc(var(--mini-h) + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 960px) {
  body {
    --bottom-bars: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  }
  body.has-mini {
    --bottom-bars: calc(var(--tab-h) + var(--mini-h) + 8px + env(safe-area-inset-bottom, 0px));
  }
}
/* 화면 전환: 바깥은 투명도만(고정 위치 무대가 어긋나지 않게), 본문만 살짝 올라온다 */
.view {
  animation: view-fade var(--t-mid) var(--ease) both;
}

.page {
  max-width: 1248px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  padding-block: 36px 24px; /* 아래 빈자리(미니 플레이어·아래 탭 높이)는 그 아래 약관 줄(.site-foot)이 맡는다 */
  display: grid;
  gap: 48px;
}
.page > * {
  min-width: 0;
}
.page-head {
  display: grid;
  gap: 10px;
}
.page-title {
  font-size: var(--fs-h1);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
  outline: none;
}
.lede {
  max-width: 62ch;
  color: var(--text-2);
  font-size: var(--fs-lead);
}
.section-head {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
}
.section-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.016em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-sub {
  color: var(--text-3);
  font-size: 14px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* 내용은 상자에 넣지 않고 제목과 위쪽 가는 줄로 나눈다(노래방 책처럼). 상자는 도구·물건(무대, 차트, 리모컨, 커버, 대화 상자)에만 */
.card,
.section {
  position: relative;
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}
.section > .section-head,
.card > .section-head {
  margin-bottom: 0;
}
.card-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.016em;
  line-height: 1.35;
  text-wrap: balance;
}
.card-sub {
  color: var(--text-2);
  font-size: 14px;
}
.card-sub.is-error {
  color: var(--bad);
}
.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  margin-left: -4px;
  transition: color var(--t-fast), background var(--t-fast);
}
.back-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.stretch:focus-visible {
  outline: none;
}

/* ============ 버튼 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-mid), transform var(--t-fast), filter var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent-1);
  color: var(--on-accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-lg {
  height: 52px;
  padding: 0 24px;
  font-size: 16px;
}
.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* ============ 배지·칩·고르기 ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
}
.pill > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-sm {
  height: 24px;
  padding: 0 9px 0 7px;
  font-size: 12px;
}
.pill-lg {
  height: 34px;
  padding: 0 14px 0 11px;
  font-size: 14.5px;
}
.pill-ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.pill-okshift {
  color: var(--ok);
  background: var(--ok-soft);
}
.pill-warn {
  color: var(--text-2);
  background: var(--neutral-soft);
}
.pill-warn .icon {
  color: var(--warn);
}
.pill-text {
  padding: 0 10px;
}
.pill-bad {
  color: var(--bad);
  background: var(--bad-soft);
}
.pill-info {
  color: var(--info);
  background: var(--info-soft);
}
.pill-none {
  color: var(--text-2);
  background: var(--neutral-soft);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.chip-n {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  font-weight: 600;
}
.seg {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.seg-btn:hover:not(:disabled) {
  color: var(--text);
}
.seg-btn.is-on {
  background: var(--seg-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--line);
}
.seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background var(--t-mid);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform var(--t-mid) var(--ease);
}
.switch-input:checked + .switch-track {
  background: var(--accent-1);
  box-shadow: none;
}
.switch-input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}
.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.switch-input:disabled + .switch-track {
  opacity: 0.4;
}
.switch-label {
  font-size: 14px;
  font-weight: 600;
}

/* ============ 노래방 키 표시: 리모컨 버튼(♭3 · ♯2 · 원키) + 부르는 법 ============ */
.keyread {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
/* 아래 테두리가 두꺼운 버튼 모양: 리모컨에서 누를 버튼 */
.kcap {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 36px;
  height: 25px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  background: var(--solid-1);
  color: var(--text);
  font: 700 13px/1 var(--font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.keyread-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.keyread.tone-ok .kcap,
.keyread.tone-okshift .kcap {
  color: var(--ok);
  border-color: var(--ok-line);
}
.keyread.tone-warn .keyread-text .icon {
  color: var(--warn);
}
.keyread.tone-bad,
.keyread.tone-none {
  color: var(--text-3);
  font-weight: 500;
}
.keyread-sm {
  gap: 6px;
  font-size: 12.5px;
}
.keyread-sm .kcap {
  min-width: 32px;
  height: 23px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: 6px;
}
.keyread-lg {
  gap: 12px;
  font-size: 15px;
  color: var(--text);
}
.keyread-lg .kcap {
  min-width: 52px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border-bottom-width: 4px;
  font-size: 18px;
}
/* 곡 이름 옆 작은 꼬리표(MR · 가사) */
.tag-mini {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}

/* ============ 건반 눈금: 반음마다 건반 한 칸(검은 건반은 짙게), 내 음역 건반은 청록 ============ */
.kruler {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.kruler-keys {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 1px;
  height: 14px;
  padding: 1px;
  border-radius: 4px;
  background: var(--kr-line);
}
.kk {
  display: block;
  background: var(--kr-white);
}
.kk-b {
  background: var(--kr-black);
}
.kk-me {
  background: var(--kr-me);
}
.kk-b.kk-me {
  background: var(--kr-me-b);
}
.kk:first-child {
  border-radius: 3px 0 0 3px;
}
.kk:last-child {
  border-radius: 0 3px 3px 0;
}
.kruler-labels {
  position: relative;
  height: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.kruler-labels span {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

/* ============ 용어 도움말 ============ */
.term-wrap {
  position: relative;
  display: inline-block;
}
.term {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.term-tip {
  position: absolute;
  z-index: 70;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow-2);
  display: none; /* 닫혀 있을 때는 자리도 차지하지 않게(화면 밖으로 삐져나와 가로 스크롤이 생기지 않게) */
  pointer-events: none;
  transform: translateX(calc(-50% + var(--shift, 0px)));
}
.term-wrap.is-open .term-tip {
  display: block;
  animation: tip-in var(--t-fast) var(--ease);
}
@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateX(calc(-50% + var(--shift, 0px))) translateY(4px);
  }
}

/* ============ 입력 ============ */
.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--input-line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder {
  color: var(--text-3);
}
.input:hover {
  border-color: var(--input-line-hover);
}
.input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input-lg {
  height: 52px;
  font-size: 16px;
}
.search-wrap,
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap > .icon {
  position: absolute;
  left: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.input-search {
  padding-left: 42px;
  width: 260px;
}
.select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  width: auto;
}
.select option {
  background: var(--solid-1);
  color: var(--text);
}
.select-wrap > .icon {
  position: absolute;
  right: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.field {
  display: grid;
  gap: 8px;
}
.field-label {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-2);
}
.field-msg {
  font-size: 13px;
  color: var(--text-3);
}
.field-msg.is-error {
  color: var(--bad);
}

/* ============ 음역 막대 ============ */
.rbar {
  position: relative;
  height: 16px;
}
.rbar > div {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
}
.rbar-track {
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rb-track);
}
.rbar-me {
  height: 16px;
  border-radius: 6px !important;
  background: var(--rb-me);
  box-shadow: inset 1.5px 0 0 var(--rb-me-edge), inset -1.5px 0 0 var(--rb-me-edge);
}
.rbar-song {
  height: 4px;
  background: var(--rb-song);
}
.rbar-core {
  height: 8px;
  background: var(--accent-1);
  box-shadow: 0 0 0 2px var(--bg);
}
.rbar-over {
  height: 4px;
  background: var(--bad);
  box-shadow: 0 0 0 1.5px var(--bg);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12.5px;
  color: var(--text-3);
}
.lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.lg i {
  display: inline-block;
  flex: none;
}
.lg-core {
  width: 18px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-1);
}
.lg-song {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--rb-song);
}
.lg-me {
  width: 18px;
  height: 14px;
  border-radius: 4px;
  background: var(--rb-me);
  box-shadow: inset 1.5px 0 0 var(--rb-me-edge), inset -1.5px 0 0 var(--rb-me-edge);
}
.lg-over {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--bad);
}
.lg-note {
  width: 18px;
  height: 7px;
  border-radius: 3px;
  background: var(--accent-1);
}
.lg-off {
  width: 18px;
  height: 4px;
  border-radius: 3px;
  background: var(--c-note-off);
}
.lg-hatch {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--c-hatch) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lg-line {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--c-me);
}

/* ============ 앨범 커버(제목 해시 그라데이션) ============ */
.cover {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  container-type: inline-size;
  background: oklch(var(--cover-l) var(--cover-c) var(--hue, 220));
  color: oklch(var(--glyph-l) var(--glyph-c) var(--hue, 220));
  box-shadow: inset 0 0 0 1px var(--line);
}
/* 커버 사진(올린 사진·파일 안 그림·유튜브 썸네일·사진 링크): 기본 타일 위에 꽉 채워 덮는다 */
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-glyph {
  font-size: 44cqw;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cover-xs {
  width: 40px;
  border-radius: 8px;
}
.cover-sm {
  width: 52px;
  border-radius: 10px;
}
.cover-md {
  width: 100%;
}
.cover-lg {
  width: 220px;
  border-radius: var(--r-lg);
}

/* ============ 빈 화면·안내·불러오는 중 ============ */
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 20px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--accent-ink);
  margin-bottom: 4px;
}
.empty-title {
  font-size: 18px;
  font-weight: 700;
}
.empty-body {
  max-width: 44ch;
  color: var(--text-2);
}
.empty .btn {
  margin-top: 8px;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.notice-error {
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-soft);
}
.notice-warn {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-soft);
}
.notice-icon {
  flex: none;
  color: var(--bad);
  margin-top: 1px;
}
.notice-warn .notice-icon {
  color: var(--warn);
}
.notice-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.notice-body p {
  color: var(--text-2);
  font-size: 14px;
}
.skel {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--skel-1) 25%, var(--skel-2) 40%, var(--skel-1) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.progress-indeterminate {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}
.progress-indeterminate > span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--accent-1);
  animation: indeterminate 1.4s var(--ease) infinite;
}
.progress-indeterminate.small {
  height: 4px;
  margin-top: 8px;
}

/* ============ 토스트 ============ */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-bars) + 16px);
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(460px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  border-radius: var(--r-md);
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: var(--shadow-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 500;
  animation: toast-in var(--t-mid) var(--ease) both;
}
.toast.is-leaving {
  animation: toast-out 200ms ease both;
}
.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.toast-ok .toast-icon {
  color: var(--toast-ok);
}
.toast-error .toast-icon {
  color: var(--toast-bad);
}
.toast-info .toast-icon {
  color: var(--toast-info);
}
.toast-text {
  flex: 1;
  min-width: 0;
}
.toast-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.6;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* ============ 미니 플레이어 ============ */
.mini {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 39;
  height: calc(var(--mini-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
}
.mini-inner {
  max-width: 1248px;
  height: var(--mini-h);
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.mini-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.mini-cover {
  flex: none;
}
.mini-text {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}
.mini-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-title {
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mini-sub {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-sub.is-error {
  color: var(--bad);
}
.mini-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
}
.mini-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.mini-play:hover:not(:disabled) {
  background: var(--accent-hover);
}
.mini-play:active:not(:disabled) {
  transform: scale(0.94);
}
.mini-play:disabled {
  opacity: 0.6;
  cursor: progress;
}
.mini-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mini-time {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: center;
}
.mini-track {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
}
.mini-track-bg {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.mini-fill {
  position: absolute;
  inset: 0;
  background: var(--accent-1);
  transform-origin: left;
  transform: scaleX(0);
}
.mini-range {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.mini-range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.mini-track:hover .mini-range::-webkit-slider-thumb,
.mini-range:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}
.mini-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}
.mini-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
/* 노래·반주 크기: 스피커 단추 + 마우스를 올리면(키보드로 오면) 옆으로 펼쳐지는 막대. 벗어나면 잠깐 뒤에 접는다 */
.vol {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.vol-slide {
  display: flex;
  align-items: center;
  width: 0;
  height: 36px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: width 180ms var(--ease) 280ms, opacity 140ms linear 280ms, visibility 0s linear 460ms;
}
/* 키보드로 왔을 때만 초점이 펼쳐 둔다(:focus-visible). 마우스로 막대를 누른 뒤 치우면 접혀야 해서 :focus-within은 안 쓴다 */
.vol:hover .vol-slide,
.vol:has(:focus-visible) .vol-slide,
.vol:has(.vol-range:active) .vol-slide {
  width: 100px;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.vol-range {
  appearance: none;
  flex: none;
  width: 84px;
  height: 4px;
  margin: 0 8px;
  border-radius: 999px;
  background: linear-gradient(var(--accent-1), var(--accent-1)) 0 / var(--p, 100%) 100% no-repeat, var(--surface-3);
  cursor: pointer;
}
.vol-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}
.vol-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}
.vol-range:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}
/* 연습 무대: 막대를 단추 위에 띄운다(가운데 정렬된 단추 줄이 밀리지 않고, 옆의 노래방 키 칸도 가리지 않게) */
.vol-float .vol-slide {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  translate: -50% 0;
  z-index: 5;
  height: 32px;
  border-radius: 999px;
  background: var(--solid-1);
  box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-2);
}
.vol-float:hover .vol-slide,
.vol-float:has(:focus-visible) .vol-slide,
.vol-float:has(.vol-range:active) .vol-slide {
  width: 104px;
}
.mini-vol .vol-btn {
  width: 36px;
  height: 36px;
}
@media (prefers-reduced-motion: reduce) {
  .vol-slide {
    transition: none;
  }
}
body[data-route="practice"] .topnav,
body[data-route="practice"] .mini,
body[data-route="practice"] .tabbar {
  display: none;
}

/* ============ 아래 탭바(모바일) ============ */
.tabbar {
  display: none;
}

/* ============ 홈 ============ */
.home-head {
  gap: 12px;
}
.home-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.home-quick {
  align-items: center;
  gap: 4px;
  margin-right: -6px;
}
.callout {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
}
.callout-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.callout-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.callout-body h2 {
  font-size: 18px;
  font-weight: 700;
}
.callout-body p {
  color: var(--text-2);
  font-size: 14.5px;
}
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.section-head-row > div:first-child {
  display: grid;
  gap: 2px;
}
.shelf-navs {
  display: flex;
  gap: 6px;
}
.shelf-nav {
  border: 1px solid var(--line);
}
.shelf-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 172px;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 14px 14px 14px;
  margin: -14px -14px 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent);
}
.shelf-row::-webkit-scrollbar {
  display: none;
}
.shelf-row.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}
.shelf-card {
  position: relative;
  display: grid;
  gap: 4px;
  align-content: start;
  scroll-snap-align: start;
  padding: 10px 10px 14px;
  margin: -10px -10px 0;
  border-radius: var(--r-lg);
  transition: background var(--t-mid) var(--ease);
}
.shelf-card:hover {
  background: var(--surface);
}
.shelf-card:has(.stretch:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.shelf-cover {
  position: relative;
  margin-bottom: 8px;
}
.shelf-cover .cover {
  width: 100%;
}
.shelf-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t-mid), transform var(--t-mid) var(--ease);
}
.shelf-card:hover .shelf-play,
.shelf-play:focus-visible {
  opacity: 1;
  transform: none;
}
.shelf-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-artist {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.shelf,
.library {
  display: grid;
  gap: 16px;
}
.shelf > .section-head {
  margin-bottom: 0;
}
.lib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lib-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rows-head,
.row {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1.05fr) minmax(280px, 1.7fr) 236px 40px;
  align-items: center;
  column-gap: 20px;
}
.rows-head {
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
}
.rh-song {
  grid-column: 1 / 3;
}
.rows {
  display: grid;
  gap: 4px;
}
.row {
  position: relative;
  padding: 12px 16px;
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease);
}
.row:hover {
  background: var(--surface-2);
}
.row:has(.stretch:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 0;
}
.row .cover {
  grid-area: auto;
}
.row-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.row-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sep {
  margin: 0 6px;
  opacity: 0.6;
}
.row-range {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.row-range-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.row-core {
  color: var(--text-3);
}
.row-verdict {
  min-width: 0;
}
.row-practice {
  position: relative;
  z-index: 1;
  color: var(--text-3);
}
.row:hover .row-practice {
  color: var(--text);
}
.rows-empty {
  list-style: none;
}
.legend-rows {
  padding: 4px 16px 0;
}
.home-skeleton {
  display: grid;
  gap: 10px;
}
.skel-shelf {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
  overflow: hidden;
}
.skel-card {
  flex: none;
  width: 172px;
  height: 236px;
}
.skel-row {
  height: 76px;
}

/* ============ 홈 첫머리: 내 음역(큰 음 이름) + 누르면 소리 나는 건반 ============ */
.range-hero {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}
.range-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}
.range-hero-title {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text-2);
}
.range-hero-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.range-hero-value .note-read-oct {
  font-size: var(--fs-body);
}
.range-hero-value .note-read-name {
  font-size: var(--fs-display);
  letter-spacing: -0.03em;
}
.range-hero-tilde {
  font-size: var(--fs-h2);
  color: var(--text-3);
}
.range-hero-value.is-empty {
  color: var(--text-3);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.range-hero-head .btn {
  margin-left: auto;
  align-self: center;
}
/* 누르는 건반: 내 음역 화면 건반과 같은 모양, 더 낮게 */
.kb {
  display: grid;
  gap: 2px;
}
.keys-play {
  height: 88px;
}
.keys-play .key {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.keys-play .key-white {
  border-right: 1px solid var(--key-white-line);
}
.keys-play .key-white:hover {
  background: color-mix(in srgb, var(--key-white) 88%, var(--accent-1));
}
.keys-play .key-white.in-saved:hover {
  background: color-mix(in srgb, var(--key-saved-white) 80%, var(--accent-1));
}
.keys-play .key-black:hover {
  background: color-mix(in srgb, var(--key-black) 80%, var(--accent-1));
}
.keys-play .key:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
  z-index: 3;
}
/* 누른 건반이 살짝 눌렸다 올라오며 강조색으로 반짝인다(누른 것에 답하는 움직임) */
.keys-play .key.is-down {
  animation: key-hit 420ms var(--ease-out);
}
@keyframes key-hit {
  0% {
    background: var(--accent-1);
    transform: translateY(2px);
  }
  100% {
    transform: none;
  }
}
.kb .keys-labels {
  margin-top: 4px;
}
.kb-said {
  min-height: 21px;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .keys-play {
    height: 72px;
    min-width: 0;
  }
  .kb .keys-labels {
    min-width: 0;
  }
  .range-hero-value .note-read-name {
    font-size: var(--fs-h1);
  }
  /* 휴대폰: '내 음역'과 단추를 한 줄에, 음 이름은 그 아래(단추가 혼자 한 줄을 차지하지 않게) */
  .range-hero-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 2px;
  }
  .range-hero-title {
    grid-column: 1;
    grid-row: 1;
  }
  .range-hero-head .btn {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  /* 글자만 있는 '다시 재기'는 글자 끝을 오른쪽 선에 맞춘다(바탕이 있는 '내 음역 재기'는 그대로) */
  .range-hero-head .btn-ghost {
    margin-right: -10px;
  }
  .range-hero-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ============ 곡 상세 ============ */
.page-song {
  gap: 24px;
}
.song-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  column-gap: 32px;
  row-gap: 20px;
}
.hero-body {
  display: grid;
  gap: 12px;
  justify-items: start;
  min-width: 0;
}
.song-hero > .back-link {
  grid-column: 1 / -1;
}
/* 제목 · 가수 · 길이(제목 아래에 가수, 음악 앱과 같은 순서) */
.hero-id {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.hero-artist {
  font-size: var(--fs-lead);
  font-weight: 600;
  color: var(--text-2);
}
.hero-title {
  font-size: var(--fs-display);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
  outline: none;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: var(--text-2);
  font-size: 14px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.stat-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}
.stat-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.song-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.guide-headline {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.35;
  text-wrap: balance;
}
.tone-ok .guide-headline,
.tone-okshift .guide-headline {
  color: var(--text);
}
.remote-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px 28px;
  padding: 24px 26px;
  border-radius: var(--r-lg);
  background: #181d24;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #ebe8e1;
}
.remote-panel.is-text {
  grid-template-columns: minmax(0, 1fr);
}
.remote-text {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.remote-panel .guide-headline {
  color: #f3f1ec;
}
.remote-panel .guide-steps li,
.remote-panel .guide-step-one {
  color: #b9bdc2;
}
.remote-panel .guide-steps li::before {
  background: rgba(255, 255, 255, 0.1);
  color: #ebe8e1;
}
.keypad {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 260px;
}
.keycap {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.keycap-sym {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #e9e6df;
  color: #14181d;
  box-shadow: 0 4px 0 #9a978f, 0 8px 14px -4px rgba(0, 0, 0, 0.5);
  font-size: 26px;
  font-weight: 700;
  animation: keypress 460ms var(--ease) both;
  animation-delay: calc(450ms + var(--i, 0) * 300ms);
}
.keycap-n {
  font-size: 12px;
  font-weight: 600;
  color: #9aa0a6;
  font-variant-numeric: tabular-nums;
}
.key-display {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 96px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.key-display-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #8fd3a6;
}
.key-display-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #9aa0a6;
}
.guide-steps {
  display: grid;
  gap: 10px;
  counter-reset: step;
}
.guide-steps li {
  position: relative;
  padding-left: 36px;
  font-size: 15px;
  line-height: 1.6;
  counter-increment: step;
}
.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.guide-step-one {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.6;
}
.guide-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 0;
}
.fact {
  display: grid;
  gap: 2px;
}
.fact dt {
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 600;
}
.fact dd {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
/* 음역 아래 음 요약: 상자 없이 이름-값 두 줄씩 */
.range-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 4px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.range-facts > div {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}
.range-facts dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.range-facts dd {
  display: grid;
  gap: 2px;
  justify-items: start;
  margin: 0;
}
/* 큰 음 이름: 옥타브는 작게 앞에, 음 이름은 크게(이 사이트의 음 표기) */
.note-read {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.note-read-oct {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.note-read-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.range-fact-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.range-fact-text.is-over {
  color: var(--bad);
}
.range-fact-text.is-under {
  color: var(--ok);
}
.range-fact-sub {
  font-size: 12.5px;
  color: var(--text-3);
}
.cmp-scale .kruler {
  grid-column: 2;
}
.guide-notes {
  display: grid;
  gap: 6px;
}
.guide-notes li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
  color: var(--text-2);
}
.guide-notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
}
.cmp {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.cmp-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 4px 14px;
}
.cmp-row .cmp-text {
  grid-column: 2;
  font-size: 12.5px;
  color: var(--text-2);
}
.cmp-label {
  display: grid;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
}
.cmp-label small {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 600;
}
.melody-card {
  gap: 16px;
}
.melody-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.melody-head > div:first-child {
  display: grid;
  gap: 4px;
}
.melody-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.melody-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.listen {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.round-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.round-play:hover {
  background: var(--accent-hover);
}
.round-play:active {
  transform: scale(0.94);
}
.listen-info {
  display: grid;
  min-width: 0;
}
.listen-time {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.listen-status {
  font-size: 12.5px;
  color: var(--text-3);
}
.listen-status.is-error {
  color: var(--bad);
}
.mchart {
  display: grid;
  gap: 10px;
}
.mchart-main {
  position: relative;
  height: 400px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.mchart-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-y;
  outline: none;
}
.mchart-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus);
}
.mchart-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 1px;
  min-width: 140px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--tip-bg);
  color: var(--tip-text);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  pointer-events: none;
}
.mchart-tip strong {
  font-size: 14px;
}
.tip-muted {
  opacity: 0.7;
}
.tip-over {
  color: var(--bad);
  font-weight: 650;
}
:root:not([data-theme="light"]) .tip-over {
  color: #b8483b;
}
.tip-hint {
  margin-top: 4px;
  opacity: 0.55;
  font-size: 11.5px;
}
.mchart-overview {
  position: relative;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}
.mchart-ov-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.song-skeleton {
  display: grid;
  gap: 16px;
}
.skel-hero {
  height: 290px;
  border-radius: var(--r-xl);
}
.skel-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.skel-tile {
  height: 112px;
}
.skel-chart {
  height: 460px;
  border-radius: var(--r-lg);
}

/* ============ 내 음역 ============ */
.studio {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 24px;
}
.live {
  display: grid;
  gap: 18px;
  align-content: start;
  justify-items: center;
  text-align: center;
  padding: 8px 0;
}
.live-display {
  display: grid;
  justify-items: center;
  min-height: 170px;
  align-content: center;
}
.live-oct {
  font-size: 18px;
  font-weight: 650;
  color: var(--text-2);
  min-height: 27px;
}
.live-note {
  font-size: 104px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
/* 소리가 없을 때: 음 이름 자리는 비우고 안내 문장을 크게(칸 높이는 그대로라 음이 나타나도 아래가 밀리지 않는다) */
.live-note.is-empty {
  display: none;
}
.live-note.is-empty + .live-hint {
  margin-top: 0;
  color: var(--text-2);
  font-size: var(--fs-lead);
  font-weight: 600;
  text-align: center;
}
.live-hint {
  font-size: 14px;
  color: var(--text-3);
  min-height: 22px;
  margin-top: 6px;
}
.cents {
  width: min(360px, 100%);
  display: grid;
  gap: 6px;
}
.cents-scale {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
}
.cents-zone {
  position: absolute;
  left: 35%;
  right: 35%;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--ok-soft);
  box-shadow: inset 0 0 0 1px var(--ok-line);
}
.cents-mid {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--ok);
  border-radius: 2px;
}
.cents-needle {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: var(--text);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--bg);
  transition: left 90ms linear, background var(--t-fast);
}
.cents-needle.is-ok {
  background: var(--ok);
}
.cents-needle.is-hidden {
  opacity: 0;
}
.cents-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}
.cents-text {
  font-weight: 650;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.level {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
}
.level-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}
.level-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.level-fill {
  position: absolute;
  inset: 0;
  background: var(--ok);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 80ms linear;
}
.live-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.notice-slot {
  width: 100%;
  text-align: left;
}
.trace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.trace-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.saved-range {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  outline: none;
}
.trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.trace-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}
.trace-legend i {
  display: inline-block;
  width: 16px;
}
.lg-voice {
  height: 3px;
  border-radius: 2px;
  background: var(--accent-1);
}
.lg-me-line {
  height: 0;
  border-top: 2px dashed var(--c-me);
  margin-left: 8px;
}
.trace-plot {
  position: relative;
  min-height: 300px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.trace-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* 잰 결과: 스튜디오 안의 이름-값 두 개 + 저장(상자 안 상자 없이, 위쪽 가는 줄로만 나눔) */
.result {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: end;
  gap: 12px 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.res {
  display: grid;
  gap: 2px;
  align-content: end;
}
.res-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 650;
}
.res-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 28px;
  font-weight: 700;
  min-height: 40px;
}
.res-oct {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-2);
}
.res-note {
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.res-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}
.res-span {
  font-size: 13.5px;
  color: var(--text-2);
}
.confirm-slot {
  grid-column: 1 / -1;
}
.confirm-slot:empty {
  display: none;
}
.confirm {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  animation: pop-in var(--t-mid) var(--ease) backwards;
}
.confirm-diff {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
}
.confirm-diff span {
  color: var(--text-2);
  text-decoration: line-through;
}
.confirm-actions {
  display: flex;
  gap: 8px;
}
.me-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.keys-wrap {
  padding-bottom: 6px;
  overflow-x: auto;
}
.keys {
  position: relative;
  display: flex;
  height: 132px;
  min-width: 320px;
  border-radius: 12px;
  overflow: hidden;
}
/* 테두리를 건반 위에 그린다(흰 건반이 흰 카드와 섞이지 않게) */
.keys::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line-2);
  pointer-events: none;
}
.key-white {
  position: relative;
  flex: 1;
  background: var(--key-white);
  border-right: 1px solid var(--key-white-line);
  transition: background var(--t-mid);
}
.key-white:last-of-type {
  border-right: 0;
}
.key-white.in-saved {
  background: var(--key-saved-white);
}
.key-black {
  position: absolute;
  top: 0;
  z-index: 1;
  height: 60%;
  width: calc(100% / var(--whites) * 0.6);
  left: calc(100% / var(--whites) * var(--w) - (100% / var(--whites) * 0.3));
  background: var(--key-black);
  border-radius: 0 0 6px 6px;
  transition: background var(--t-mid);
}
.key-black.in-saved {
  background: var(--key-saved-black);
}
.key.in-new::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 5px;
  border-radius: 999px;
  background: var(--ok);
}
.key-white.in-new::after {
  bottom: 26px;
}
/* 저장하면 빠지는 음(빗금)·더해지는 음(초록) */
.key.is-drop::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(135deg, var(--key-drop-white) 0 2px, transparent 2px 7px);
}
.key-black.is-drop::before {
  background: repeating-linear-gradient(135deg, var(--key-drop-black) 0 2px, transparent 2px 6px);
}
.key-white.is-add {
  background: var(--key-add-white);
}
.key-black.is-add {
  background: var(--key-add-black);
}
.keys-labels {
  position: relative;
  height: 20px;
  min-width: 320px;
  margin-top: 6px;
}
.key-label {
  position: absolute;
  top: 0;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-3);
  white-space: nowrap;
}
.lg-key-saved {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: var(--key-saved-white);
}
.lg-key-new {
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: var(--ok);
}
.lg-key-drop {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--key-drop-white) 0 2px, transparent 2px 6px), var(--key-saved-white);
}
.lg-key-add {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  background: var(--key-add-white);
}
/* 직접 정하기 */
.manual {
  display: grid;
  gap: 14px;
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.manual-head {
  display: grid;
  gap: 4px;
}
.manual-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.012em;
}
.manual-desc {
  color: var(--text-2);
  font-size: 14px;
}
.manual-rows {
  display: grid;
  gap: 10px;
}
.manual-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 340px);
  align-items: center;
  gap: 8px 14px;
}
.manual-label {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}
.stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.step-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.step-btn:hover:not([aria-disabled="true"]) {
  background: var(--accent-soft);
}
.step-btn:active:not([aria-disabled="true"]) {
  transform: scale(0.94);
}
.step-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}
.step-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.step-oct {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
}
.step-note {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.step-value.is-changed .step-note {
  color: var(--accent-ink);
}
.manual-status {
  display: grid;
  gap: 4px;
  font-size: 13.5px;
  color: var(--text-2);
}
.manual-limit {
  color: var(--warn);
}
.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.how-steps {
  display: grid;
  gap: 12px;
  counter-reset: how;
}
.how-steps li {
  position: relative;
  padding-left: 38px;
  font-size: 14.5px;
  color: var(--text-2);
  counter-increment: how;
}
.how-steps li strong {
  color: var(--text);
  font-weight: 650;
}
.how-steps li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}
.how-note,
.fine-print {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.how-note .icon,
.fine-print .icon {
  margin-top: 2px;
}

/* ============ 노래 추가 ============ */
.add-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.add-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.add-card {
  gap: 18px;
}
.add-form {
  display: grid;
  gap: 10px;
}
.add-input-row {
  position: relative;
  display: flex;
  gap: 10px;
}
.input-icon {
  position: absolute;
  left: 16px;
  top: 17px;
  color: var(--text-3);
  pointer-events: none;
}
.add-input-row .input {
  padding-left: 46px;
  flex: 1;
  min-width: 0;
}
.preview {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: pop-in var(--t-mid) var(--ease) backwards;
}
.preview-loading {
  align-items: center;
}
.skel-thumb {
  width: 112px;
  height: 112px;
  border-radius: 18px;
}
.preview-lines {
  display: grid;
  gap: 10px;
}
.skel-line {
  height: 16px;
  border-radius: 8px;
}
.skel-line.short {
  width: 40%;
}
.preview-thumb {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: var(--r-md);
  background: oklch(var(--cover-l) var(--cover-c) var(--hue, 220));
  color: oklch(var(--glyph-l) var(--glyph-c) var(--hue, 220));
}
.preview-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.preview-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}
.preview-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: -8px;
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.jobs {
  display: grid;
}
.job {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.job:first-child {
  border-top: 0;
}
.job-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
}
.job-icon.tone-ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.job-icon.tone-bad {
  color: var(--bad);
  background: var(--bad-soft);
}
.job-icon.tone-info {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.job-body {
  min-width: 0;
}
.job-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.job-kind {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
}
.job-msg {
  font-size: 13.5px;
  color: var(--text-2);
}
.job-error .job-msg {
  color: var(--bad);
}
.job-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.job-time {
  font-size: 12px;
  color: var(--text-3);
}
.jobs-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
}
.jobs-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-3);
}
.jobs-empty p {
  display: grid;
  font-size: 14px;
}
.jobs-empty p span {
  color: var(--text-3);
  font-size: 13.5px;
}
.flow {
  display: grid;
  gap: 12px;
  counter-reset: flow;
}
.flow li {
  position: relative;
  display: grid;
  gap: 1px;
  padding-left: 36px;
  counter-increment: flow;
}
.flow li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.flow strong {
  font-size: 15px;
}
.flow li > span:last-child {
  font-size: 13.5px;
  color: var(--text-2);
}

/* ============ 연습 무대(항상 어둡게) ============ */
.stage-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "hud" "stage" "lyrics" "dock";
  grid-template-columns: minmax(0, 1fr);
  color: var(--text);
  background: #0a0d11;
  overflow: hidden;
}
/* 무대 색(연습 무대·발성 연습 무대) */
.stage-root {
  --s-text: #ebe8e1;
  --s-label: #7c828a;
  --s-lane: rgba(255, 255, 255, 0.028);
  --s-grid: rgba(255, 255, 255, 0.075);
  --s-past: rgba(111, 168, 185, 0.24);
  --s-off: rgba(170, 176, 182, 0.15);
  --s-hit: #7fbf95;
  --s-hit-rgb: 127, 191, 149;
  --s-ground-rgb: 10, 13, 17;
  --s-voice: #ffffff;
  --s-now: rgba(255, 255, 255, 0.6);
  --s-gap: rgba(255, 255, 255, 0.025);
  --s-lane-on: rgba(111, 168, 185, 0.1);
}
.stage-root.is-loading {
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top" "stage";
}
.stage-skeleton {
  grid-area: stage;
}
.hud {
  grid-area: hud;
}
.stage-canvas-wrap {
  grid-area: stage;
}
.dock {
  grid-area: dock;
}
.stage-top {
  grid-area: top;
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 8px max(20px, env(safe-area-inset-left, 0px));
}
.stage-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  transition: background var(--t-fast), color var(--t-fast);
}
.stage-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.stage-song {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.stage-song strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-song span {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.stage-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.mic-badge,
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
}
.mic-badge.is-on {
  color: var(--ok);
  background: var(--ok-soft);
}
.demo-badge {
  color: var(--warn);
  background: var(--warn-soft);
}

/* 위쪽 안내 띠 */
.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 4px max(28px, env(safe-area-inset-right, 0px)) 12px max(28px, env(safe-area-inset-left, 0px));
}
.hud-target {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-width: 0;
}
.hud-target-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.first-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.first-note-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.first-note-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hud-target-name.is-flash {
  animation: note-flash 1s var(--ease);
}
@keyframes note-flash {
  0%,
  35% {
    color: var(--accent-ink);
  }
}
.hud-target-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.03em;
}
.hud-target-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hud-target-name.is-empty {
  color: var(--text-3);
}
.hud-direction {
  min-height: 21px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}
.hud-direction[data-tone="ok"] {
  color: var(--ok);
}
.hud-direction[data-tone="up"],
.hud-direction[data-tone="down"] {
  color: var(--accent-ink);
}
.hud-direction[data-tone="warn"] {
  color: var(--warn);
}
.meter {
  position: relative;
  width: min(280px, 100%);
  height: 10px;
  margin: 4px 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.meter-zone {
  position: absolute;
  left: 37.5%;
  right: 37.5%;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: rgba(127, 191, 149, 0.22);
  box-shadow: inset 0 0 0 1px rgba(127, 191, 149, 0.5);
}
.meter-mid {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--ok);
}
.meter-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px #0a0d11;
  transition: left 80ms linear, background var(--t-fast), opacity var(--t-fast);
}
.meter-needle.is-ok {
  background: var(--ok);
}
.meter-needle.is-hidden {
  opacity: 0;
}
.meter-tick {
  position: absolute;
  top: 14px;
  font-size: 11px;
  color: var(--text-3);
}
.meter-tick-l {
  left: 0;
}
.meter-tick-r {
  right: 0;
}
.hud-voice {
  display: grid;
  justify-items: center;
  text-align: center;
  min-width: 220px;
}
.hud-oct {
  min-height: 22px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-2);
}
.hud-note {
  font-size: 88px;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  transition: color 120ms ease;
}
/* 소리가 없을 때의 줄표: 가늘게(굵은 줄표는 덜 그려진 막대처럼 보인다). 칸 크기는 그대로 */
.hud-note.is-empty {
  color: rgba(255, 255, 255, 0.22);
  font-weight: 200;
}
.score-num.is-empty {
  color: rgba(255, 255, 255, 0.22);
}
.stage-root.is-hit .hud-note {
  color: var(--ok);
}
.hud-voice-hint {
  min-height: 19px;
  font-size: 13px;
  color: var(--text-3);
}
.hud-score {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.score-box {
  display: grid;
  justify-items: end;
  min-width: 84px;
  padding: 2px 4px;
}
.score-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}
.score-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.score-word {
  min-height: 17px;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-ink);
}

/* 무대 그림 */
.stage-canvas-wrap {
  position: relative;
  min-height: 0;
  margin: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.018);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: box-shadow var(--t-slow) var(--ease);
}
.stage-root.is-hit .stage-canvas-wrap {
  box-shadow: inset 0 0 0 1px rgba(127, 191, 149, 0.3);
}
.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 25, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  transform: translateX(-50%);
  animation: banner-in var(--t-mid) var(--ease) both;
  white-space: nowrap;
}
.phrase-toast {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 4;
  pointer-events: none;
}
.phrase-pop {
  display: grid;
  justify-items: end;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: rgba(20, 25, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pop-in 300ms var(--ease) backwards;
}
.phrase-pop.is-leaving {
  animation: toast-out 300ms ease both;
}
.phrase-pop-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.phrase-pop-word {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
}
.phrase-pop.is-great .phrase-pop-num {
  color: var(--ok);
}
.phrase-pop.is-good .phrase-pop-num {
  color: var(--accent-ink);
}
.phrase-pop.is-fair .phrase-pop-num {
  color: var(--warn);
}
.phrase-pop.is-low .phrase-pop-num {
  color: var(--bad);
}
.countdown {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(5, 6, 10, 0.35);
}
.count-num {
  font-size: clamp(110px, 18vw, 190px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  animation: count-pop 750ms var(--ease) both;
}
.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(5, 6, 10, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay-card {
  width: min(540px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: rgba(20, 25, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  animation: pop-in 320ms var(--ease) backwards;
}
.overlay-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.overlay-sub {
  color: var(--text-3);
  font-size: 14px;
}
.overlay-text {
  color: var(--text-2);
  font-size: 15px;
}
.overlay-text.muted {
  color: var(--text-3);
  font-size: 14px;
}
.overlay-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
}
.overlay-icon.tone-bad {
  color: var(--bad);
  background: var(--bad-soft);
}
.overlay-icon.tone-warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
/* 키보드 안내: 항목마다 띄어 쓴다(가운뎃점 없이) */
.overlay-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  font-size: 12.5px;
  color: var(--text-3);
}
.ready-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ready-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ready-list {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
}
.ready-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.ready-list li .icon {
  margin-top: 2px;
  color: var(--accent-ink);
}
.ready-list strong {
  color: var(--text);
}
.loader {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 34px;
}
.loader span {
  width: 7px;
  height: 100%;
  border-radius: 4px;
  background: var(--accent-1);
  transform-origin: bottom;
  animation: eq 900ms ease-in-out infinite;
}
.loader span:nth-child(2) {
  animation-delay: 150ms;
}
.loader span:nth-child(3) {
  animation-delay: 300ms;
}
.loading-elapsed {
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.result-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.result-num {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.result-unit {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-2);
}
.result-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.result-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 3px 3px 1px 1px;
  background: rgba(255, 255, 255, 0.15);
}
.result-bar.is-great {
  background: var(--ok);
}
.result-bar.is-good {
  background: var(--accent-1);
}
.result-bar.is-fair {
  background: var(--warn);
}
.result-bar.is-low {
  background: var(--bad);
}

/* 아래 조작부 */
.dock {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px max(28px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(28px, env(safe-area-inset-left, 0px));
}
.dock-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dock-scrub {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}
.dock-time {
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.scrub {
  position: relative;
  height: 28px;
}
.scrub-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.scrub-phrases {
  position: absolute;
  inset: 0;
}
.scrub-gap {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 5px);
}
.scrub-phrase {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
}
.scrub-phrase.is-great {
  background: var(--ok);
}
.scrub-phrase.is-good {
  background: var(--accent-1);
}
.scrub-phrase.is-fair {
  background: var(--warn);
}
.scrub-phrase.is-low {
  background: var(--bad);
}
.scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(111, 168, 185, 0.3);
  border-right: 2px solid #ffffff;
}
.scrub-input {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.scrub-input::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.scrub-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}
.dock-main {
  justify-content: space-between;
  gap: 24px;
}
.transport {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.t-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.t-btn:hover,
.t-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.t-vol {
  margin-left: 6px; /* 재생 이동 단추들과 살짝 띄운다 */
}
.play-main {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 6px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.play-main:hover {
  background: var(--accent-hover);
}
.play-main:active {
  transform: scale(0.96);
}
.settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px 22px;
  min-width: 0;
}
.set-group {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-width: 0;
}
.set-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.set-basis {
  font-weight: 600;
  letter-spacing: 0;
}
.set-note {
  max-width: 210px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}
.set-note.is-warn {
  color: var(--warn);
}
.set-note.is-hint {
  color: var(--text-2);
}
.set-note .link-btn {
  font-size: 12px;
}
.key-stepper {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.key-btn {
  min-width: 40px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-fast);
}
.key-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}
.key-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.key-value {
  min-width: 46px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.set-tip {
  display: none;
}
.sheet-head {
  align-items: center;
  justify-content: space-between;
}
.sheet-backdrop {
  display: none;
}
.stage-skeleton {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
}
.skel-stage {
  width: min(1100px, 100%);
  height: 50vh;
  border-radius: var(--r-lg);
  --skel-1: rgba(255, 255, 255, 0.04);
  --skel-2: rgba(255, 255, 255, 0.08);
}
.stage-skeleton-text {
  color: var(--text-3);
  font-size: 14px;
}

/* ============ 켜기 스위치 + 작은 창 조절(내 목소리 · 멜로디 안내음) ============ */
.pop-group {
  position: relative;
}
.pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pop-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pop-chip:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}
.pop-group.is-on .pop-chip {
  border-color: color-mix(in srgb, var(--accent-1) 60%, transparent);
  color: var(--text);
}
.pop-group.is-open .pop-chip {
  background: var(--surface-3);
  color: var(--text);
}
.pop-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pop-group.is-live .pop-status {
  color: var(--ok);
}
.pop-panel,
.voice-warn {
  position: absolute;
  z-index: 30;
  width: 320px;
  max-width: calc(100vw - 32px);
  border-radius: 14px;
  background: var(--solid-1);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  text-align: left;
}
.pop-panel {
  display: none;
  gap: 14px;
  padding: 16px;
}
.pop-group.is-open .pop-panel {
  display: grid;
  animation: pop-in 200ms var(--ease) backwards;
}
.pop-up .pop-panel,
.pop-up .voice-warn {
  bottom: calc(100% + 12px);
  right: 0;
}
.pop-down .pop-panel,
.pop-down .voice-warn {
  top: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  scroll-margin: 16px 0 calc(var(--bottom-bars) + 24px);
}
.pop-field {
  display: grid;
  gap: 8px;
}
.pop-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pop-out {
  font-size: 13.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pop-slider {
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 8px 0;
  border-radius: 999px;
  background: linear-gradient(var(--accent-1), var(--accent-1)) 0 / var(--p, 66.7%) 100% no-repeat, var(--surface-3);
  cursor: pointer;
}
.pop-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.45);
}
.pop-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}
.pop-slider.has-mid {
  /* 가운데(100% = 마이크 그대로) 눈금 */
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--text-3) calc(50% - 1px), var(--text-3) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(var(--accent-1), var(--accent-1)) 0 / var(--p, 50%) 100% no-repeat,
    var(--surface-3);
}
.pop-slider:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}
.pop-slider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pop-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.voice-warn {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
  animation: pop-in 220ms var(--ease) backwards;
}
.voice-warn-icon {
  color: var(--warn);
  margin-top: 1px;
}
.voice-warn p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.voice-warn .btn {
  grid-column: 2;
  justify-self: end;
}
.live .pop-group {
  justify-items: center;
  text-align: center;
  width: fit-content;
  margin: 2px auto 0;
}

/* ============ 가사 ============ */
.shelf-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.shelf-pills .pill {
  flex: 0 1 auto;
  min-width: 0;
}
.lyrics-card {
  gap: 16px;
}
.lyrics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lyrics-head-text {
  display: grid;
  gap: 4px;
}
.lyrics-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lyrics-danger {
  color: var(--bad);
}
.btn-danger {
  background: var(--bad);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
}
.lyrics-empty {
  display: grid;
  justify-items: start;
  gap: 12px;
}
.lyrics-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
}
.lyrics-note .icon,
.lyrics-status .spinner {
  flex: none;
  margin-top: 2px;
}
.lyrics-textarea {
  height: auto;
  min-height: 260px;
  padding: 14px;
  line-height: 1.7;
  resize: vertical;
  font-size: 15px;
}
.lyrics-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
}
.lyrics-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  animation: pop-in var(--t-mid) var(--ease) backwards;
}
.lyrics-confirm.is-danger {
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  background: var(--bad-soft);
}
.lyrics-confirm.is-danger > .icon {
  color: var(--bad);
}
.lyrics-confirm p {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
}
.lyrics-confirm-actions {
  display: flex;
  gap: 6px;
}
.lyrics-list {
  display: grid;
  gap: 2px;
  max-height: min(520px, 62vh);
  overflow-y: auto;
  padding: 4px;
  margin: 0 -4px;
  scrollbar-width: thin;
}
.lyric-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  transition: background var(--t-fast);
}
.lyric-line:hover {
  background: var(--surface-2);
}
.lyric-line[aria-disabled="true"] {
  cursor: default;
}
.lyric-row.is-current .lyric-line {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-1);
}
.lyric-time {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.lyric-texts {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.lyric-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.lyric-pron {
  font-size: 13px;
  color: var(--accent-ink);
}
.le-list {
  display: grid;
  gap: 10px;
}
.le-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 200px auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.le-num {
  padding-top: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.le-fields {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.le-text {
  height: 42px;
  font-weight: 600;
}
.le-pron-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.le-pron {
  height: 38px;
  font-size: 14px;
  color: var(--accent-ink);
  flex: 1;
  min-width: 0;
}
.le-time {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}
.le-time-val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.le-time-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.le-nudge {
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.le-nudge:hover:not(:disabled) {
  background: var(--surface-3);
}
.le-nudge:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.le-row-actions {
  display: flex;
  gap: 2px;
  padding-top: 2px;
}
.le-del:hover {
  color: var(--bad);
}
.lyrics-savebar {
  position: sticky;
  bottom: calc(var(--bottom-bars) + 12px);
  z-index: 2;
  padding: 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.sync {
  display: grid;
  gap: 16px;
}
.sync-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.sync-stage {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sync-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sync-label {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-ink);
}
.sync-line {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.sync-pron {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-ink);
}
.sync-after {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-3);
}
.sync-now {
  display: grid;
  place-items: center;
  align-content: center;
  width: 132px;
  height: 132px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), filter var(--t-fast);
  touch-action: manipulation;
}
.sync-now:active:not(:disabled) {
  transform: scale(0.95);
}
.sync-now:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sync-now.is-tapped {
  animation: tap-pop 260ms var(--ease);
}
@keyframes tap-pop {
  40% {
    transform: scale(0.92);
    filter: brightness(1.2);
  }
}
.sync-now-big {
  font-size: 26px;
  font-weight: 700;
}
.sync-now-sub {
  font-size: 12px;
  font-weight: 650;
  opacity: 0.7;
}
.sync-hint {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--text-3);
}
.sync-list {
  display: grid;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
  margin: 0 -4px;
}
.sync-row-btn {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  color: var(--text-2);
  font-size: 14px;
}
.sync-row-btn:hover {
  background: var(--surface-2);
}
.sync-row.is-next .sync-row-btn {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 650;
}
.sync-row.is-done .sync-row-btn {
  color: var(--text);
}
.sync-row.is-done .icon {
  color: var(--ok);
}
.sync-row-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 연습 무대 가사 띠: 무대(음 막대)와 조작부 사이 */
.lyrics-band {
  grid-area: lyrics;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 10px max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px));
}
.lb-lines {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}
.lb-main {
  max-width: 100%;
  min-height: 36px;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-main.is-enter {
  animation: lyric-in 320ms var(--ease);
}
@keyframes lyric-in {
  from {
    opacity: 0.2;
    transform: translateY(6px);
  }
}
.lb-pron {
  min-height: 22px;
  max-width: 100%;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-next {
  min-height: 20px;
  max-width: 100%;
  font-size: 14px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lyrics-band.is-upcoming .lb-main,
.lyrics-band.is-upcoming .lb-pron {
  opacity: 0.45;
}
.lyrics-band.no-pron .lb-pron {
  display: none;
}
.lyrics-band.is-collapsed {
  min-height: 0;
  padding-top: 6px;
}
.lyrics-band.is-collapsed .lb-lines {
  display: none;
}
.lb-toggles {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  display: flex;
  gap: 6px;
}
.lb-toggle {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.lb-toggle[aria-pressed="true"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.lb-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============ 움직임 ============ */
@keyframes view-fade {
  from {
    opacity: 0;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes banner-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes indeterminate {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(260%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
/* 즐겨찾기에 넣을 때 하트가 한 번 통통 튄다 */
@keyframes heart-pop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.82);
  }
  65% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}
/* 리모컨 버튼이 한 번 눌렸다 올라온다(아래 그림자가 줄었다 돌아온다) */
@keyframes keypress {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #9a978f, 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  }
}
@keyframes count-pop {
  0% {
    opacity: 0;
    transform: scale(1.4);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .count-num {
    animation: none;
  }
  .skel {
    animation: none;
  }
}

/* ============ 누르는 느낌 · 테마 바꾸기 ============ */
/* 단추류는 누르는 순간 살짝 작아졌다가 돌아온다(화면이 손가락을 따라온다는 느낌). 색은 짧게 바뀐다 */
.icon-btn,
.chip,
.seg-btn,
.t-btn,
.key-btn,
.stage-icon-btn,
.first-note-btn,
.pop-chip,
.lb-toggle,
.account-btn,
.menu-item,
.tab {
  transition-property: background, color, border-color, box-shadow, transform, opacity;
  transition-duration: var(--t-fast);
  transition-timing-function: var(--ease);
}
.icon-btn:active:not(:disabled),
.chip:active,
.seg-btn:active:not(:disabled),
.t-btn:active:not(:disabled),
.key-btn:active:not(:disabled),
.stage-icon-btn:active,
.first-note-btn:active:not(:disabled),
.pop-chip:active:not(:disabled),
.lb-toggle:active:not(:disabled),
.tab:active {
  transform: scale(0.94);
}
.menu-item:active:not(:disabled) {
  transform: scale(0.985);
}
/* 테마를 바꿀 때 화면 전체가 짧게 겹쳐 바뀐다(theme.mjs가 지원하는 브라우저에서만 켠다) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: var(--ease);
}

/* ============ 반응형 ============ */
@media (max-width: 1180px) {
  .rows-head,
  .row {
    grid-template-columns: 52px minmax(150px, 1fr) minmax(220px, 1.4fr) 200px 40px;
    column-gap: 16px;
  }
  .settings {
    gap: 16px;
  }
  .set-note {
    max-width: 170px;
  }
}
@media (max-width: 1040px) {
  .song-grid,
  .me-grid,
  .add-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rows-head {
    display: none;
  }
  .row {
    grid-template-columns: 52px minmax(0, 1fr) auto 40px;
    grid-template-areas:
      "cover main verdict act"
      "range range range range";
    row-gap: 10px;
  }
  .row > .cover {
    grid-area: cover;
  }
  .row-main {
    grid-area: main;
  }
  .row-range {
    grid-area: range;
  }
  .row-verdict {
    grid-area: verdict;
  }
  .row-practice {
    grid-area: act;
  }
}
@media (max-width: 960px) {
  :root {
    --mini-h: 60px;
  }
  .topnav-inner {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    gap: 12px;
  }
  .nav-links {
    display: none;
  }
  .topnav {
    --nav-h: 56px;
  }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    display: flex;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
    background: var(--glass-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    transition: color var(--t-fast);
  }
  .tab[aria-current="page"] {
    color: var(--text);
  }
  .tab[aria-current="page"] .icon {
    color: var(--accent-ink);
  }
  .mini {
    left: 8px;
    right: 8px;
    bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom, 0px));
    height: var(--mini-h);
    padding-bottom: 0;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    overflow: hidden;
  }
  .mini-inner {
    padding: 0 8px 0 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .mini-center {
    order: 2;
    gap: 0;
  }
  .mini-right {
    order: 3;
    display: none;
  }
  .mini-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
  }
  .mini-progress .mini-time {
    display: none;
  }
  .mini-track {
    height: 3px;
  }
  .mini-track-bg {
    height: 3px;
    border-radius: 0;
  }
  .mini-range {
    display: none;
  }
  .mini-play {
    width: 40px;
    height: 40px;
  }
  .mini-vol .vol-btn {
    width: 38px;
    height: 40px;
  }
  .mini-vol {
    margin-left: 2px;
  }
  .page {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 24px 16px;
    gap: 40px;
  }
  .hide-mobile {
    display: none !important;
  }
}
@media (max-width: 640px) {
  .page-title {
    font-size: var(--fs-h2);
  }
  .manual-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .lede {
    font-size: 15px;
  }
  .shelf-navs {
    display: none;
  }
  .callout {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .shelf-row {
    grid-auto-columns: 144px;
    gap: 14px;
  }
  .lib-tools {
    width: 100%;
  }
  .search-wrap {
    flex: 1;
  }
  .input-search {
    width: 100%;
  }
  /* 휴대폰 곡 머리: 커버(72px) 옆에 제목·가수·길이, 그 아래 노래방 키와 단추 한 줄. 리모컨 판이 첫 화면에 들어온다 */
  .song-hero {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    row-gap: 14px;
  }
  .song-hero .cover-lg {
    width: 72px;
    border-radius: var(--r-sm);
  }
  .song-hero:not(.is-editing) .hero-body {
    display: contents;
  }
  .song-hero.is-editing .hero-body {
    grid-column: 1 / -1;
  }
  .hero-id {
    gap: 2px;
  }
  .hero-title {
    font-size: var(--fs-h2);
    line-height: 1.25;
  }
  .hero-artist {
    font-size: 14px;
  }
  .hero-meta {
    gap: 2px 12px;
    font-size: 13px;
  }
  .hero-body > .keyread,
  .hero-actions {
    grid-column: 1 / -1;
  }
  .hero-actions {
    margin-top: 0;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
    padding: 0 16px;
  }
  .hero-actions .info-open {
    flex: 0 0 52px;
    padding: 0;
  }
  .info-open-label {
    display: none;
  }
  .guide-headline {
    font-size: 19px;
  }
  .remote-panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }
  .range-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .cmp-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .mchart-main {
    height: 320px;
  }
  .melody-foot .seg {
    width: 100%;
  }
  .melody-foot .seg-btn {
    flex: 1;
    justify-content: center;
    padding: 0 6px;
  }
  .skel-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .live-note {
    font-size: 84px;
  }
  .live-display {
    min-height: 128px;
  }
  .studio {
    padding: 18px;
    border-radius: var(--r-lg);
  }
  .trace-plot {
    min-height: 220px;
  }
  .result {
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
  }
  .res-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .add-input-row {
    flex-wrap: wrap;
  }
  .add-input-row .btn {
    width: 100%;
  }
  .preview {
    grid-template-columns: minmax(0, 1fr);
  }
  .job {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .le-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "num fields acts"
      "num time time";
  }
  .le-num {
    grid-area: num;
  }
  .le-fields {
    grid-area: fields;
  }
  .le-time {
    grid-area: time;
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .le-row-actions {
    grid-area: acts;
    flex-direction: column;
  }
  .le-pron-row {
    flex-wrap: wrap;
  }
  .sync-main {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 16px;
  }
  .sync-stage {
    justify-items: center;
  }
  .sync-line {
    font-size: 22px;
  }
  .sync-now {
    width: 100%;
    height: 76px;
    border-radius: 20px;
  }
  .lyric-line {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 8px;
  }

  .job-side {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    align-items: center;
    justify-content: start;
    gap: 10px;
  }
}

/* 연습 무대: 좁은 화면 */
@media (max-width: 760px) {
  .show-mobile {
    display: flex !important;
  }
  .stage-top {
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 6px max(14px, env(safe-area-inset-left, 0px));
  }
  .stage-back {
    padding: 0 10px 0 6px;
  }
  .hud {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "voice score"
      "target target";
    gap: 8px 12px;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  }
  .hud-voice {
    grid-area: voice;
    justify-items: start;
    text-align: left;
    min-width: 0;
  }
  .hud-score {
    grid-area: score;
    align-self: start;
    gap: 6px;
  }
  .hud-target {
    grid-area: target;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  .hud-target .meter {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2px 0 14px;
  }
  .hud-target-name {
    font-size: 18px;
  }
  .hud-note {
    font-size: 54px;
  }
  .score-box {
    min-width: 72px;
    padding: 8px 12px;
  }
  .score-num {
    font-size: 24px;
  }
  .score-word {
    display: none;
  }
  .stage-root.phase-ready .hud-voice,
  .stage-root.phase-ready .hud-score,
  .stage-root.phase-ready .hud-direction,
  .stage-root.phase-ready .meter,
  .stage-root.phase-loading .hud-voice,
  .stage-root.phase-loading .hud-score,
  .stage-root.phase-loading .hud-direction,
  .stage-root.phase-loading .meter {
    display: none;
  }
  .stage-canvas-wrap {
    margin: 0 max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
    border-radius: 14px;
  }
  .lyrics-band {
    grid-template-columns: minmax(0, 1fr);
    min-height: 74px;
    padding: 8px max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  }
  .lb-lines {
    grid-column: 1;
  }
  .lb-main {
    min-height: 27px;
    font-size: 20px;
  }
  .lb-pron {
    min-height: 18px;
    font-size: 13.5px;
  }
  .lb-next {
    min-height: 17px;
    font-size: 12.5px;
  }
  .lb-toggles {
    position: absolute;
    top: -34px;
    right: max(18px, env(safe-area-inset-right, 0px));
    z-index: 2;
  }
  .lb-toggle {
    height: 26px;
    padding: 0 9px;
    font-size: 11.5px;
    background: rgba(10, 13, 17, 0.75);
  }
  .lyrics-band.is-collapsed {
    min-height: 0;
    padding-top: 0;
  }

  .overlay-card {
    padding: 20px;
    gap: 14px;
    border-radius: 18px;
  }
  .overlay-title {
    font-size: 20px;
  }
  .ready-list {
    padding: 14px;
    gap: 10px;
  }
  .ready-list li {
    font-size: 13.5px;
  }
  .overlay-foot {
    display: none;
  }
  .overlay-actions .btn {
    flex: 1;
  }
  .dock {
    padding: 10px max(14px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
    gap: 6px;
  }
  .dock-main {
    justify-content: center;
  }
  .play-main {
    width: 58px;
    height: 58px;
  }
  .settings {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 18px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 18px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    border-radius: 20px 20px 0 0;
    background: #141920;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform var(--t-slow) var(--ease), visibility var(--t-slow);
  }
  .stage-root.is-sheet-open .settings {
    transform: none;
    visibility: visible;
  }
  .sheet-head {
    display: flex !important;
  }
  .set-note {
    max-width: none;
  }
  .settings .pop-chip {
    display: none;
  }
  .settings .pop-panel {
    position: static;
    display: grid;
    width: auto;
    max-width: none;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    animation: none;
  }
  .settings .voice-warn {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 6px;
    box-shadow: none;
  }
  .settings .pop-group {
    justify-items: stretch;
  }
  .set-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-3);
  }
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-mid);
  }
  .stage-root.is-sheet-open .sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (max-width: 760px) and (max-height: 700px) {
  .hud-note {
    font-size: 44px;
  }
}

/* ============ 계정·권한(로그인, 계정 메뉴, 잠금, 올리기, 관리자) ============ */
/* 로그인·가입·처음 설정: 위쪽 줄은 앱과 같은 자리에 두고(로고가 뛰지 않게) 메뉴 링크·계정만 숨긴다 */
body[data-route="auth"] .nav-links,
body[data-route="auth"] .account-slot,
body[data-route="auth"] .mini,
body[data-route="auth"] .tabbar,
body[data-route="offline"] .mini,
body[data-tier="free"] .mini,
body[data-tier="guest"] .mini {
  display: none !important;
}
.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50vh;
  color: var(--text-3);
  font-size: 14px;
}

/* 로그인 · 가입 · 처음 설정: 큰 서비스 로그인의 문법 — 위쪽 줄(로고)은 앱과 같은 자리, 그 아래 가운데 한 줄(칸 폭 400px)에
   제목 · 칸 · 단추. 제목·링크도 칸과 같은 왼쪽 선. 소개 패널·그림·저절로 움직이는 것은 두지 않는다
   (설명이 필요한 그림은 처음 온 사람에게 '저게 뭐야'가 된다). 이 사이트다움은 밤 연습실 색과 위쪽 줄 로고에서만.
   위에서부터 맞춘다: 가입 칸·오류·'내용 보기'가 열려도 위쪽(제목·칸)은 그대로이고 아래만 늘어난다 */
.signin {
  display: grid;
  align-content: start;
  width: min(448px, 100%);
  margin: 0 auto;
  padding: clamp(40px, 9vh, 88px) 24px 56px;
}
.auth-main {
  display: grid;
  gap: 32px;
  min-width: 0;
}
.signin-head {
  display: grid;
  gap: 8px;
}
.signin-title {
  font-size: var(--fs-h1);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
  outline: none;
}
.signin-lede {
  color: var(--text-2);
  font-size: var(--fs-body);
  text-wrap: pretty;
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-form .field-label {
  font-size: 14px;
}
/* 칸 아래 줄(안내 또는 오류)은 늘 한 줄 높이를 잡아 둔다: 오류가 나와도 아래 칸이 밀리지 않는다 */
.auth-form .field-msg {
  min-height: 1.5em;
  line-height: 1.5;
}
.auth-submit {
  width: 100%;
}
/* 누른 뒤 기다리는 동안: 글과 작은 스피너(단추 크기는 그대로) */
.auth-submit.is-busy:disabled {
  opacity: 0.72;
  cursor: progress;
}
.auth-submit .spinner {
  width: 16px;
  height: 16px;
}
.signin-links {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: -12px;
}
.auth-switch {
  color: var(--text-2);
  font-size: 14px;
}
.auth-switch a {
  margin-left: 4px;
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.signin-help {
  color: var(--text-3);
  font-size: 13px;
}
/* 단추 묶음: 오류 한 줄 + 단추. 양식의 칸 사이 간격 밖에 있어서 오류가 닫혀 있으면 빈틈이 없다 */
.form-actions {
  display: grid;
  margin-top: 8px;
}
/* 양식 오류 한 줄(ui.formError): 상자 없이 빨간 글. 단추 바로 위에서 높이가 열리고 닫힌다(위의 칸은 그대로, 단추만 내려감) */
.form-error-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--t-mid) var(--ease-out), opacity var(--t-mid) var(--ease-out);
}
.form-error-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.form-error-clip {
  min-height: 0;
  overflow: hidden;
}
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 12px;
  color: var(--bad);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.form-error .icon {
  flex: none;
  margin-top: 2px;
}
/* 비밀번호 칸 안의 눈 단추와 Caps Lock 표시(칸 안이라 아무것도 밀리지 않는다) */
.pw-field {
  position: relative;
}
.pw-field .input {
  padding-right: 52px;
}
.pw-field.has-caps .input {
  padding-right: 156px;
}
.pw-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.pw-toggle:hover {
  color: var(--text);
  background: var(--surface-3);
}
.pw-toggle[aria-pressed="true"] {
  color: var(--accent-ink);
}
.pw-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.pw-caps {
  position: absolute;
  top: 50%;
  right: 52px;
  translate: 0 -50%;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.pw-caps:empty {
  display: none;
}
.input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}
/* 브라우저가 저장한 아이디·비밀번호를 채우면 크롬이 칸을 파랗게 칠한다: 칸 색 그대로(불투명한 같은 색으로 덮음) */
.input:-webkit-autofill,
.input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: inset 0 0 0 40px var(--input-fill);
}
.input:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 40px var(--input-fill), 0 0 0 4px var(--accent-soft);
}
@media (max-width: 640px) {
  .signin {
    padding: 28px 16px 40px;
  }
}

/* 계정 메뉴 (위쪽 오른쪽 · 휴대폰은 아래 시트) */
.account-slot {
  display: flex;
}
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.account-btn:hover,
.account-btn[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--line-2);
}
.account-name {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chev {
  color: var(--text-3);
  transition: transform var(--t-fast);
}
.account-btn[aria-expanded="true"] .account-chev {
  transform: rotate(180deg);
}
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 12.5px;
}
.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.account-menu {
  position: fixed;
  z-index: 70;
  display: grid;
  gap: 2px;
  width: 280px;
  padding: 8px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--solid-1);
  box-shadow: var(--shadow-2);
  animation: pop-in var(--t-mid) var(--ease) backwards;
}
.menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.menu-who {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 0;
}
.menu-who strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15.5px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.menu-item .icon {
  color: var(--text-3);
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--surface-2);
}
.menu-item.is-danger,
.menu-item.is-danger .icon {
  color: var(--bad);
}
.account-backdrop {
  display: none;
}

/* 대화 상자(비밀번호 바꾸기) */
.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--solid-1);
  color: var(--text);
  box-shadow: var(--shadow-2);
}
.dialog::backdrop {
  background: rgba(5, 6, 10, 0.6);
  backdrop-filter: blur(4px);
}
.dialog[open] {
  animation: pop-in var(--t-mid) var(--ease-out);
}
.dialog[open]::backdrop {
  animation: fade-in var(--t-mid) var(--ease);
}
.dialog-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}
.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dialog-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.dialog-title {
  font-size: 19px;
  font-weight: 750;
}
.dialog-note {
  display: flex;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}
.dialog-note .icon {
  flex: none;
  margin-top: 2px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* 요금제 배지 */
.plan-pill.plan-free {
  color: var(--text-2);
  background: var(--surface-2);
}
.plan-pill.plan-premium {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.plan-pill.plan-admin {
  color: var(--info);
  background: var(--info-soft);
}

/* 프리미엄 잠금 · 소개: 아이콘 타일 격자 대신 제목 + 이름-값 목록(가는 줄로 나눔). 잠금 화면은 제목 + 한 문장 + 단추 */
.lock-head {
  gap: 12px;
}
.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.premium-intro {
  max-width: 760px;
}
.premium-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.premium-item {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 4px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.premium-item dt {
  font-weight: 700;
}
.premium-item dd {
  color: var(--text-2);
}
.premium-note {
  color: var(--text-2);
  font-size: 14px;
}

/* 무료 홈: 첫머리 '내 음역' 건반(프리미엄 홈과 같은 모양) 아래 발성 연습 */
.free-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 내 음역 '재는 방법' 카드 아래: 피아노 음역 테스트로 가는 다른 방법 */
.how-alt {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 14px;
}
.how-alt strong {
  color: var(--text);
}

/* 노래 파일 올리기 */
.add-side {
  display: grid;
  gap: 24px;
  align-content: start;
  min-width: 0;
}
.source-switch {
  display: flex;
}
.upload-card {
  gap: 16px;
}
.drop {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 20px;
  border-radius: var(--r-lg);
  border: 2px dashed var(--line-2);
  background: var(--surface-2);
  text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.drop.is-over {
  border-color: var(--accent-1);
  background: var(--accent-soft);
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.drop-title {
  font-weight: 650;
}
.drop-hint {
  color: var(--text-3);
  font-size: 13px;
}
.own-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--info-soft);
  color: var(--text);
  font-size: 14px;
}
.own-notice .icon {
  flex: none;
  margin-top: 1px;
  color: var(--info);
}
.file-form,
.upload-progress {
  display: grid;
  gap: 16px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.file-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: oklch(var(--cover-l) var(--cover-c) var(--hue, 220));
  color: oklch(var(--glyph-l) var(--glyph-c) var(--hue, 220));
}
.file-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.file-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.file-meta,
.upload-status {
  color: var(--text-2);
  font-size: 13.5px;
}
.upload-problem:empty {
  display: none;
}
.usage-meter {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.usage-meter-lg {
  height: 12px;
}
.usage-meter-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent-1);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 160ms linear;
}
.usage-meter.is-full .usage-meter-fill {
  background: var(--warn);
}
.usage-list {
  display: grid;
  gap: 14px;
}
.usage-row {
  display: grid;
  gap: 8px;
}
.usage-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.usage-label {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
.usage-value {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.usage-limit {
  color: var(--text-3);
  font-weight: 600;
}

/* 관리자 */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.table-wrap {
  overflow-x: auto;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.users-table th {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.users-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.users-table tbody tr:last-child td {
  border-bottom: 0;
}
.users-table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.muted-cell {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}
.user-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.user-name {
  font-weight: 700;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.user-row.is-disabled .user-name {
  color: var(--text-3);
  text-decoration: line-through;
}
.user-row.is-pending td {
  background: var(--accent-soft);
}
.confirm-row td {
  padding-top: 0;
}
.confirm-effect {
  color: var(--text-2);
  font-size: 13.5px;
}
.select-sm {
  height: 38px;
  padding-left: 12px;
  border-radius: 12px;
  font-size: 14px;
}
.btn-danger {
  background: var(--bad);
  /* 어두운 테마의 --bad는 밝은 빨강이라 흰 글자가 안 읽힌다: 테마마다 맞는 글자색(어두움: 거의 검정, 밝음: 흰색) */
  color: var(--on-accent);
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.06);
}
.btn-danger-text,
.btn-danger-text .icon {
  color: var(--bad);
}
/* 곡 화면 맨 아래 '관리'(곡 지우기) */
.manage-card {
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.manage-text {
  display: grid;
  flex: 1 1 280px;
  gap: 4px;
  min-width: 0;
}
.invite-card {
  gap: 16px;
}
.code-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--accent-1) 40%, transparent);
  background: var(--accent-soft);
  animation: pop-in var(--t-mid) var(--ease) backwards;
}
.code-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.code-row {
  display: flex;
  gap: 8px;
}
.code-value {
  height: 52px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.code-meta {
  color: var(--text-2);
  font-size: 13.5px;
}
.code-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--warn);
  font-size: 13.5px;
  font-weight: 600;
}
.code-warn .icon {
  flex: none;
  margin-top: 2px;
}
.code-hint {
  color: var(--text-3);
  font-size: 13px;
}
.invite-list {
  display: grid;
  gap: 10px;
}
.invite-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.invite-item.is-expired {
  opacity: 0.7;
}
.invite-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.invite-meta {
  color: var(--text-3);
  font-size: 13px;
}
@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

@media (max-width: 1040px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .account-btn {
    width: 40px;
    padding: 0;
    border: 0;
    justify-content: center;
  }
  .account-name,
  .account-chev {
    display: none;
  }
  .account-menu {
    left: 0;
    right: 0 !important;
    top: auto !important;
    bottom: 0;
    width: auto;
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    border-radius: 20px 20px 0 0;
    animation: sheet-up var(--t-mid) var(--ease-out) backwards;
  }
  .account-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(0, 0, 0, 0.5);
  }
  .drop {
    padding: 28px 16px;
  }
  .code-row {
    flex-direction: column;
  }
  /* 사용자 표 → 카드 */
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }
  .users-table thead {
    display: none;
  }
  .users-table tr.user-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .users-table td {
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .users-table td:first-child {
    grid-column: 1 / -1;
  }
  .users-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 700;
  }
  .users-table td:first-child::before {
    display: none;
  }
  .user-row.is-pending td {
    background: transparent;
  }
  .users-table .select-wrap,
  .users-table .select {
    width: 100%;
  }
  .confirm-row td {
    padding: 0 0 16px;
  }
}
@media (max-width: 760px) {
  /* 옥타브를 두 옥타브까지 펼치면 단추가 다섯 개: 휴대폰 설정 시트 한 줄에 들어가게 좁힌다 */
  .set-octave .seg-btn {
    padding: 0 8px;
    font-size: 13px;
  }
}
@media (max-width: 640px) {
  .premium-item {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ 음악 앱처럼 듣기: 줄·카드를 누르면 재생, '⋯' 메뉴, 이전·다음 곡 ============ */
/* 오른쪽 단추 칸(하트·마이크·⋯)을 머리와 줄이 같은 폭으로 써야 음역 눈금이 막대와 맞는다 */
.rows-head,
.row {
  grid-template-columns: 52px minmax(160px, 1.05fr) minmax(280px, 1.7fr) 236px 128px;
}
@media (max-width: 1180px) {
  .rows-head,
  .row {
    grid-template-columns: 52px minmax(150px, 1fr) minmax(220px, 1.4fr) 200px 128px;
  }
}
/* 위쪽 메뉴에 '보관함'이 늘어서: 글자가 두 줄로 접히지 않게, 좁으면 음역 표시를 먼저 뺀다(‘내 음역’ 메뉴가 있다) */
.nav-link {
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .topnav-inner {
    gap: 16px;
  }
  .nav-link {
    gap: 6px;
    padding: 0 10px;
  }
}
/* 메뉴가 7개('노래방 번호'까지): 1100px보다 좁으면 로고 글자와 계정 이름을 접어 메뉴 글자를 지킨다(960px 아래는 아래 탭) */
@media (max-width: 1100px) and (min-width: 961px) {
  /* 사이트 이름은 메뉴 링크가 있는 화면에서만 접는다: 로그인 전 화면(메뉴 없음)과 불러오는 동안은 이름이 보여야
     처음 온 사람이 사이트 이름을 본다(로그인 화면에는 안내 문장도 없다) */
  body[data-route]:not([data-route="auth"], [data-route="offline"]) .brand-name,
  .account-name,
  .account-chev {
    display: none;
  }
  .account-btn {
    width: 40px;
    padding: 0;
    border: 0;
    justify-content: center;
  }
}
.row-title.play-target,
.shelf-title .play-target {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.row.is-current .row-title,
.shelf-card.is-current .shelf-title {
  color: var(--accent-ink);
}
.row-cover {
  position: relative;
  width: 52px;
}
.shelf-cover .cover-state {
  border-radius: var(--r-md);
}
.cover-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(8, 9, 14, 0.5);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
.cs-bars {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}
.cs-bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: eq 900ms ease-in-out infinite;
}
.cs-bars i:nth-child(2) {
  animation-delay: -300ms;
}
.cs-bars i:nth-child(3) {
  animation-delay: -600ms;
}
.row:hover .cover-state,
.row.is-current .cover-state,
.shelf-card:hover .shelf-cover .cover-state,
.shelf-card.is-current .shelf-cover .cover-state {
  opacity: 1;
}
.row.is-playing .cs-play,
.shelf-card.is-playing .cs-play {
  display: none;
}
.row.is-playing .cs-bars,
.shelf-card.is-playing .cs-bars {
  display: flex;
}
.row-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
}
.song-more {
  position: relative;
  z-index: 2;
  color: var(--text-3);
}
.row:hover .song-more,
.song-more[aria-expanded="true"] {
  color: var(--text);
}
.shelf-pills .song-more {
  width: 32px;
  height: 32px;
  margin-left: auto;
}
.shelf-pills {
  align-items: center;
}

/* '⋯' 메뉴(body에 붙는 작은 목록) */
.menu-pop {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  max-height: min(420px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--solid-1);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  animation: pop-in 160ms var(--ease) backwards;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover:not(:disabled),
.menu-item:focus-visible {
  background: var(--surface-2);
}
/* 키보드 포커스는 바탕에 더해 테두리(밝은 테마에서는 바탕 차이만으로는 거의 안 보인다) */
.menu-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.menu-item:disabled {
  opacity: 0.5;
  cursor: default;
}
.menu-item .icon {
  flex: none;
  color: var(--text-2);
}
.menu-item.is-danger,
.menu-item.is-danger .icon {
  color: var(--bad);
}
.menu-icon-gap {
  flex: none;
  width: 18px;
}
.menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-item .menu-check {
  color: var(--accent-ink);
}
.menu-sep {
  height: 1px;
  margin: 6px 8px;
  background: var(--line-2);
}
.menu-heading {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}

/* 미니 플레이어 이전·다음 곡 */
.mini-skip {
  flex: none;
  width: 34px;
  height: 34px;
  margin: 0 -10px;
  color: var(--text-2);
}
.mini-skip:disabled {
  opacity: 0.35;
}

@media (max-width: 1040px) {
  .row {
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
  }
  .row > .row-cover {
    grid-area: cover;
  }
  .row-actions {
    grid-area: act;
  }
}
/* 휴대폰 노래 줄(약 76px, 한 화면에 8곡 넘게): 커버 · 제목/가수 · 노래방 키(긴 안내는 줄을 바꿔 다 보인다) · 연습 · ⋯.
   음역 막대(와 그 범례)는 곡 화면에 자세히 있어서 빼고, 즐겨찾기는 ⋯ 메뉴에서 한다(누르는 단추는 44px) */
@media (max-width: 640px) {
  .row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "cover main act"
      "cover verdict act";
    column-gap: 12px;
    row-gap: 3px;
    padding: 8px 2px 8px 8px;
  }
  .row > .row-cover {
    grid-area: cover;
    width: 48px;
    align-self: center;
  }
  .row .cover-sm {
    width: 48px;
  }
  .row-main {
    grid-area: main;
    align-self: end;
  }
  .row-title,
  .row-title.play-target {
    font-size: 15px;
    line-height: 1.35;
  }
  .row-sub {
    line-height: 1.35;
  }
  .row-verdict {
    grid-area: verdict;
    align-self: start;
    display: flex;
    line-height: 1.35;
  }
  .row-verdict .keyread {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .row-verdict .keyread-text {
    white-space: normal;
    overflow: visible;
  }
  .row-verdict .kcap {
    height: 22px;
    font-size: 12px;
  }
  .row-range,
  .legend-rows {
    display: none;
  }
  .row-actions {
    grid-area: act;
    gap: 0;
  }
  .row-actions .fav-btn {
    display: none;
  }
  .row-actions .icon-btn {
    width: 44px;
    height: 44px;
  }
  .mini-skip {
    display: none;
  }
}

/* ============ 즐겨찾기·보관함·재생목록 ============ */
.fav-btn {
  color: var(--text-3);
}
.row:hover .fav-btn {
  color: var(--text-2);
}
.fav-btn.is-on,
.fav-btn.is-on:hover {
  color: var(--heart);
}
.fav-btn .icon {
  transition: transform var(--t-fast) var(--ease);
}
.fav-btn.is-popping .icon {
  animation: heart-pop 360ms var(--ease-out);
}
.fav-btn:active .icon {
  transform: scale(0.86);
}

/* 재생목록 화면 곡 줄: 번호 · 커버 · 곡 · 판정 · 단추 */
.row.row-simple {
  grid-template-columns: 28px 52px minmax(0, 1fr) auto auto;
}
.row-num {
  color: var(--text-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.row-simple.is-current .row-num {
  color: var(--accent-ink);
}

/* 보관함 타일 */
/* 타일은 안쪽 여백(12px)만큼 바깥으로 내밀어, 타일 안 그림·글이 화면 제목과 같은 왼쪽 선에서 시작한다(마우스를 올린 바탕만 밖으로) */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px;
  margin: 8px -12px 24px;
  padding: 0;
  list-style: none;
}
.lib-help {
  margin-top: -32px;
  color: var(--text-2);
}
.lib-help a {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lib-tile {
  position: relative;
  padding: 12px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.lib-tile:hover {
  background: var(--surface);
}
.lib-tile:has(.stretch:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.lib-art-wrap {
  position: relative;
  margin-bottom: 10px;
}
.lib-art,
.pl-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
}
.lib-art .cover,
.pl-art .cover {
  width: 100%;
}
.lib-art-fav {
  background: var(--surface-2);
  color: var(--heart);
}
.lib-art-empty {
  background: var(--surface-2);
  color: var(--text-3);
}
.lib-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-1);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t-mid), transform var(--t-mid) var(--ease);
}
.lib-tile:hover .lib-play,
.lib-play:focus-visible {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .lib-play {
    opacity: 1;
    transform: none;
  }
}
.lib-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-name a {
  color: inherit;
  text-decoration: none;
}
.lib-sub {
  font-size: 13px;
  color: var(--text-3);
}
.lib-tile-new {
  padding: 12px;
}
.lib-new {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 1;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.lib-new:hover {
  background: var(--surface);
  color: var(--text);
}
.lib-new-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-2);
}
.skel-tile {
  aspect-ratio: 1;
  border-radius: var(--r-md);
}

/* 재생목록 머리 */
.pl-head {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin: 12px 0 28px;
}
.pl-art {
  width: 200px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.pl-head-text {
  min-width: 0;
}
.pl-head-text .page-title {
  overflow-wrap: anywhere;
}
.pl-meta {
  margin: 6px 0 16px;
  font-size: 14px;
  color: var(--text-2);
}
.pl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pl-delete,
.pl-delete .icon {
  color: var(--bad);
}

@media (max-width: 1040px) {
  .row.row-simple {
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    grid-template-areas: "cover main verdict act";
    row-gap: 0;
  }
  .row-simple .row-num {
    display: none;
  }
}
@media (max-width: 640px) {
  .row.row-simple {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "cover main act"
      "cover verdict act";
    row-gap: 4px;
  }
  .row-simple .row-verdict .pill {
    font-size: 12px;
  }
  .pl-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .pl-art {
    width: 160px;
  }
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* ============ 노래방 번호(TJ·금영) ============ */
/* 눈에 띄는 것은 하나: 고른 곡의 '리모컨 판'(곡 상세 '노래방에서'와 같은 어두운 판) 안의 노래방 기계 숫자판.
   목록은 인쇄된 노래방 책처럼 상자 없이 굵은 번호 칸만, 카드는 앨범 사진만(사진 위 단추 없음).
   숫자판(7-세그먼트, karaokeui.ledNumber): 꺼진 막대도 희미하게 보이고, 판을 열 때 왼쪽 자리부터 한 번 켜진다. */
:root {
  --remote-body: #181d24; /* 리모컨 판(테마와 상관없이 어둡다, .remote-panel과 같은 색) */
  --led-window: #0e1318;
  --led-on: #8fdcec;
  --led-off: rgba(143, 220, 236, 0.085);
}
.led {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--led-window);
  line-height: 0;
}
.led svg {
  display: block;
  width: auto;
  height: 17px;
}
.led .on {
  fill: var(--led-on);
}
.led .off {
  fill: var(--led-off);
}
@keyframes led-on {
  from {
    fill: var(--led-off);
  }
}

/* 머리: 제목(메뉴 이름) + 받은 곡 수 */
.kara-caption {
  min-height: 1.5em;
  color: var(--text-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.kara-body {
  display: grid;
  gap: 36px;
}

/* 찾기 칸 + 애창곡, 그 아래 나라 */
.kara-search {
  display: grid;
  gap: 14px;
}
.kara-searchrow {
  display: flex;
  gap: 10px;
}
.kara-search-box {
  flex: 1;
  min-width: 0;
}
.kara-search-box > .icon {
  left: 18px;
}
.kara-input {
  height: 56px;
  padding-left: 50px;
  padding-right: 44px;
  border-radius: 16px;
  font-size: 17px;
}
.kara-slash {
  position: absolute;
  right: 16px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font: 600 13px/1 var(--font);
  pointer-events: none;
}
.kara-search-box:focus-within .kara-slash,
.kara-input:not(:placeholder-shown) + .kara-slash {
  display: none;
}
@media (hover: none) {
  .kara-slash {
    display: none;
  }
}
.kara-mine-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.kara-mine-btn .icon {
  color: var(--heart);
}
.kara-mine-btn:hover {
  border-color: var(--line-2);
}
.kara-mine-btn[aria-pressed="true"] {
  border-color: var(--heart);
  background: color-mix(in oklab, var(--heart) 14%, var(--surface-2));
}
.kara-mine-count {
  min-width: 1ch;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 결과 머리: 무엇을 보는지 + 곡 수(왼쪽), 노래방·찾는 곳·정렬(오른쪽 작은 고르기 칸) */
.kara-results {
  display: grid;
  gap: 14px;
}
.kara-results[aria-busy="true"] :is(.kara-list, .kara-cards) {
  opacity: 0.55;
  transition: opacity var(--t-fast);
}
.kara-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-height: 40px;
}
.kara-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--fs-h3);
  font-weight: 700;
}
.kara-count {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.kara-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kara-select .input {
  height: 38px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  font-size: 13.5px;
}
.kara-select > .icon {
  right: 11px;
}
.kara-more {
  justify-self: center;
}
.kara-loading {
  padding: 16px;
  color: var(--text-3);
}

/* 번호(목록): 인쇄된 노래방 책의 번호 칸처럼 굵은 숫자, 상자 없이. 맞은 번호는 강조색 */
.kara-num {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.kara-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}
.kara-no {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.kara-no.is-hit {
  color: var(--accent-ink);
}

/* 찾은 곡·애창곡 줄(노래 목록 줄과 같은 모양: 선 없이, 마우스를 올리면 옅게) */
.kara-list {
  display: grid;
  gap: 4px;
}
.kara-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 20px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.kara-row:hover,
.kara-row.is-open {
  background: var(--surface-2);
}
.kara-row:has(.kara-main:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 0;
}
.kara-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kara-main:focus-visible {
  outline: none; /* 줄 전체에 테두리(위) */
}
.kara-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.kara-title {
  font-size: 15.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.kara-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  font-size: 13.5px;
  color: var(--text-2);
}
.kara-date {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.kara-key:empty {
  display: none;
}
.kara-row.is-missing .kara-title {
  color: var(--text-3);
}
.kara-row > .kara-nums {
  display: grid;
  grid-template-columns: 96px 108px;
  align-items: baseline;
  gap: 4px 12px;
  transition: opacity var(--t-fast);
}
/* 열면 작은 번호는 아래 리모컨 판의 큰 숫자판이 된다(두 번 보이지 않게) */
.kara-row.is-open > .kara-nums {
  opacity: 0;
}
/* 줄 끝의 별: 담은 곡이면 늘, 아니면 마우스를 올리거나 키보드로 올 때(터치 화면은 늘) */
.kara-star-quick {
  opacity: 0;
  transition: opacity var(--t-fast);
}
.kara-row:hover .kara-star-quick,
.kara-star-quick:focus-visible,
.kara-star-quick[aria-pressed="true"] {
  opacity: 1;
}
@media (hover: none) {
  .kara-star-quick {
    opacity: 1;
  }
}
.kara-star[aria-pressed="true"] .icon {
  color: var(--heart);
}
.kara-star.is-popping .icon {
  animation: heart-pop 360ms var(--ease-out);
}
/* 줄을 누르면 그 아래로 리모컨 판이 열린다(높이만, 200ms) */
.kara-reveal {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-mid) var(--ease-out);
}
.kara-row.is-open .kara-reveal {
  grid-template-rows: 1fr;
}
.kara-reveal-inner {
  min-height: 0;
  overflow: hidden;
}
.kara-row.is-open .kara-reveal-inner {
  padding: 12px 0 4px;
}
.kara-note {
  padding: 8px 4px 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 리모컨 판(고른 곡): 어두운 판 + 숫자판 번호 + 작사·작곡 + 할 일. 테마와 상관없이 어두워서 안의 글자색은 어두운 테마 값으로 */
.kara-display {
  --text: #ebe8e1;
  --text-2: #b9bdc2;
  --text-3: #8b9097;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --surface-2: rgba(255, 255, 255, 0.08);
  --accent-ink: #9cc7d4;
  --heart: #e3a86b;
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--remote-body);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: auto;
}
.kara-display-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
}
.kara-display-nums .kara-num {
  align-items: center;
  gap: 10px;
}
.kara-display-nums .kara-num:empty {
  display: none;
}
.kara-display-nums .kara-brand {
  font-size: 14px;
  color: var(--text-3);
}
.kara-display .led {
  padding: 10px 14px;
  border-radius: 12px;
}
.kara-display .led svg {
  height: 46px;
}
/* 판을 열 때 숫자가 왼쪽 자리부터 한 번 켜진다(누른 것에 답하는 움직임, 움직임 줄이기면 꺼짐) */
.kara-display .led .on {
  animation: led-on 150ms var(--ease-out) both;
  animation-delay: calc(60ms + var(--d, 0) * 45ms);
}
.kara-display-credits {
  font-size: 13px;
  color: var(--text-3);
}
.kara-display-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kara-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: background var(--t-fast);
}
.kara-act:hover {
  background: rgba(255, 255, 255, 0.14);
}
.kara-act:disabled {
  opacity: 0.5;
  cursor: default;
}
.kara-own .keyread {
  margin-left: 2px;
}

/* 신곡 카드: 앨범 사진 · 제목 · 가수 · 번호. 누르면 사진 자리가 리모컨 판 */
.kara-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 28px 20px;
}
.kara-card {
  position: relative;
  min-width: 0;
  container-type: inline-size;
}
.kara-card-main {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kara-card-main .cover {
  width: 100%;
  margin-bottom: 9px;
}
.kara-card-main:focus-visible {
  outline: none;
}
.kara-card-main:focus-visible .cover {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.kara-card-title,
.kara-card-singer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kara-card-title {
  font-size: 15px;
  font-weight: 600;
}
.kara-card-singer {
  font-size: 13.5px;
  color: var(--text-2);
}
.kara-card-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 5px;
}
.kara-card-nums .kara-num:empty {
  display: none;
}
.kara-card-nums .kara-no {
  font-size: 15px;
}
.kara-card-display {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-mid) var(--ease-out), visibility 0s linear var(--t-mid);
}
.kara-card.is-open .kara-card-display {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-mid) var(--ease-out);
}
/* 카드 안 리모컨 판: 커버 칸(정사각형) 크기 그대로. 번호는 위, 유튜브·애창곡 아이콘 단추는 아래.
   숫자판 크기는 카드 폭에 맞춘다(cqw). 작사·작곡은 목록 줄의 판에만(카드에서는 넘친다) */
.kara-card-display .kara-display {
  height: 100%;
  align-content: space-between;
  justify-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--r-md);
}
.kara-card-display .kara-display-nums {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.kara-card-display .kara-display .led {
  padding: 5px 8px;
  border-radius: 8px;
}
.kara-card-display .kara-display .led svg {
  height: clamp(22px, 15cqw, 28px);
}
.kara-card-display .kara-display-credits {
  display: none;
}
.kara-card-display .kara-display-nums .kara-brand {
  min-width: 2.2em;
  text-align: right;
  font-size: 12px;
}
.kara-card-display .kara-act {
  width: 38px;
  padding: 0;
  justify-content: center;
}
.kara-card-display .kara-act span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 곡 상세 '노래방에서': 리모컨 판 맨 위 숫자판(누를 번호), 그 아래 누를 키 */
.remote-numbers {
  grid-column: 1 / -1;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.remote-numbers-leds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}
.remote-numbers-leds .kara-num {
  align-items: center;
  gap: 10px;
}
.remote-numbers-leds .kara-num:empty {
  display: none;
}
.remote-numbers-leds .kara-brand {
  font-size: 13px;
  color: #9aa0a6;
}
.remote-numbers .led {
  padding: 8px 12px;
  border-radius: 10px;
}
.remote-numbers .led svg {
  height: 30px;
}
.remote-find {
  margin-bottom: 2px;
}

@media (max-width: 640px) {
  .kara-input,
  .kara-mine-btn {
    height: 52px;
  }
  .kara-mine-btn {
    padding: 0 14px;
  }
  /* 휴대폰: 찾기 칸을 넓게. '애창곡' 글은 화면 낭독기에만(별과 개수는 보인다) */
  .kara-mine-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .kara-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .kara-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 6px 10px 10px;
  }
  .kara-row > .kara-nums {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    padding: 4px 0 0 54px;
  }
  .kara-row .kara-num:empty {
    display: none;
  }
  .kara-row.is-open > .kara-nums {
    display: none;
  }
  .kara-row > .kara-star-quick {
    grid-column: 2;
    grid-row: 1;
  }
  .kara-display {
    padding: 16px;
  }
  .kara-display .led svg {
    height: 36px;
  }
  .remote-numbers .led svg {
    height: 26px;
  }
}

/* ============ 곡 정보 고치기(곡 머리 자리에서) ============ */
.info-form {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
}
.info-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.info-reset {
  justify-self: start;
  margin-top: -8px;
  font-size: 13.5px;
}
.info-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 사진 고르기 칸은 화면에서 숨기고 '사진 올리기' 단추(label)가 대신 보인다. 키보드로 오면 단추에 초점 테두리 */
.info-cover-actions .sr-only:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.info-link {
  display: flex;
  gap: 8px;
  animation: pop-in var(--t-mid) var(--ease-out);
}
.info-link .input {
  flex: 1;
  min-width: 0;
}
.info-status:empty {
  display: none;
}
.info-status {
  color: var(--accent-ink);
}
.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 고치는 동안 커버 자리에 점선: 여기에 미리 보기가 뜬다 */
.song-hero.is-editing .cover-lg {
  outline: 2px dashed var(--line-2);
  outline-offset: 6px;
}
@media (max-width: 640px) {
  .info-names {
    grid-template-columns: minmax(0, 1fr);
  }
  .info-link {
    flex-wrap: wrap;
  }
  .info-link .btn {
    width: 100%;
  }
}

/* ============ 음표 고치기(곡 상세 멜로디) ============ */
.mchart.is-editing .mchart-canvas {
  cursor: pointer;
}
.mchart-canvas.is-drawing {
  cursor: crosshair;
}
.mchart.is-editing {
  outline: 2px dashed var(--c-note-user);
  outline-offset: 4px;
  border-radius: var(--r-md);
}
.edit-bar {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
}
.edit-bar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.edit-count {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.edit-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.edit-hint .icon {
  flex: none;
  margin-top: 2px;
}
.edited-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--c-note-user) 12%, transparent);
  color: var(--text);
  font-size: 13.5px;
}
.edited-note .icon {
  flex: none;
  color: var(--c-note-user);
}
.edited-note span {
  flex: 1;
  min-width: 220px;
}
.lg-user {
  background: var(--c-note-user);
}
@media (max-width: 640px) {
  .edit-actions {
    margin-left: 0;
  }
}

/* ============ 모든 화면 아래: 이용약관 · 개인정보 처리방침 · 권리 침해 신고 ============ */
/* 고정된 미니 플레이어·아래 탭에 가리지 않게 그 높이만큼 아래를 비운다(.page 대신 여기서). 연습 무대처럼 꽉 찬 화면에서는 숨긴다 */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  max-width: 1248px;
  margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right, 0px)) calc(var(--bottom-bars) + 32px) max(24px, env(safe-area-inset-left, 0px));
  font-size: 13px;
}
.site-foot a {
  color: var(--text-3);
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-foot strong {
  color: var(--text-2);
  font-weight: 700;
}
body[data-route="practice"] .site-foot,
body[data-route="exercise-session"] .site-foot,
body[data-route="range-test"] .site-foot {
  display: none;
}
body[data-route="auth"] .site-foot {
  padding-bottom: 32px;
}

/* ============ 약관 동의 칸(가입, 약관 동의 화면) ============ */
/* 상자 없이 목록(큰 서비스 가입 화면의 동의 칸): '모두 동의해요'(굵게, 줄 전체를 눌러도 됨) + 폭 가득 가는 줄 + 필수 셋(44px 줄).
   '내용 보기'는 같은 줄 오른쪽 글자 단추(그 자리에서 펼침, 새 창 없음). 펼친 내용은 상자 대신 들여쓴 작은 글(왼쪽 가는 줄) */
.consent {
  display: grid;
  min-width: 0;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
}
/* 체크 칸: 둥근 네모, 켜면 청록으로 차고 체크 표시가 짧게 나타난다(누른 것에 답하는 움직임) */
.check-input {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--text-3);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check-input::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--on-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3.1 3.1 6.5-7' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3.1 3.1 6.5-7' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0);
  transition: transform var(--t-fast) var(--ease-out);
}
.check-input:hover {
  border-color: var(--text-2);
}
.check-input:checked,
.check-input:indeterminate {
  border-color: var(--accent-1);
  background: var(--accent-1);
}
.check-input:checked::before {
  transform: scale(1);
}
.check-input:indeterminate::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
  transform: scale(1);
}
.check-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.consent-all {
  min-height: 52px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.consent-all .check-input {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}
.consent-list {
  display: grid;
  padding: 0;
  list-style: none;
}
.consent-item {
  position: relative;
  min-width: 0;
}
.consent-item > .check {
  padding-right: 84px;
}
.consent-req {
  color: var(--text-3);
  font-size: 13px;
}
.consent-more {
  font-size: 13px;
  /* 펼치고 접을 때 높이를 부드럽게(되는 브라우저만, 움직임 줄이기면 끔). 위로 맞춘 화면이라 아래만 밀린다 */
  interpolate-size: allow-keywords;
}
.consent-more::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size var(--t-mid) var(--ease-out), content-visibility var(--t-mid) allow-discrete;
}
.consent-more[open]::details-content {
  block-size: auto;
}
/* '내용 보기': 같은 줄 오른쪽(줄 높이 44px 그대로) */
.consent-more summary {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 0 2px 0 10px;
  border-radius: var(--r-xs);
  color: var(--text-3);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: color var(--t-fast);
}
.consent-more summary:hover,
.consent-more[open] summary {
  color: var(--text);
}
.consent-more summary::-webkit-details-marker {
  display: none;
}
.consent-more summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.consent-more summary .icon {
  transition: transform var(--t-fast) var(--ease);
}
.consent-more[open] summary .icon {
  transform: rotate(180deg);
}
.consent-detail {
  display: grid;
  gap: 6px;
  margin: 0 0 12px 30px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
}
.consent-detail ul {
  display: grid;
  gap: 2px;
  padding-left: 1.1em;
  list-style: disc;
}
.consent-detail dl {
  display: grid;
  gap: 3px;
}
.consent-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 8px;
}
.consent-row dt {
  color: var(--text);
  font-weight: 600;
}
.consent-detail a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* 약관 동의 화면: 다른 화면과 같은 왼쪽 선, 양식 폭만 좁게 */
.consent-form {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 480px;
}
.consent-form .form-actions > .btn {
  justify-self: start;
}
.consent-out {
  max-width: 480px;
  color: var(--text-2);
}

/* ============ 내 계정 ============ */
/* 설정 화면 문법(토스·카카오): 다른 화면과 같은 왼쪽 선(가운데로 모으지 않음), 본문 폭만 720px.
   머리(아바타 · 아이디 · 등급) → 줄 목록(56px, 누르는 줄은 오른쪽 꺾쇠) → 맨 아래 흐린 '회원 탈퇴' */
.account-sheet {
  display: grid;
  gap: 28px;
  max-width: 720px;
}
.account-who {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.avatar-xl {
  width: 56px;
  height: 56px;
  font-size: 22px;
}
.account-who-text {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}
.account-who-name {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.016em;
  line-height: 1.3;
}
.settings-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.settings-list > li {
  border-bottom: 1px solid var(--line);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
button.settings-row {
  cursor: pointer;
  transition: background var(--t-fast);
}
button.settings-row:hover {
  background: var(--surface);
}
button.settings-row:focus-visible {
  outline-offset: -2px;
}
.settings-row .icon {
  color: var(--text-3);
}
.settings-value {
  color: var(--text-2);
  font-weight: 500;
}
.account-leave {
  display: grid;
  justify-items: start;
  gap: 12px;
}
.leave-link {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.leave-link:hover {
  color: var(--text-2);
}
.leave-note {
  color: var(--text-3);
  font-size: 14px;
}
.account-leave .confirm-slot {
  width: 100%;
  max-width: 520px;
}
.withdrawn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* 휴대폰: 펼친 내용은 들여쓰기를 줄여 폭을 쓴다(길어지지 않게) */
@media (max-width: 640px) {
  .consent-detail {
    margin-left: 8px;
  }
  .consent-row {
    gap: 6px;
  }
}

/* ============ 손가락으로 누르는 화면: 누르는 자리 44px 이상 ============ */
/* 휴대폰·태블릿(손가락) 또는 좁은 화면: 작은 단추·칩·고르기·위쪽 아이콘 단추를 44px로(애플·구글 권장 크기).
   높이(height)는 그대로 두고 최소 높이로 늘린다(넓은 화면의 촘촘한 모양은 그대로) */
@media (pointer: coarse), (max-width: 640px) {
  .btn-sm,
  .chip,
  .seg-btn,
  .stage-back,
  .kara-act,
  .select-sm,
  .kara-select .input {
    min-height: 44px;
  }
  .icon-btn,
  .stage-icon-btn,
  .account-btn,
  .kara-card-display .kara-act {
    min-width: 44px;
    min-height: 44px;
  }
}
/* 아이폰 사파리는 16px보다 작은 입력 칸에 포커스가 가면 화면을 확대한다: 손가락 기기에서는 입력 칸·고르기 칸을 16px로 */
@media (pointer: coarse) {
  .input:not(.input-lg, .kara-input),
  .kara-select .input,
  .select-sm {
    font-size: 16px;
  }
}
