/* ───────── 토큰: iOS 시스템 색상 기반 ───────── */
:root {
  --tint: #ff2d55;
  --bg: #ffffff;
  --bg-grouped: #f2f2f7;
  --card: #ffffff;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .18);
  --seg-on: #ffffff;
  --seg-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04);
  --bar: rgba(255, 255, 255, .72);
  --sheet: #f2f2f7;
  --ambient-opacity: .28;
  --art-shadow: 0 18px 40px -12px rgba(0,0,0,.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard Variable", Pretendard,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-jp: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
             "Noto Sans JP", "Yu Gothic UI", "Meiryo", "Pretendard Variable", sans-serif;
  --ko: 28px;
  --jp: 17px;
  --line-gap: 26px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tint: #ff375f;
    --bg: #000000;
    --bg-grouped: #000000;
    --card: #1c1c1e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .36);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .6);
    --seg-on: #636366;
    --seg-shadow: none;
    --bar: rgba(22, 22, 24, .72);
    --sheet: #1c1c1e;
    --ambient-opacity: .45;
    --art-shadow: 0 18px 50px -12px rgba(0,0,0,.8);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .sheet .card { background: #2c2c2e; }
}
:root[data-theme="dark"] {
  --tint: #ff375f;
  --bg: #000000;
  --bg-grouped: #000000;
  --card: #1c1c1e;
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .36);
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, .6);
  --label-3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .6);
  --seg-on: #636366;
  --seg-shadow: none;
  --bar: rgba(22, 22, 24, .72);
  --sheet: #1c1c1e;
  --ambient-opacity: .45;
  --art-shadow: 0 18px 50px -12px rgba(0,0,0,.8);
  color-scheme: dark;
}
:root[data-theme="dark"] .sheet .card { background: #2c2c2e; }

/* ───────── 기본 ───────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
/* 확대·블러된 배경 레이어가 옆으로 넘쳐 가로 스크롤이 생기지 않도록 (clip은 sticky 내비게이션을 깨지 않음) */
html, body { overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 17px; letter-spacing: -.022em; line-height: 1.35;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .3s;
}
button { font: inherit; color: inherit; letter-spacing: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
.text-btn { color: var(--tint); font-size: 17px; }
.text-btn.strong { font-weight: 600; }
.text-btn:active { opacity: .5; }

/* ───────── 내비게이션 바 ───────── */
.navbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  transition: background-color .25s, box-shadow .25s;
}
.navbar.scrolled {
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
}
.nav-inner { max-width: 720px; margin: 0 auto; height: 52px; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-left { justify-self: start; }
.nav-right { justify-self: end; }
.nav-back { display: none; align-items: center; gap: 6px; color: var(--tint); font-size: 17px; padding: 8px 8px 8px 0; }
.nav-back svg { width: 12px; height: 20px; }
.nav-back:active { opacity: .5; }
.nav-title { font-size: 17px; font-weight: 600; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; font-family: var(--font-jp); pointer-events: none; }
/* 스크롤해서 제목이 내비게이션 바로 올라오면 눌러서 맨 위로 */
.navbar.show-title .nav-title { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.nav-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--tint); background: var(--fill); }
.nav-btn .aa { display: flex; align-items: baseline; justify-content: center; gap: .5px; font-family: "Pretendard Variable", Pretendard, var(--font); font-weight: 600; line-height: 1; letter-spacing: 0; }
.nav-btn .aa b { font-weight: inherit; }
.nav-btn .aa b:first-child { font-size: 16px; }
.nav-btn .aa b:last-child { font-size: 12px; }
.nav-btn:active { opacity: .5; }
body.on-lyric .nav-back { display: inline-flex; }

/* ───────── 페이지 ───────── */
.page { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px 40px; flex: 1; position: relative; z-index: 1; }
.large-title { margin: 4px 0 12px; font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }

/* 워드마크 */
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.app-icon { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 1px 3px rgba(0,0,0,.16); }
body.on-lyric .wordmark { display: none; }

/* 최근 본 곡 선반 */
.shelf-section { margin-top: 36px; }
.history-section { margin-top: 28px; }
.chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 7px 14px; border-radius: 999px;
  background: var(--fill); color: var(--label); text-decoration: none; font-size: 15px; line-height: 1.3; }
.chips a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips a small { color: var(--label-2); font-size: 12px; font-weight: 600; flex: none; }
.chips a:active { background: var(--fill-2); }
.shelf { position: relative; }
.shelf-track {
  list-style: none; margin: 0 -20px -10px; padding: 6px 20px 14px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 164px; gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none;
}
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track li { scroll-snap-align: start; min-width: 0; }
.shelf-card { display: block; }
.card-art {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; color: var(--label-3);
  background: var(--fill) center/cover; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35), inset 0 0 0 .5px var(--sep);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
}
.card-art svg { width: 40px; height: 40px; }
@media (hover: hover) { .shelf-card:hover .card-art { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(0,0,0,.4), inset 0 0 0 .5px var(--sep); } }
.shelf-card:active .card-art { transform: scale(.97); }
.card-title { display: block; margin-top: 9px; font-size: 15px; line-height: 1.4; font-weight: 500; font-family: var(--font-jp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { display: block; margin-top: 0; font-size: 13px; line-height: 1.4; color: var(--label-2); font-family: var(--font-jp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-nav {
  position: absolute; top: calc(6px + 82px); transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--label); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 2px 10px rgba(0,0,0,.18), inset 0 0 0 .5px var(--sep);
  opacity: 0; transition: opacity .2s;
}
.shelf-nav svg { width: 10px; height: 16px; }
.shelf-nav.prev { left: -10px; }
.shelf-nav.next { right: -10px; }
@media (hover: hover) { .shelf:hover .shelf-nav { opacity: 1; } }
@media (hover: none) { .shelf-nav { display: none !important; } }

/* 첫 방문 안내 */
.slot-empty { margin: 8px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--fill); font-size: 15px; color: var(--label-2); }
.slot-empty[hidden], .shelf[hidden] { display: none; }

/* 검색 필드 */
/* 검색창 + 범위 선택: 같은 열에 두어 폭·높이·둥글기를 맞춤 (취소 버튼은 옆 열) */
.searchbar { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 0; row-gap: 10px; }
/* 간격은 취소 버튼 쪽 여백으로: 버튼이 숨으면 간격도 사라져 검색창이 전체 폭이 됨 */
.searchbar .cancel { grid-column: 2; grid-row: 1; margin-left: 12px; }
.search-field {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 10px;
  background: var(--fill); border-radius: 12px;
}
.search-field .glass { width: 18px; height: 18px; color: var(--label-2); flex: none; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--label); font: inherit; font-size: 17px; letter-spacing: -.022em; }
.search-field input::placeholder { color: var(--label-2); }
.search-field input::-webkit-search-cancel-button { display: none; }
.clear { width: 20px; height: 20px; color: var(--label-3); flex: none; }
.clear svg { width: 20px; height: 20px; }
.cancel { flex: none; white-space: nowrap; color: var(--tint); font-size: 17px; }

/* 세그먼트 컨트롤 */
.segmented {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 2px; border-radius: 9px; background: var(--fill); position: relative;
}
.segmented button {
  min-width: 64px; height: 28px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--label); white-space: nowrap;
  transition: background-color .2s, box-shadow .2s;
}
.segmented button.on { background: var(--seg-on); box-shadow: var(--seg-shadow); font-weight: 600; }
#modeSeg { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 40px; padding: 3px; border-radius: 12px; }
#modeSeg button { height: 34px; border-radius: 9px; font-size: 14px; }
.segmented.sm button { min-width: 0; padding: 0 10px; }
.segmented.full { width: 100%; }

/* 그룹 리스트 */
.group { margin-top: 32px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.group-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.group-aside { color: var(--label-2); font-size: 15px; }
.group-foot { margin: 10px 0 0; color: var(--label-2); font-size: 13px; }
.group-foot:empty { display: none; }
.more-btn { display: block; width: 100%; height: 48px; margin-top: 10px; border-radius: 12px; background: var(--card);
  color: var(--tint); font-size: 17px; }
.more-btn:active { background: var(--fill); }
.more-btn:disabled { color: var(--label-2); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows a { display: flex; align-items: center; gap: 14px; padding: 8px 0; position: relative; border-radius: 10px; }
.rows li + li a::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: .5px; background: var(--sep); }
.rows a:active { background: var(--fill); }
@media (hover: hover) { .rows a:hover .row-title { color: var(--tint); } }
.thumb {
  width: 48px; height: 48px; flex: none; border-radius: 6px;
  background: var(--fill) center/cover; display: grid; place-items: center; color: var(--label-3);
  box-shadow: inset 0 0 0 .5px var(--sep);
}
.thumb svg { width: 22px; height: 22px; }
.thumb.loaded { animation: thumbIn .35s ease-out; }
@keyframes thumbIn { from { opacity: 0; } }
.row-text { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-jp); transition: color .15s; }
/* 곡명 끝 괄호(타이업·버전 표기)는 작고 흐리게 */
.row-title small { margin-left: 6px; font-size: 13px; color: var(--label-2); }
.src-tag { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--fill); color: var(--label-2);
  font-size: 11px; font-weight: 600; line-height: 17px; vertical-align: 1px; }
.row-sub { display: block; margin-top: 2px; font-size: 15px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-jp); }
.chev { width: 8px; height: 14px; color: var(--label-3); flex: none; }

/* 빈 상태 */
.empty { margin: 16vh auto 0; max-width: 320px; text-align: center; color: var(--label-2); }
.empty h3 { margin: 0 0 6px; color: var(--label); font-size: 22px; font-weight: 700; }
.empty p { margin: 0; font-size: 15px; line-height: 1.45; }
.empty .pill-btn { margin-top: 18px; }

/* 스피너 */
.spinner-wrap { display: grid; place-items: center; padding: 48px 0; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--label-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── 가사 화면 ───────── */
/* 바깥 틀이 잘라내고(overflow: hidden), 확대·블러는 안쪽 ::before 에만 → 가로 스크롤 없음 */
.ambient {
  position: absolute; top: 0; left: 0; right: 0; height: 620px; z-index: 0; pointer-events: none;
  overflow: hidden; opacity: 0; transition: opacity .8s;
  -webkit-mask-image: linear-gradient(#000 20%, transparent 90%); mask-image: linear-gradient(#000 20%, transparent 90%);
}
.ambient::before {
  content: ""; position: absolute; inset: 0;
  background: var(--art, none) center/cover no-repeat;
  filter: blur(90px) saturate(1.6); transform: scale(1.3);
}
body.on-lyric .ambient.ready { opacity: var(--ambient-opacity); }

.album { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 36px; }
.artwork {
  width: min(260px, 64vw); aspect-ratio: 1; border-radius: 12px;
  background: var(--fill) center/cover; box-shadow: var(--art-shadow);
  display: grid; place-items: center; color: var(--label-3);
  transform: scale(.96); opacity: 0; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s;
}
.artwork.ready { transform: none; opacity: 1; }
.artwork svg { width: 64px; height: 64px; }
.album-title { margin: 26px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-family: var(--font-jp); overflow-wrap: anywhere; }
.album-artist { margin: 4px 0 0; font-size: 20px; color: var(--tint); font-family: var(--font-jp); }
/* 가수 이름을 누르면 그 가수로 검색 */
.album-artist a { color: inherit; }
@media (hover: hover) { .album-artist a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.more-names { font-size: inherit; font-family: var(--font); opacity: .7; white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; }
.album-meta { margin: 10px 0 0; font-size: 13px; color: var(--label-2); font-family: var(--font-jp); overflow-wrap: anywhere; }

.lines { padding-top: 4px; }
.lines.size-s { --ko: 22px; --jp: 15px; --line-gap: 22px; }
.lines.size-l { --ko: 36px; --jp: 20px; --line-gap: 32px; }
.line { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--line-gap); cursor: pointer; transition: opacity .3s; }
.lines.order-ko .line { flex-direction: column-reverse; }
.line .ko { margin: 0; font-size: var(--ko); font-weight: 700; line-height: 1.28; letter-spacing: -.025em; word-break: keep-all; overflow-wrap: anywhere; }
.line .jp { margin: 0; font-family: var(--font-jp); font-size: var(--jp); line-height: 1.6; color: var(--label-2); letter-spacing: 0; overflow-wrap: anywhere; }
.line .jp rt { font-size: .55em; color: var(--label-2); opacity: .85; }
.lines.no-ruby rt { display: none; }
.lines.show-ko .jp, .lines.show-jp .ko { display: none; }
.lines.show-jp .jp { font-size: calc(var(--ko) * .85); color: var(--label); font-weight: 600; }
.stanza { height: calc(var(--line-gap) * 1.1); }
.lines.focusing .line:not(.active) { opacity: .25; }
.lines-error { text-align: center; color: var(--label-2); padding: 40px 0; }
.lines-error p { margin: 0 0 16px; }

.credits { margin-top: 48px; }
.rows.plain li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 15px; position: relative; }
.rows.plain li + li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: .5px; background: var(--sep); }
.rows.plain .k { color: var(--label-2); flex: none; }
.rows.plain .v { text-align: right; font-family: var(--font-jp); overflow-wrap: anywhere; }
.rows.plain a { color: var(--tint); }
.rows.plain li.note { display: block; color: var(--label-2); font-size: 13px; line-height: 1.5; word-break: keep-all; }

.footnote { width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); color: var(--label-2); font-size: 12px; text-align: center; position: relative; z-index: 1; }
.footnote a { color: var(--label-2); text-decoration: underline; text-underline-offset: 2px; }

/* ───────── 시트 ───────── */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.28); animation: fade .3s; }
.sheet {
  position: fixed; z-index: 51; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(540px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  animation: rise .42s cubic-bezier(.2,.9,.25,1);
}
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 14px; animation: pop .3s cubic-bezier(.2,.9,.25,1); }
}
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px 6px; }
.sheet-bar h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar .text-btn { justify-self: end; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-label { margin: 18px 16px 6px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0; }
.sheet .card { background: var(--card); border-radius: 10px; overflow: hidden; }
.row-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 16px; position: relative; }
.row-opt + .row-opt::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.row-opt.col { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.row-opt > span { font-size: 17px; }
.row-opt > span small { display: block; font-size: 13px; color: var(--label-2); margin-top: 2px; }
.sheet-note { margin: 10px 16px 0; font-size: 13px; color: var(--label-2); line-height: 1.5; }
/* 한국어 안내 문구: 단어 중간에서 줄바꿈하지 않고, 마지막 줄에 한 단어만 남지 않게 */
.sheet-note, .slot-empty, .empty p, .group-foot, .admin-hint, .form-error, .toast { word-break: keep-all; overflow-wrap: anywhere; text-wrap: pretty; }
.sheet-note code { font-size: 12px; }

/* iOS 스위치 */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background-color .25s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s cubic-bezier(.3,.7,.3,1); }
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--tint); outline-offset: 2px; }

@keyframes rise { from { transform: translate(-50%, 100%); } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.96); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 480px) {
  .page { padding: 0 16px 32px; }
  .nav-inner { padding: 0 12px; }
  .lines { --ko: 24px; --jp: 15px; --line-gap: 22px; }
  .lines.size-s { --ko: 20px; --jp: 14px; }
  .lines.size-l { --ko: 30px; --jp: 18px; }
  .album-title { font-size: 21px; }
  .album-artist { font-size: 18px; }
  .row-opt:not(.col) { flex-wrap: wrap; }
  .shelf-track { margin: 0 -16px -10px; padding: 6px 16px 14px; grid-auto-columns: 140px; gap: 14px; scroll-padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ───────── 가사 화면: 아트워크 스타일 (앨범 커버 전체 배경 + 굵은 흰 글씨) ───────── */
.ambient-shade { display: none; }
body.on-lyric.style-art { background: #2a2a2c; color-scheme: dark; }
body.on-lyric.style-art #lyric,
body.on-lyric.style-art .navbar,
body.on-lyric.style-art .footnote {
  --label: #ffffff;
  --label-2: rgba(255, 255, 255, .62);
  --label-3: rgba(255, 255, 255, .35);
  --sep: rgba(255, 255, 255, .14);
  --fill: rgba(255, 255, 255, .12);
  --tint: #ffffff;
  color: #fff;
}
body.on-lyric.style-art .ambient {
  position: fixed; inset: 0; height: auto; opacity: 0;
  -webkit-mask-image: none; mask-image: none;
}
body.on-lyric.style-art .ambient::before {
  inset: -20%;
  filter: blur(80px) saturate(1.4) brightness(.62); transform: scale(1.2);
}
body.on-lyric.style-art .ambient.ready { opacity: 1; }
body.on-lyric.style-art .ambient-shade {
  display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.35));
}
body.on-lyric.style-art .navbar.scrolled { background: rgba(40, 40, 42, .55); box-shadow: 0 .5px 0 rgba(255,255,255,.14); }
body.on-lyric.style-art .nav-back { color: rgba(255, 255, 255, .8); }
body.on-lyric.style-art .nav-btn { color: #fff; background: rgba(255, 255, 255, .14); }

body.on-lyric.style-art .album { flex-direction: row; align-items: center; text-align: left; gap: 20px; padding: 24px 0 34px; }
body.on-lyric.style-art .artwork { width: 120px; flex: none; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
body.on-lyric.style-art .artwork svg { width: 40px; height: 40px; }
body.on-lyric.style-art .album > :not(.artwork) { margin: 0; }
body.on-lyric.style-art .album { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 20px; align-content: center; }
body.on-lyric.style-art .artwork { grid-row: 1 / span 3; }
body.on-lyric.style-art .album-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; align-self: end; }
body.on-lyric.style-art .album-artist { margin-top: 6px; font-size: 17px; color: rgba(255, 255, 255, .72); }
body.on-lyric.style-art .album-meta { margin-top: 12px; align-self: start; color: rgba(255, 255, 255, .6); }

body.on-lyric.style-art .lines { --ko: 32px; --jp: 19px; --line-gap: 30px; }
body.on-lyric.style-art .lines.size-s { --ko: 24px; --jp: 16px; --line-gap: 24px; }
body.on-lyric.style-art .lines.size-l { --ko: 42px; --jp: 23px; --line-gap: 36px; }
body.on-lyric.style-art .line { gap: 8px; }
body.on-lyric.style-art .line .ko {
  font-family: "Pretendard Variable", Pretendard, var(--font);
  font-weight: 800; line-height: 1.32; letter-spacing: -.02em; color: #fff;
}
body.on-lyric.style-art .line .jp { font-weight: 500; line-height: 1.55; color: rgba(255, 255, 255, .58); }
body.on-lyric.style-art .line .jp rt { color: rgba(255, 255, 255, .5); opacity: 1; }
body.on-lyric.style-art .lines.show-jp .jp { color: #fff; font-weight: 700; }
body.on-lyric.style-art .lines.focusing .line:not(.active) { opacity: .32; filter: blur(.6px); }
@media (hover: hover) { body.on-lyric.style-art .line:hover .ko { text-shadow: 0 0 24px rgba(255, 255, 255, .18); } }

@media (max-width: 480px) {
  body.on-lyric.style-art .artwork { width: 96px; }
  body.on-lyric.style-art .album-title { font-size: 21px; }
  body.on-lyric.style-art .lines { --ko: 27px; --jp: 17px; }
  body.on-lyric.style-art .lines.size-s { --ko: 22px; --jp: 15px; }
  body.on-lyric.style-art .lines.size-l { --ko: 34px; --jp: 20px; }
}

/* ───────── 읽기 수정 제안 ───────── */
.lines.editing ruby[data-s], .lines.editing .tap { cursor: pointer; border-radius: 4px; text-decoration: underline dotted; text-decoration-color: var(--tint); text-underline-offset: 4px; transition: background-color .15s; }
.lines.editing ruby[data-s]:hover, .lines.editing .tap:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.lines.editing .line { cursor: default; }
ruby.fixed rt { color: var(--tint); opacity: 1; }
body.on-lyric.style-art ruby.fixed rt { color: #ffd60a; }

.suggest { padding-top: 12px; text-align: center; }
.sg-word { margin: 6px 0 0; font-family: var(--font-jp); font-size: 34px; font-weight: 700; line-height: 1.6; }
.sg-word rt { font-size: .42em; font-weight: 500; color: var(--label-2); }
.sg-now { margin: 4px 0 18px; font-size: 14px; color: var(--label-2); }
.sg-now b { font-family: var(--font-jp); font-weight: 600; color: var(--label); }
.sg-field { height: 44px; padding: 0 14px; }
.sg-field input { text-align: center; font-family: var(--font-jp); }
.sg-preview { min-height: 20px; margin: 10px 0 0; font-size: 15px; color: var(--label-2); }
.form-error { margin: 8px 0 0; font-size: 13px; color: #ff3b30; }
.text-btn:disabled { opacity: .4; }

/* 토스트 */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: min(440px, calc(100% - 32px)); padding: 11px 18px; border-radius: 22px;
  background: rgba(30, 30, 32, .88); color: #fff; font-size: 15px; font-weight: 500; line-height: 1.4; text-align: center;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toastIn .3s cubic-bezier(.2,.9,.25,1);
  transition: opacity .25s, transform .25s;
}
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* 관리 화면 */
.admin-login { display: grid; gap: 10px; max-width: 360px; margin-top: 12px; }
.admin-login .search-field { padding: 0 14px; }
.admin-hint { margin: 0; color: var(--label-2); font-size: 15px; }
.pill-btn { height: 34px; padding: 0 16px; border-radius: 999px; background: var(--tint); color: #fff; font-size: 15px; font-weight: 600; justify-self: start; }
.pill-btn.ghost { background: var(--fill); color: var(--label); }
.pill-btn:disabled { opacity: .5; }
.pill-btn:active { transform: scale(.97); }
.review-list { list-style: none; margin: 0; padding: 0; }
.review { padding: 14px 0; border-top: .5px solid var(--sep); }
.review:first-child { border-top: 0; }
.review-empty { padding: 14px 0; color: var(--label-2); font-size: 15px; }
.rv-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-family: var(--font-jp); }
.rv-song { font-weight: 600; color: var(--tint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-artist { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-ctx { margin: 6px 0 0; font-family: var(--font-jp); font-size: 14px; color: var(--label-2); line-height: 1.6; }
.rv-ctx:empty { display: none; }
.rv-ctx mark { background: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--label); border-radius: 3px; padding: 0 2px; }
.rv-change { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-family: var(--font-jp); flex-wrap: wrap; }
.rv-change svg { width: 16px; height: 16px; color: var(--label-3); }
.rv-word { font-size: 20px; font-weight: 700; }
.rv-from, .rv-to { display: inline-flex; flex-direction: column; font-size: 16px; line-height: 1.3; }
.rv-from { color: var(--label-2); text-decoration: line-through; text-decoration-color: var(--label-3); }
.rv-to { font-weight: 600; color: var(--label); }
.rv-change small { font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--label-2); text-decoration: none; }
.rv-actions { display: flex; gap: 8px; margin-top: 12px; }
.admin-foot { margin-top: 32px; font-size: 13px; color: var(--label-2); }
.admin-foot .text-btn { font-size: 13px; }
/* 관리 화면: 워드마크 대신 '‹ 검색'만 */
body.on-admin .wordmark { display: none; }
body.on-admin .nav-back { display: inline-flex; }

/* 관리 버튼 (관리자 기기에서만 표시) + 대기 건수 배지 */
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-btn { position: relative; }
.nav-btn svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--tint); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* 관리: 별칭 */
.alias-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 12px 0 4px; }
.alias-form .search-field { padding: 0 12px; }
.alias-form .pill-btn { height: 40px; align-self: center; }
@media (max-width: 560px) { .alias-form { grid-template-columns: 1fr; } }
.sub-head { margin: 18px 0 2px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.alias-row .rv-change { margin-top: 0; }

/* 적용된 수정: 곡별 묶음 */
.applied-filter { margin: 0 0 8px; }
.applied-filter[hidden] { display: none; }
.song-group { border-top: .5px solid var(--sep); }
.song-group:first-child { border-top: 0; }
.song-group summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.song-group summary::-webkit-details-marker { display: none; }
.sgp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sgp-title { font-family: var(--font-jp); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgp-count { min-width: 24px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--label) 8%, transparent); color: var(--label-2); font-size: 13px; font-weight: 600; text-align: center; }
.sgp-chev { width: 16px; height: 16px; color: var(--label-3); transition: transform .2s; flex: none; }
.song-group details[open] .sgp-chev { transform: rotate(90deg); }
.song-group details > .review-list { padding: 0 0 4px 12px; border-left: 2px solid var(--sep); margin-left: 2px; }
.sgp-open { display: inline-block; margin: 4px 0 14px 14px; font-size: 14px; color: var(--tint); }
.review.compact { padding: 10px 0; }
.review.compact .rv-ctx { margin: 0; font-size: 13px; }
.review.compact .rv-change { margin-top: 6px; }
.review.compact .rv-word { font-size: 17px; }
.rv-line { font-size: 12px; color: var(--label-3); font-family: var(--font); }
.review.compact .pill-btn { margin-left: auto; }
.al-q { font-size: 16px; font-weight: 600; }
.al-t { font-family: var(--font-jp); font-size: 16px; }
.al-n { font-size: 12px; color: var(--label-2); background: var(--fill); padding: 2px 8px; border-radius: 999px; }

/* 아이마스 허브 링크: 푸터 맨 아래에 작게 */
.footnote .hub-foot { display: block; width: max-content; margin: 14px auto 0; font-size: 11px; color: var(--label-3); text-decoration: none; }
