/* PLAY 화면 스타일: 휴대폰 먼저, 밝은·어두운 화면 모두 (기기 설정을 따름)
   색: 따뜻한 종이 바탕 / 깊은 밤 바탕 + 노을빛(주황→분홍) 강조. 누르는 곳은 44px 이상, 글은 16px 이상(입력칸)
   글꼴: Pretendard (서버가 직접 보냄, 화면에 나온 글자 조각만 받음)
   크기 단계: 글 13·14·15·16·17·20·24·28 (보조 글도 13px 이상: 중년 가족이 씀) / 둥글기 6(곡 표지)·10(카드 표지)·16(카드)·24(시트) / 간격 4의 배수
   대비(WCAG): 본문·보조 글 4.5:1 이상, 스위치·입력칸 테두리 3:1 이상. 색을 바꾸면 다시 잴 것
   노을빛 그라데이션은 로고·화면마다 하나뿐인 큰 재생 버튼에만 (여기저기 쓰면 강조가 사라짐) */
@property --np { syntax: '<color>'; inherits: true; initial-value: #8a3a52; }
:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --sunk: #efece6;
  --line: #e8e3da;
  --control: #8f887e;
  --text: #141217;
  --dim: #55505c;
  --faint: #625c68;
  --accent: #b8284c;
  --accent-2: #f2672e;
  --accent-text: #ffffff;
  --accent-soft: #fbe5ea;
  --grad: linear-gradient(135deg, #ff7a45, #e8366f);
  --grad-btn: linear-gradient(135deg, #c2410c, #be123c); /* 흰 글씨를 올리는 버튼 (대비 5:1 이상) */
  --np: #8a3a52; /* 지금 곡 표지에서 뽑은 색 (nowplaying.js가 바꿈) */
  --gutter: 20px;
  --toast-accent: #ff8fa8;
  --good: #1d7a4c; --good-soft: #e2f3e9;
  --warn: #9a5b00; --warn-soft: #fff1dc;
  --bad: #b42318; --bad-soft: #fdecea;
  --glass: rgba(255, 255, 255, .82);
  --shadow: 0 1px 2px rgba(20, 16, 10, .04), 0 2px 8px rgba(20, 16, 10, .05);
  --shadow-lift: 0 10px 34px rgba(30, 20, 10, .18);
  --radius: 16px;
  --tabs-h: 60px;
  --mini-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* 왼쪽·오른쪽 여백: 아이폰은 가로일 때 아일랜드가 한쪽에만 있어도 양쪽에 같은 폭을 알려 준다.
     app.js가 돌린 방향을 보고 html.island-left/right를 붙이면 반대쪽은 0 (2026-11-10) */
  --sa-l: env(safe-area-inset-left, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light dark;
}
html.island-left { --sa-r: 0px; }
html.island-right { --sa-l: 0px; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0e;
    --card: #16161b;
    --sunk: #202027;
    --line: rgba(255, 255, 255, .09);
    --control: #6b6873;
    --text: #f5f4f7;
    --dim: #b4b0bb;
    --faint: #9894a0;
    --accent: #ff6d8e;
    --accent-2: #ff8a5c;
    --accent-text: #1b0a10;
    --accent-soft: #3a1a24;
    --good: #67d29c; --good-soft: #13281e;
    --warn: #f0b660; --warn-soft: #2d2414;
    --bad: #ff8a80; --bad-soft: #321a19;
    --glass: rgba(22, 22, 27, .8);
    --toast-accent: #c9184a;
    --shadow: none;
    --shadow-lift: 0 12px 40px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overscroll-behavior: none; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased; letter-spacing: -.01em; font-feature-settings: 'ss06';
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- 틀 ---------- */
/* 틀은 그대로, 내용만 움직인다 (/srv/infra/shared/UX.md '1. 화면 틀'): 문서는 스크롤되지 않고 내용 칸(#view) 하나만 스크롤된다.
   자리를 읽고 옮길 때도 window가 아니라 #view의 scrollTop (app.js). 위에 붙는 줄(.topbar·.search-bar·.seg)은 내용 칸 안에서 sticky.
   아래 메뉴·작은 플레이어는 비치는 유리 모양이라 내용 칸 위에 떠 있고(fixed), 내용 칸이 그만큼 아래 여백을 둔다 */
body.main-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#pending { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 24px); }
body.has-mini .view { padding-bottom: calc(var(--tabs-h) + var(--mini-h) + var(--safe-b) + 28px); }
.page { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) max(var(--gutter), var(--sa-r)) 0 max(var(--gutter), var(--sa-l)); }
.page.detail { padding-top: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: 0 -1px 0 var(--line);
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; font-weight: 500; color: var(--faint); transition: color .15s; }
.tabs a.on { color: var(--accent); font-weight: 800; }
.tabs a.on .ic { stroke-width: 2.5; }
body.full-open .tabs, body.full-open .mini { visibility: hidden; }

/* 맨 위 줄 (하위 화면) */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; margin: 0 calc(-1 * var(--gutter)); padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: transparent; transition: background-color .2s, box-shadow .2s;
}
.topbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; padding-right: 44px; }
.topbar-right { display: flex; }
.topbar.scrolled { background: var(--glass); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 1px 0 var(--line); }
.topbar.scrolled .topbar-title { opacity: 1; }
.topbar .ib { color: var(--text); }

/* 아이콘 버튼 */
.ib { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--dim); flex: none; }
.ib:active { background: var(--sunk); }
.ib:disabled { opacity: .35; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: var(--accent-text); } }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; transform: none; }

/* ---------- 표지 ---------- */
.art { position: relative; width: var(--s); height: var(--s); flex: none; border-radius: 6px; overflow: hidden; background: var(--sunk); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.art.ph { display: grid; place-items: center; color: hsl(var(--h) 55% 92%); background: linear-gradient(140deg, hsl(var(--h) 45% 46%), hsl(calc(var(--h) + 40) 50% 30%)); }
.art.round { border-radius: 50%; }
.art.big { border-radius: 10px; box-shadow: var(--shadow-lift); }
.art.card-art { border-radius: 10px; }
.art img { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .12); }
.new-art { display: grid; place-items: center; background: var(--sunk); color: var(--dim); border: 1.5px dashed var(--line); }

/* ---------- 홈 ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 14px; }
.wordmark { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.wordmark .dot { width: 26px; height: 26px; border-radius: 7px; display: block; }
.hello { margin: 2px 0 0; color: var(--dim); font-size: 15px; font-weight: 500; }
.home-actions { display: flex; align-items: center; gap: 4px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sunk); color: var(--text); font-weight: 800; font-size: 17px; }
.avatar:active { opacity: .7; }

.resume {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 56px; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px; border: 0; border-radius: 20px; margin-bottom: 14px; box-shadow: var(--shadow);
  background: linear-gradient(120deg, color-mix(in oklab, var(--np) 26%, var(--card)), var(--card) 75%); transition: background .6s;
}
.resume:active { transform: scale(.985); }
.resume-art { border-radius: 12px; }
.resume-meta { display: grid; gap: 1px; min-width: 0; }
.resume-meta .kind { font-size: 13px; font-weight: 700; color: var(--accent); }
.resume-meta b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-meta .s, .resume-meta .ctx { font-size: 14px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-meta .ctx { font-size: 13px; color: var(--faint); }
.resume-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 14%, transparent); margin-top: 8px; overflow: hidden; }
.resume-bar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transform: scaleX(0); transform-origin: left; }
.resume-play { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(232, 54, 111, .35); }
.resume-play .ic.fill { margin-left: 3px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
body:not(.desk) .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } /* 홀수 개면 마지막 타일을 한 줄로 (빈칸 없이) */
.tile {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  min-height: 68px; padding: 12px; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
}
.tile:active { transform: scale(.97); }
.tile:disabled { opacity: .55; transform: none; }
.tile-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; --tc: #e8366f; color: var(--tc); background: color-mix(in oklab, var(--tc) 16%, var(--card)); }
.tile.tl-like .tile-ic { --tc: #e11d48; }
.tile.tl-all .tile-ic { --tc: #6d4aff; }
.tile.tl-top .tile-ic { --tc: #ea580c; }
.tile.tl-old .tile-ic { --tc: #0d9488; }
.tile.tl-radio .tile-ic { --tc: #2563eb; }
@media (prefers-color-scheme: dark) {
  .tile.tl-like .tile-ic { --tc: #fb7185; } .tile.tl-all .tile-ic { --tc: #a78bfa; } .tile.tl-top .tile-ic { --tc: #fb923c; }
  .tile.tl-old .tile-ic { --tc: #2dd4bf; } .tile.tl-radio .tile-ic { --tc: #60a5fa; }
}
.tile-t { font-weight: 700; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-s { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sec { margin-top: 32px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.sec-head h2:empty { display: none; }
.more-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; border: 0; background: none; color: var(--dim); font-size: 15px; font-weight: 600; padding: 0 4px; }
.shelf { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.card { flex: none; width: 148px; display: grid; gap: 2px; scroll-snap-align: start; text-align: left; border: 0; background: none; padding: 0; }
.card b { margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card span { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:not(a):active { transform: scale(.97); } /* 화면을 바꾸는 링크(a)는 누르는 순간 모양을 바꾸지 않는다 (UX.md 7) */
.new-card .new-art { width: 148px; height: 148px; border-radius: 10px; }

/* 앱으로 설치 안내 (kit installBanner) */
.home > .ak-install { margin: 4px 0 14px; }
body.desk .home > .ak-install { max-width: 880px; }

/* ---------- 곡 줄 ---------- */
.list { display: grid; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 6px 4px 6px 0;
  border-radius: 12px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; position: relative;
}
.row:has(.grip) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.row:has(.num) { grid-template-columns: 28px auto minmax(0, 1fr) auto; }
.row:active { background: var(--sunk); box-shadow: -8px 0 0 var(--sunk), 8px 0 0 var(--sunk); }
.row .meta { min-width: 0; }
.row .t { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 14px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .num { font-size: 14px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.row .right { display: flex; align-items: center; }
.row .dur { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 4px; }
.row .more { width: 44px; color: var(--faint); }
.row .lk { display: none; color: var(--accent); vertical-align: -1px; margin-right: 4px; }
.row.liked .lk { display: inline-flex; }
.library .row .lk { display: none; }
.row.played { opacity: .55; }
.row.now .t { color: var(--accent); }
.row.gone { opacity: .5; cursor: default; }
.art-wrap { position: relative; }
.eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 12px; border-radius: 6px; background: rgba(0, 0, 0, .45); }
.eq i { width: 4px; height: 20px; border-radius: 2px; background: #fff; transform-origin: bottom; transform: scaleY(.35); }
.row.now .eq { display: flex; }
body.playing .row.now .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.grip { display: grid; place-items: center; width: 32px; height: 44px; color: var(--faint); touch-action: none; cursor: grab; }
.row.lift { z-index: 5; background: var(--card); box-shadow: var(--shadow-lift); transition: none; }
.list.editing .row, .queue-list .row { transition: transform .15s var(--ease); }
.row.lift { transition: none !important; }
.rm { color: var(--faint); }

.like { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--faint); padding: 0; }
.like[aria-pressed="true"] { color: var(--accent); }
.like.pop .ic { animation: pop .38s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* 폴더·플레이리스트 줄 */
.frow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 68px; padding: 6px 0; border-radius: 12px; color: var(--text); width: 100%; text-align: left; border: 0; background: none; }
.frow:not(a):active { background: var(--sunk); box-shadow: -8px 0 0 var(--sunk), 8px 0 0 var(--sunk); }
.frow .meta { min-width: 0; }
.frow .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.frow .s { font-size: 14px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow > .ic { color: var(--faint); }
.new-row .new-art { width: 56px; height: 56px; border-radius: 8px; }
.all-row .new-art { width: 56px; height: 56px; border-radius: 8px; border-style: solid; }
.badge { font-size: 13px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); flex: none; }
.folder-rows { display: grid; }

/* ---------- 머리 부분 ---------- */
.hero { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 12px 0 8px; }
.hero-meta { display: grid; gap: 4px; min-width: 0; max-width: 100%; }
.hero .kind { font-size: 13px; font-weight: 600; color: var(--faint); }
.hero h1 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 800; letter-spacing: -.03em; }
.hero-sub { margin: 0; color: var(--dim); font-size: 15px; }
.hero-actions { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; }
.play-all, .shuffle-all { flex: 1; min-width: 0; min-height: 50px; font-size: 16px; }
.btn.play-all { background: var(--grad-btn); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(190, 18, 60, .25); }
.hero-more, .btn.radio-btn { flex: none; width: 50px; min-height: 50px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); }
@media (min-width: 640px) {
  .hero { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: end; column-gap: 24px; }
  .hero .art { grid-row: span 2; }
}

/* ---------- 찾기 ---------- */
.search-bar { position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--gutter)); padding: calc(var(--safe-t) + 10px) var(--gutter) 10px; background: var(--bg); }
.search-box { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 4px 0 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--faint); }
.search-box:focus-within { border-color: var(--accent); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 17px; color: var(--text); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input::placeholder, .text::placeholder, .form input::placeholder { color: var(--faint); opacity: 1; }
.search-box .clear { width: 44px; height: 44px; }
.search-tips { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--card); color: var(--dim); font-size: 14px; }
.search-tips p { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 700; color: var(--text); }
.search-tips ul { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 4px; }
.search-tips b { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 15px; font-weight: 600; }
.chip:active { background: var(--sunk); }
.rec-chip { padding: 0; gap: 0; }
.rec-q { border: 0; background: none; min-height: 44px; padding: 0 4px 0 16px; font-weight: 600; }
.rec-x { display: grid; place-items: center; width: 40px; min-height: 44px; border: 0; background: none; color: var(--faint); }
.search-hint { margin: 28px 0 0; font-size: 14px; color: var(--faint); line-height: 1.6; }
.artist-chip { padding-left: 6px; }
.artist-chip small { color: var(--faint); font-weight: 500; }

/* ---------- 보관함 ---------- */
.lib-head h1 { margin: 6px 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.library .offline-row { margin-bottom: 4px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 15; margin: 0 calc(-1 * var(--gutter)); padding: calc(var(--safe-t) + 6px) var(--gutter) 10px; background: var(--bg); }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--dim); }
.seg-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg-btn:active { opacity: .7; }
.lib-body { padding-top: 4px; }
.sub-head { margin: 20px 0 4px; font-size: 14px; color: var(--faint); }
.shelf-empty { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }
.shelf-note { margin: 0 0 6px; color: var(--dim); font-size: 13px; line-height: 1.5; }
.letters { display: flex; gap: 4px; margin: 0 calc(-1 * var(--gutter)) 8px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.letters::-webkit-scrollbar { display: none; }
.letters button { flex: none; min-width: 44px; height: 44px; border: 0; border-radius: 8px; background: var(--card); font-size: 14px; font-weight: 700; color: var(--dim); }
.letter-head { margin: 16px 0 2px; font-size: 14px; font-weight: 700; color: var(--faint); scroll-margin-top: 80px; }
.list-actions { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.list-actions span { flex: 1; font-size: 13px; color: var(--faint); }
.edit-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 12px; margin: 8px 0; border-radius: 12px; background: var(--accent-soft); font-size: 13px; color: var(--dim); }

.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14vh 20px 48px; color: var(--faint); }
.empty-ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; margin-bottom: 8px; background: var(--accent-soft); color: var(--accent); }
.empty p { margin: 0; color: var(--text); font-size: 18px; font-weight: 700; }
.empty p.sub { color: var(--dim); font-weight: 400; font-size: 15px; max-width: 320px; }
.empty .btn { margin-top: 14px; }
.loading { padding: 60px 0; text-align: center; color: var(--faint); }

/* ---------- 작은 플레이어 ---------- */
.mini {
  position: fixed; left: max(8px, var(--sa-l)); right: max(8px, var(--sa-r)); bottom: calc(var(--tabs-h) + var(--safe-b) + 6px); z-index: 31; height: var(--mini-h);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 0; padding: 0 4px 0 10px;
  border-radius: 16px; background: color-mix(in oklab, var(--np) 18%, var(--glass)); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--line); overflow: hidden; max-width: 760px; margin: 0 auto; transition: background-color .6s;
}
.mini-bar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 100%; background: var(--text); transform: scaleX(0); transform-origin: left; }
.mini-open:active { opacity: .7; }
.mini-open { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 0; min-width: 0; height: 100%; }
.mini-open .meta { min-width: 0; }
.mini-open .t { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-open .s { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .ib { color: var(--text); width: 46px; height: 46px; }
.mini.waiting .mini-play { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.like-slot { display: contents; }

/* ---------- 전체 화면 플레이어 ---------- */
.full {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 12px) max(24px, var(--sa-r)) calc(var(--safe-b) + 14px) max(24px, var(--sa-l)); overflow: hidden;
  color-scheme: dark; --text: #fff; --dim: rgba(255, 255, 255, .74); --faint: rgba(255, 255, 255, .6); --sunk: rgba(255, 255, 255, .1); --accent: #ff7d9c; --accent-text: #1b0a10; --line: rgba(255, 255, 255, .14);
  color: var(--text); background: linear-gradient(180deg, color-mix(in oklab, var(--np) 70%, #000) 0%, color-mix(in oklab, var(--np) 38%, #000) 55%, #0b0b0e 100%); transition: transform .32s var(--ease), background .6s, border-radius .32s var(--ease);
  transform: translateY(100%); touch-action: none; /* 스크롤할 것이 없음. pan-y면 브라우저가 아래로 끌기를 가져가 끌어 닫기가 끊겼음 */
}
.full.on { transform: none; }
.full-grab { position: absolute; top: calc(var(--safe-t) + 5px); left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .32); pointer-events: none; }
body.desk .full-grab { display: none; }
.full-bg { position: absolute; inset: -60px; z-index: -1; background-size: cover; background-position: center; filter: blur(70px) saturate(1.5); opacity: .35; }
.full-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, rgba(11, 11, 14, .85) 90%); }
.full-bg.none { background: var(--np); opacity: .3; }
.full-top { width: 100%; max-width: 520px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; min-height: 52px; }
.full-top .ib { color: var(--text); }
.full-ctx { display: grid; justify-items: center; align-content: center; min-height: 44px; border: 0; background: none; padding: 4px; min-width: 0; color: var(--text); }
.full-ctx:active { opacity: .6; }
.full-ctx .kind { font-size: 13px; font-weight: 600; color: var(--dim); }
.full-ctx b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.full-art-wrap { position: relative; flex: 1; width: 100%; max-width: 520px; display: grid; place-items: center; min-height: 0; padding: 12px 0; touch-action: none; }
.full-art { width: min(100%, 46vh, 420px); aspect-ratio: 1; transition: transform .25s var(--ease); }
/* 표지는 남은 칸(가로·세로) 안에 딱 맞게. 예전: 46vh로만 정해 세로가 짧은 아이폰(SE·8)에서 곡 이름을 덮었음. 컨테이너 단위를 모르는 옛 브라우저는 위 줄 */
@supports (container-type: size) {
  body:not(.desk) .full-art-wrap { container-type: size; } /* PC는 감싸개가 내용 크기를 따르므로 쓰지 않음 (쓰면 높이 0이 되어 표지가 다른 것을 덮음) */
  body:not(.desk) .full-art { width: min(100cqw, 100cqh, 420px); }
}
.full-art .art { width: 100% !important; height: 100% !important; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.full.paused .full-art { transform: scale(.92); }
.full-art.out-left { animation: outL .26s ease; }
.full-art.out-right { animation: outR .26s ease; }
@keyframes outL { 0% { transform: translateX(-80px); opacity: .3; } 100% { transform: none; opacity: 1; } }
@keyframes outR { 0% { transform: translateX(80px); opacity: .3; } 100% { transform: none; opacity: 1; } }
.heart-burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #fff; opacity: 0; filter: drop-shadow(0 6px 20px rgba(232, 54, 111, .7)); }
.heart-burst.on { animation: burst .8s var(--ease); }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.15); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
.full-info { width: 100%; max-width: 520px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 4px; }
.full-info .meta { min-width: 0; }
.full-info .t { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.full-info .s { display: block; max-width: 100%; min-height: 40px; border: 0; background: none; padding: 4px 0; color: var(--dim); font-size: 17px; font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.full-info .like { width: 48px; height: 48px; }
@media (pointer: coarse) { .full-info .s { min-height: 44px; margin: -2px 0; padding: 6px 0; } } /* 자리는 40px 그대로, 누르는 곳만 44px */
.seek { width: 100%; max-width: 520px; margin-top: 10px; }
.seek-range { width: 100%; height: 44px; margin: 0; background: none; -webkit-appearance: none; appearance: none; --p: 0%; touch-action: none; }
.seek-range::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--text) var(--p), rgba(255, 255, 255, .32) var(--p)); }
.seek-range::-moz-range-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--text) var(--p), rgba(255, 255, 255, .32) var(--p)); }
.seek-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; transition: transform .15s; border-radius: 50%; background: var(--text); border: 0; }
.seek-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--text); border: 0; }
.seek-times { display: flex; justify-content: space-between; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: -2px; }
.controls { width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; }
.controls .ib { color: var(--text); width: 56px; height: 56px; }
.controls .c-shuffle, .controls .c-repeat { color: var(--faint); width: 50px; height: 50px; position: relative; }
.controls .on { color: var(--text); background: rgba(255, 255, 255, .16); }
.controls .on::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.controls .c-play { width: 76px; height: 76px; background: #fff; color: #0b0b0e; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.controls .c-play .ic-play { margin-left: 4px; }
.controls .c-play:active { transform: scale(.94); }
.full-tools { width: 100%; max-width: 420px; display: flex; justify-content: space-around; margin-top: 4px; }
.tool { display: grid; justify-items: center; gap: 2px; min-width: 76px; min-height: 52px; border: 0; background: none; color: var(--dim); font-size: 13px; font-weight: 600; border-radius: 12px; padding: 4px; }
.tool.on { color: var(--accent); }
.tool:active { background: var(--sunk); }
.full-info .s::after { content: ' ›'; color: var(--faint); }
.full-next { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 520px; min-height: 40px; margin-top: 2px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .08); color: var(--dim); font-size: 14px; text-align: left; }
.full-next:empty { display: none; }
.full-next .k { flex: none; font-weight: 700; color: var(--text); }
.full-next .v { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.full-next:active { background: rgba(255, 255, 255, .16); }
.full .like { color: var(--dim); }
.full .like[aria-pressed="true"] { color: var(--accent); }
@media (max-height: 700px) { .full-next { display: none; } }
@media (max-height: 640px) { .full-tools { margin-top: 0; } .controls { margin: 4px 0 2px; } .full-info .t { font-size: 20px; -webkit-line-clamp: 1; } }
/* 가로 화면 '다음 곡' (세로 화면에서는 숨김, 아래 가로 규칙에서 보임) */
.full-upnext { display: none; }
.tool.t-awake { display: none; } /* 화면 켜 두기는 가로에서만 */
.un-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.un-head b { flex: none; font-size: 13px; font-weight: 700; color: var(--dim); }
.un-peek { display: none; min-width: 0; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.un-all { margin-left: auto; flex: none; min-height: 28px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: var(--dim); font-size: 13px; font-weight: 600; }
.un-all:active { background: var(--sunk); }
.un-list { display: grid; gap: 2px; }
.un-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; padding: 4px 8px 4px 4px; margin: 0 -4px; border: 0; border-radius: 10px; background: none; text-align: left; }
.un-row:active { background: var(--sunk); }
.un-row .art { width: 40px !important; height: 40px !important; border-radius: 6px; }
.un-row .meta { display: grid; min-width: 0; }
.un-row .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.un-row .s { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.un-empty { margin: 4px 0 0; font-size: 14px; color: var(--dim); }

/* 휴대폰 가로 화면 (2026-11-10 개편, nowplaying.js LANDSCAPE와 같은 조건): 표지는 왼쪽, 오른쪽은 곡 정보 · 다음 곡 · 위치 · 버튼.
   도구(대기열·잠자기·차량 모드)는 맨 위 줄 오른쪽에 아이콘으로. 바탕 표지 색을 세로보다 진하게 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  .full { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; column-gap: 32px; align-items: center;
    padding-top: calc(var(--safe-t) + 4px); padding-bottom: calc(var(--safe-b) + 8px); }
  .full .full-top { grid-column: 1 / -1; grid-row: 1; max-width: none; min-height: 44px; }
  .full-ctx { justify-items: start; text-align: left; padding: 4px 8px; max-width: calc(42vw - 40px); }
  .full-ctx b { font-size: 14px; }
  .full .full-tools { grid-column: 2; grid-row: 1; justify-self: end; width: auto; max-width: none; margin: 0 48px 0 0; gap: 2px; justify-content: flex-end; position: relative; z-index: 1; }
  .tool { grid-auto-flow: column; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px; }
  .tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* 글은 화면 낭독기만 (ux-ok: 위치를 잡는 부모 .full-tools가 relative라 문서를 늘리지 않음, 11-11 재어 봄) */
  .tool.t-sleep.on span { position: static; width: auto; height: auto; clip-path: none; font-size: 14px; } /* 남은 시간은 보이게 */
  .full-art-wrap { grid-column: 1; grid-row: 2 / -1; height: 100%; padding: 2px 0 4px; }
  .full .full-info { grid-column: 2; grid-row: 2; max-width: none; margin-top: 0; }
  .full-info .t { font-size: 22px; -webkit-line-clamp: 1; }
  .full-info .s { min-height: 36px; padding: 2px 0; font-size: 16px; }
  .full-upnext { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-column: 2; grid-row: 3; align-self: stretch; width: 100%; min-height: 0; overflow: hidden; container-type: size; padding-top: 2px; }
  /* '불러오는 중…'은 자리를 차지하지 않게 표지 아래쪽에 띄운다 (자리를 두면 다음 곡 칸이 줄어 줄 수가 바뀜) */
  .full .full-status { position: absolute; grid-column: 1; grid-row: 6; bottom: 14px; left: 0; right: 0; width: fit-content; max-width: 90%; min-height: 0; margin: 0 auto; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .72); text-align: center; pointer-events: none; z-index: 2; }
  .full .full-status:empty { display: none; }
  .full .seek { grid-column: 2; grid-row: 5; max-width: none; margin-top: 0; }
  .full .controls { grid-column: 2; grid-row: 6; max-width: none; margin: 0; }
  .controls .ib { width: 52px; height: 52px; }
  .controls .c-play { width: 64px; height: 64px; }
  .full-next { display: none; } /* 손잡이 막대는 가로에서도 보인다: 가로에서도 끌어 내려 닫는다 (UX.md '2. 끌어 내려 닫기') */
  .full-bg { opacity: .6; }
  .full-bg::after { background: linear-gradient(90deg, rgba(11, 11, 14, .1) 0%, rgba(11, 11, 14, .55) 55%, rgba(11, 11, 14, .78) 100%); }
  html.big .full .full-info .t { font-size: 24px; }
  .full .gesture-hint { top: 50%; transform: translate(-50%, -50%); max-width: 100%; } /* 표지가 작아 위쪽에 두면 표지 밖으로 삐져나왔음 → 표지 가운데 */
  .full .tool.t-awake { display: grid; }
  /* 보는 화면 (화면 켜 두기 + 30초 손대지 않음): 표지와 곡 제목만, 버튼은 서서히 사라짐. 한 번 누르면 다시 보임 */
  .full .full-top, .full .full-tools, .full .full-upnext, .full .seek, .full .controls, .full .full-info .like { transition: opacity .4s; }
  .full.ambient .full-top, .full.ambient .full-tools, .full.ambient .full-upnext, .full.ambient .seek, .full.ambient .controls, .full.ambient .full-info .like { opacity: 0; pointer-events: none; transition-duration: 1.2s; }
  .full.ambient .full-info { grid-row: 2 / -1; align-self: center; }
  .full.ambient .full-info .t { font-size: 32px; -webkit-line-clamp: 3; }
  .full.ambient .full-info .s { font-size: 20px; pointer-events: none; }
  .full.ambient .full-info .s::after { content: none; }
  /* 오래 켜 둘 때 같은 자리에 같은 그림이 남지 않게 아주 천천히 움직임 (OLED 잔상) */
  .full.ambient .full-art-wrap, .full.ambient .full-info { animation: drift 90s ease-in-out infinite alternate; }
}
/* 다음 곡: 남은 높이만큼만 (줄이 반쯤 잘려 보이지 않게). 한 줄도 안 들어가면 머리줄에 다음 곡 이름만 */
/* 머리줄 28 + 위 여백 2 + 줄마다 48(사이 2) → 1줄 78, 2줄 128, 3줄 178 */
@container (max-height: 177.9px) { .un-row:nth-child(n+3) { display: none; } }
@container (max-height: 127.9px) { .un-row:nth-child(n+2) { display: none; } }
@container (max-height: 77.9px) { .un-list { display: none; } .un-peek { display: block; } }

/* ---------- 차량 모드 ---------- */
.car {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #000; color: #fff;
  padding: calc(var(--safe-t) + 8px) max(16px, var(--sa-r)) calc(var(--safe-b) + 12px) max(16px, var(--sa-l)); opacity: 0; transition: opacity .2s; touch-action: none; user-select: none; -webkit-user-select: none;
}
.car.on { opacity: 1; }
.car-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.car-label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #9a96a3; }
.car-clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.car-close { color: #fff; width: 60px; height: 60px; background: #1d1d22; }
.car-info { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 10px; }
.car-art .art { border-radius: 14px; }
.car-text { min-width: 0; }
.car-text .t { font-size: clamp(26px, 7.5vw, 44px); font-weight: 800; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car-text .s { font-size: clamp(18px, 5vw, 28px); color: #c3bfcb; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-bar { height: 8px; border-radius: 4px; background: #2a2a30; margin-top: 22px; overflow: hidden; }
.car-bar i { display: block; height: 100%; width: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.car-times { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; font-size: 20px; color: #c3bfcb; font-variant-numeric: tabular-nums; }
.car-times .next-up { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.car-times .cur { flex: none; color: #9a96a3; font-size: 18px; }
.car-btns { flex: 1; display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 10px; margin-top: 18px; min-height: 160px; }
.car-btn { border: 0; border-radius: 24px; background: #1b1b20; color: #fff; display: grid; place-items: center; }
.car-btn:active { background: #2e2e36; transform: scale(.98); }
.cb-play { background: #fff; color: #000; }
.cb-play:active { background: #ddd; }
.cb-play .ic-play { margin-left: 8px; }
.car-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.car-small { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; border: 0; border-radius: 20px; background: #1b1b20; color: #fff; font-size: 20px; font-weight: 700; }
.car-small.on { color: #ff6d8e; }
.car-small:active { background: #2e2e36; }
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  /* 왼쪽은 큰 버튼 셋, 오른쪽은 곡 정보(남는 높이의 가운데) · 위치 · 다음 곡 · 좋아요/셔플 */
  .car { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; column-gap: 20px; }
  .car-top { grid-column: 1 / -1; grid-row: 1; }
  .car-btns { grid-column: 1; grid-row: 2 / 7; margin-top: 0; min-height: 0; }
  .car-info { grid-column: 2; grid-row: 2; align-self: center; margin-top: 0; gap: 14px; }
  .car-bar { grid-column: 2; grid-row: 3; margin-top: 10px; }
  .car-times { grid-column: 2; grid-row: 4; }
  .car-status { grid-column: 2; grid-row: 5; }
  .car-sub { grid-column: 2; grid-row: 6; margin-top: 12px; }
  /* 오른쪽 칸이 좁다: 제목은 낱말 단위로 두 줄, 화면 높이에 맞춘 크기 (기본 규칙보다 뒤에 있어야 먹는다) */
  .car-art .art { width: clamp(64px, 10vw, 112px) !important; height: clamp(64px, 10vw, 112px) !important; }
  .car-text .t { overflow-wrap: normal; font-size: clamp(26px, min(9vh, 4.4vw), 40px); }
  .car-text .s { font-size: clamp(18px, 5.5vh, 26px); }
  .car-small { min-height: clamp(60px, 18vh, 72px); }
}

/* ---------- 시트 ---------- */
.backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s; }
.backdrop.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  max-width: 560px; margin: 0 auto; padding: 6px 12px calc(var(--safe-b) + 14px); border-radius: 24px 24px 0 0; background: var(--card);
  transform: translateY(100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lift);
}
.sheet.on { transform: none; }
.sheet.tall { height: 86vh; height: 86dvh; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 8px; }
/* 시트 머리: 위에 붙어 있고(목록만 스크롤) 어디를 잡아도 끌어 내린다. 시트 안쪽 여백만큼 당겨 끝까지 덮는다 */
.sheet-top { position: sticky; top: -6px; z-index: 3; margin: -6px -12px 0; padding: 6px 12px 0; min-height: 44px; background: var(--card); border-radius: 24px 24px 0 0; touch-action: none; transition: box-shadow .2s; }
.sheet-top.scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 14px -10px rgba(0, 0, 0, .35); }
.sheet-title { display: grid; gap: 2px; padding: 4px 8px 10px; cursor: grab; }
.sheet-title b { font-size: 17px; }
.sheet-title span { font-size: 14px; color: var(--dim); }
.sheet-track { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-track .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-track .s { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-items { display: grid; }
.sheet-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 54px; padding: 6px 10px; border: 0; border-radius: 12px; background: none; text-align: left; color: var(--text); }
.sheet-item:active { background: var(--sunk); }
.sheet-item > span { display: grid; min-width: 0; }
.sheet-item .l { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item .d { font-size: 14px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item .ic { color: var(--dim); }
.sheet-item.danger, .sheet-item.danger .ic { color: var(--bad); }
.sheet-item.on .ic:last-child { color: var(--accent); }
.sheet-close { width: calc(100% - 16px); margin: 8px 8px 0; background: var(--sunk); border-color: transparent; }
.ask { display: grid; gap: 14px; padding: 4px 8px 6px; }
.text { width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--control); background: var(--sunk); font-size: 17px; outline: none; }
.text:focus { border-color: var(--accent); }
.ask-btns { display: flex; gap: 10px; justify-content: flex-end; }
.ask-btns .btn { flex: 1; }
.confirm { padding: 0 8px 4px; }
.confirm p { margin: 0 0 8px; color: var(--dim); }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 6px; }
.queue-head b { font-size: 18px; margin-right: 8px; }
.queue-head .qcount { font-size: 14px; color: var(--faint); }
.queue-ctx { margin: 0 8px 6px; font-size: 14px; color: var(--faint); }
.queue-label { margin: 10px 8px 2px; font-size: 13px; font-weight: 700; color: var(--faint); }
.queue-tail { margin: 10px 8px 0; font-size: 14px; color: var(--dim); }
.queue-more { display: block; margin: 10px auto 0; min-height: 44px; }
.queue-now { background: var(--accent-soft); }

/* ---------- 관리 화면 (앱 위 겹 화면, 음악은 계속) ---------- */
.admin-layer { position: fixed; inset: 0; z-index: 75; background: var(--bg); }
.admin-frame { width: 100%; height: 100%; border: 0; display: block; }
body.admin-open .mini { bottom: calc(var(--safe-b) + 8px); z-index: 76; }
body.admin-open .tabs { visibility: hidden; }
/* 작은 플레이어가 있으면 관리 화면은 그 위에서 끝난다 (PC 재생 막대와 같은 방식).
   예전: 관리 화면이 플레이어 밑까지 깔려 맨 아래 단추·아래에서 올라오는 창·알림이 플레이어에 가렸음 */
body.has-mini:not(.desk) .admin-layer { padding-bottom: calc(var(--mini-h) + var(--safe-b) + 16px); }

/* ---------- 알림 ---------- */
/* 알림 띠는 공통 부품(kit)의 .ak-toast 하나를 쓴다 (/srv/infra/shared/UX.md '4. 아래 알림'). 늘 아래 가운데, 창이 열려 있어도 창 위(z-index 1000)에 보인다.
   여기서는 색과, 아래 메뉴·작은 플레이어를 가리지 않게 띄울 높이(--ak-toast-b)만 알려 준다. 글자 모양은 kit-theme.css */
:root { --ak-toast-bg: var(--text); --ak-toast-text: var(--bg); }
body.main-page { --ak-toast-b: var(--tabs-h); }
body.main-page.has-mini { --ak-toast-b: calc(var(--tabs-h) + var(--mini-h)); }
body.main-page.admin-open { --ak-toast-b: 0px; }
body.main-page.admin-open.has-mini { --ak-toast-b: var(--mini-h); }
body.main-page.full-open { --ak-toast-b: 108px; } /* 재생 화면: 조절 단추 줄 위 */


/* ---------- 로그인 ---------- */
/* 로그인·가입도 같은 틀: 문서는 그대로, main 하나만 스크롤 (UX.md 1·9). 내용이 짧으면 가운데, 길면(가입 양식) 위에서부터 */
.login-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 50% 0%, var(--accent-soft), var(--bg) 70%); }
.login-page main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; padding: 24px 16px; }
.login-page main > .login-head, .login-page main > .card { flex: none; width: min(420px, 100%); margin-left: auto; margin-right: auto; }
.login-page .login-head { margin-top: auto; }
.login-page main > .card { margin-bottom: auto; }
/* 입력칸이 제 글자 폭만큼 버텨 카드 밖으로 나가지 않게 (좁은 화면 390px) */
.login-page .form, .login-page .form label { grid-template-columns: minmax(0, 1fr); }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head h1 { margin: 10px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: inline-block; width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 10px 30px rgba(232, 54, 111, .3); }
.muted { color: var(--dim); }
.small { font-size: 14px; }
.card { }
.login-page .card { width: auto; display: block; padding: 18px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.login-page .tabs { position: static; height: auto; padding: 4px; background: var(--sunk); border: 0; border-radius: 12px; margin-bottom: 14px; display: flex; gap: 4px; backdrop-filter: none; }
.login-page .tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--dim); }
@media (pointer: coarse) { .login-page .tabs button { min-height: 44px; } }
.login-page .tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--dim); }
.form label small { font-weight: 400; color: var(--faint); }
.form input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--control); background: var(--sunk); font-size: 17px; outline: none; }
.form input:focus { border-color: var(--accent); }
/* 로그인 비밀번호 보기 단추: 칸 오른쪽 안 (보기 단추가 label 밖에 있어야 입력 칸 이름이 '비밀번호'로만 읽힘, golf와 같게 11-11) */
.pw-field { display: grid; gap: 6px; }
.pw-field > label { font-size: 14px; font-weight: 700; color: var(--dim); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 72px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-width: 60px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.form .btn { margin-top: 6px; min-height: 50px; background: var(--grad-btn); color: #fff; border: 0; }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--bad); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 휴대폰에 받기·데이터 절약 ---------- */
.row .dl { display: none; color: var(--good); vertical-align: -2px; margin-right: 4px; }
.row.saved .dl { display: inline-flex; }
body.offline .list .row:not(.saved):not(.gone) { opacity: .4; }
/* 끊김 띠는 틀의 맨 위 한 칸. 띠가 상태 줄 여백을 이미 차지하므로 그 아래 내용 칸은 위 여백을 다시 두지 않는다 */
body.offline .view { --safe-t: 0px; }
.offline-bar { flex: none; position: relative; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: calc(var(--safe-t) + 8px) 16px 8px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 700; text-align: center; }
.save-btn { gap: 6px; }
.save-btn.on { color: var(--good); border-color: var(--good); }
.hero-save { min-height: 48px; padding: 0 12px; }
@media (max-width: 420px) { .hero-actions:has(.hero-save) { gap: 8px; } .hero-actions:has(.hero-save) :is(.play-all, .shuffle-all) { min-width: 0; padding: 0 16px; } }
.hero-actions:has(.hero-save) { flex-wrap: wrap; }
.sw-ic { --s: 56px; color: var(--accent); border-style: solid; }
.like-ic { color: var(--accent); }
.switch-row { cursor: pointer; }
.switch-row .s { white-space: normal; }
.qpanel .switch-row .t { white-space: normal; } /* 좁은 대기열 창(300px)에서 이름이 잘리지 않게 두 줄까지 */
.switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--control); transition: background .2s var(--ease); }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch-row[aria-checked="true"] .switch { background: var(--good); }
.switch-row[aria-checked="true"] .switch i { transform: translateX(20px); }
.off-card { margin: 8px 0 4px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 12px; }
.off-big { display: flex; align-items: center; gap: 12px; }
.off-big > .ic { flex: none; color: var(--accent); }
.off-big b { display: block; font-size: 18px; }
.off-big span { display: block; font-size: 13px; color: var(--faint); }
.off-prog { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.off-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.off-job { display: grid; gap: 8px; }
.off-job-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--dim); }
.off-card .list-actions { margin: 0; justify-content: flex-end; }
.off-hint { margin: 0 0 4px; font-size: 13px; color: var(--faint); }
.off-tips { margin: 16px 0; padding: 12px 14px 12px 30px; border-radius: 12px; background: var(--sunk); font-size: 13px; color: var(--dim); display: grid; gap: 6px; }
.off-clear { width: 100%; margin: 20px 0 8px; }
.offline-row .s { white-space: normal; }

/* ---------- 상태 글 (다시 잇는 중·불러오는 중) ---------- */
.full-status { min-height: 20px; line-height: 20px; margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--warn); text-align: center; max-width: 520px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 비어 있어도 자리는 둔다: 표지 크기가 남은 칸에 맞춰지므로, '불러오는 중…'이 나타났다 사라질 때마다 표지가 줄었다 커졌음 (2026-11-09) */
.car-status { margin: 12px 0 0; font-size: 24px; font-weight: 800; color: #ffb547; }
.car-status:empty { display: none; }
/* 재생 버튼 둘레: 기다리는 중 (움직임을 줄인 설정에서도 보이게 고정 테두리) */
.controls .c-play.waiting, .cb-play.waiting { box-shadow: 0 0 0 4px var(--warn); }
.cb-play.waiting { box-shadow: 0 0 0 5px #ffb547; }
.gesture-hint { position: absolute; left: 50%; top: 18px; z-index: 2; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; }
/* 차량 모드만 알림을 위에 크게 둔다 (아래는 큰 조절 단추 자리. 운전 중 잘못 누르지 않게) */
body.car-open > .ak-toast { top: calc(var(--safe-t) + 72px); bottom: auto; font-size: 20px; padding: 16px 22px; }

/* ---------- 홈: 다시 듣기·시대별 믹스 ---------- */
.again-card { width: 128px; }
.again-art { position: relative; }
.card .again-play { position: absolute; right: 6px; bottom: 6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #141217; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.again-card.now b { color: var(--accent); }

/* ---------- 가수 정렬·라디오 ---------- */
.sort-chips { margin: 2px 0 10px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.radio-btn { min-height: 48px; }
.queue-foot { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- 긴 목록: 화면 밖 줄은 그리지 않는다 (가수 1,500명·전체 5,000곡) ---------- */
.list > .row, .lib-body > .frow { content-visibility: auto; contain-intrinsic-size: auto 64px; }
html.relayout .list > .row, html.relayout .lib-body > .frow { content-visibility: visible; } /* 돌린 직후 다시 배치 (app.js) */
.full.ak-dragging, .sheet.ak-dragging { will-change: transform; } /* 끄는 동안 (kit dragToClose가 붙이는 이름) */
/* 창(시트·전체 재생 화면)이 열려 있는 동안 뒤 내용 칸은 움직이지 않는다 (UX.md '3. 닫는 방법') */
@media (pointer: coarse) { body.layer-open .view { overflow: hidden; } }

/* ---------- 2026-11 개편: 처음 화면·빈 줄 모양·큰 글씨 ---------- */
.welcome { display: grid; gap: 6px; margin: 4px 0 14px; padding: 20px; border-radius: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--card)); box-shadow: var(--shadow); }
.welcome b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.welcome p { margin: 0 0 8px; color: var(--dim); font-size: 15px; }
.welcome-btns { display: flex; gap: 10px; }
.welcome-btns .btn { flex: 1; min-height: 50px; }
.skeleton { padding-top: 12px; }
.sk-hero { width: 168px; height: 168px; margin: 0 auto 24px; border-radius: 10px; background: var(--sunk); }
.sk-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.sk-row i { width: 48px; height: 48px; border-radius: 6px; background: var(--sunk); }
.sk-row span { flex: 1; display: grid; gap: 8px; }
.sk-row b { display: block; height: 12px; width: 60%; border-radius: 6px; background: var(--sunk); }
.sk-row b + b { width: 35%; }
.skeleton > * { animation: breathe 1.4s ease-in-out infinite; }
html.big .row .t, html.big .frow .t { font-size: 18px; }
html.big .row .s, html.big .frow .s, html.big .card span, html.big .tile-s, html.big .tabs a { font-size: 15px; }
html.big .card b, html.big .tile-t, html.big .mini-open .t { font-size: 17px; }
html.big .full-info .t { font-size: 27px; }
html.big .full-info .s, html.big .sheet-item .l { font-size: 18px; }
html.big .row { min-height: 72px; }
html.big .sec-head h2 { font-size: 22px; }
html.big .hero h1, html.big .lib-head h1 { font-size: 31px; }
html.big .chip, html.big .seg-btn, html.big .more-link, html.big .btn { font-size: 17px; }
html.big .search-input { font-size: 19px; }
html.big .full-next, html.big .seek-times, html.big .sheet-item .d { font-size: 16px; }
html.big .resume-meta b { font-size: 22px; }
html.big .tile-s { white-space: normal; }
@media (prefers-reduced-transparency: reduce) {
  .tabs, .mini, .topbar.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
}

/* ---------- 최종 점검(디자인) ---------- */
/* 재생 화면에서 연 창(대기열·메뉴)은 밝은 화면이어도 어둡게: 어두운 재생 화면 위로 흰 판이 올라오지 않게 */
body.full-open .sheet { color-scheme: dark; --card: #1c1b21; --text: #fff; --dim: rgba(255, 255, 255, .74); --faint: rgba(255, 255, 255, .62); --sunk: rgba(255, 255, 255, .1); --line: rgba(255, 255, 255, .14); --control: #6b6873; --accent: #ff7d9c; --accent-soft: #3a1a24; --accent-text: #1b0a10; color: var(--text); }
/* 큰 재생 버튼은 한 모양 (흰 글씨가 잘 보이는 진한 노을빛) */
.resume-play { background: var(--grad-btn); box-shadow: 0 6px 18px rgba(190, 18, 60, .25); }
.list-actions .btn.primary, .off-card .btn.primary { background: var(--grad-btn); color: #fff; border-color: transparent; }
/* 대기열: 지금 곡은 손잡이가 없으니 그만큼 들여 표지 줄을 맞춘다 */
.queue-list .row.queue-now { padding-left: 44px; }
/* 제목 없는 구획: 빈 머리 자리를 두지 않는다 */
.sec-head:has(h2:empty) { display: none; }
.sec:has(> .sec-head h2:empty) { margin-top: 16px; }
.hero + .list, .hero + .list-actions { margin-top: 16px; }
/* 재생 화면 간격 */
.seek-times { margin-top: -10px; }
.full-next { margin-top: 12px; }
/* 좁은 화면(360px): 곡 수 줄이 꺾이지 않게 */
.list-actions span { white-space: nowrap; }
@media (max-width: 374px) { .list-actions .btn.small { padding: 0 12px; } }
/* 가수 정렬: 위의 보관함 탭과 다르게 (낮은 단계의 고르기) */
.sort-chips .chip { padding: 0 12px; font-size: 14px; border-color: transparent; background: none; color: var(--dim); }
.sort-chips .chip.on { background: var(--sunk); color: var(--text); border-color: transparent; }
/* 둥글기 6·10·16·24 */
.resume { border-radius: 24px; }
.resume-art, .tile-ic, .letters button, .new-row .new-art, .all-row .new-art { border-radius: 10px; }
.full-art .art, .car-art .art { border-radius: 16px; }
.welcome, .login-page .card, .car-small { border-radius: 16px; }
.row, .frow, .sheet-item, .text, .form input, .full-next, .tool, .edit-bar, .off-tips { border-radius: 10px; }
/* 차량 모드 알림은 눌러지지 않게 (운전 중 화면을 누를 때 방해하지 않게) */
body.car-open > .ak-toast { pointer-events: none; }

/* ================= 공통 (휴대폰·PC) ================= */
/* 본문으로 건너뛰기: 키보드로 Tab을 처음 누르면 보인다 */
.skip { position: fixed; left: 8px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 700; }
.skip:focus { top: calc(var(--safe-t) + 8px); }
/* 키보드로 아래쪽 줄로 옮길 때 고정된 아래 막대(탭·작은 플레이어·재생 막대)에 가리지 않게 */
.view { scroll-padding-bottom: calc(var(--tabs-h) + var(--mini-h) + var(--safe-b) + 16px); }
.full { background-color: #0b0b0e; } /* 그라데이션이 꺼지는 고대비 모드에서도 뒤 화면이 비치지 않게 */
/* PC 표 칸·재생 막대·왼쪽 메뉴·대기열 창은 PC에서만 */
.list-head, .row .idx, .row .alb, .row .d-dur, .side, .bar, .qpanel { display: none; }
.keys-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 4px 8px 8px; align-items: center; }
.keys-list dt { margin: 0; } .keys-list dd { margin: 0; color: var(--dim); }
kbd { display: inline-block; min-width: 28px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--sunk); font: 600 13px/1.4 var(--font); text-align: center; }

/* 고대비 모드(윈도): 그라데이션·배경 막대가 사라지므로 테두리와 시스템 색으로 */
@media (forced-colors: active) {
  .full, .bar, .side, .qpanel { background: Canvas; }
  .mini-bar, .resume-bar, .car-bar, .off-prog { border: 1px solid CanvasText; }
  .mini-bar i, .resume-bar i, .car-bar i, .off-prog i { background: Highlight; forced-color-adjust: none; }
  .tabs a.on, .side-link.on, .side-pl.on, .seg-btn.on, .chip.on { outline: 2px solid Highlight; outline-offset: -2px; }
  .seek-range, .vol-range { forced-color-adjust: none; }
}

/* ================= PC (body.desk: 1024px 넘는 화면 + 마우스, common.js deskMq) ================= */
body.desk {
  --side-w: 248px; --bar-h: 88px; --panel-w: 0px; --gutter: clamp(24px, 3vw, 48px);
  --hover: color-mix(in srgb, var(--text) 6%, transparent);
  --press: color-mix(in srgb, var(--text) 10%, transparent);
}
@media (max-width: 1279px) { body.desk { --side-w: 76px; } }
@media (min-width: 1600px) { body.desk { --side-w: 280px; } }
/* 대기열 창이 열리면 어느 폭에서나 내용 칸을 창 폭만큼 줄인다 (예전: 1600px 미만은 창이 목록 오른쪽 ⋯·링크를 덮었음). 좁은 PC는 창을 조금 좁게 */
body.desk { --qpanel-w: 340px; }
@media (max-width: 1599px) { body.desk { --qpanel-w: 300px; } }
body.desk.panel-open { --panel-w: var(--qpanel-w); }
body.desk .view { scroll-padding-bottom: calc(var(--bar-h, 88px) + 16px); scrollbar-gutter: stable; }
body.desk .tabs, body.desk .mini { display: none !important; }
body.desk .view, body.desk.has-mini .view { margin: 0 var(--panel-w) 0 var(--side-w); padding-bottom: calc(var(--bar-h) + 48px); }
body.desk.has-mini .view { margin-bottom: var(--bar-h); padding-bottom: 48px; } /* 재생 막대가 있으면 내용 칸(과 그 스크롤 막대)은 막대 위까지만 */
body.desk .page { max-width: 1480px; padding-top: 28px; }
body.desk .page.detail { padding-top: 0; }
body.desk .offline-bar { margin-left: var(--side-w); }

/* ---- 왼쪽 메뉴 ---- */
body.desk .side:not([hidden]) { display: flex; }
.side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 30; flex-direction: column; gap: 2px; padding: 18px 12px 12px; background: var(--card); border-right: 1px solid var(--line); }
body.desk.has-mini .side { bottom: var(--bar-h); }
.side-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 12px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.side-brand .dot { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--dim); font-size: 15px; font-weight: 600; }
.side-link span, .side-pl b, .side-pl small, .side-me > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .side-link:hover, .side-pl:hover { background: var(--hover); color: var(--text); } }
.side-link.on { background: var(--sunk); color: var(--text); font-weight: 800; }
.side-link.on .ic { color: var(--accent); }
.side-h { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin: 16px 4px 4px 12px; font-size: 13px; font-weight: 700; color: var(--faint); }
.side-add { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--dim); }
@media (hover: hover) { .side-add:hover { background: var(--hover); color: var(--text); } }
.side-pls { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.side-pl { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: 10px; color: var(--text); }
.side-pl.on { background: var(--sunk); }
.side-pl > span { display: grid; min-width: 0; }
.side-pl b { font-size: 14px; font-weight: 600; }
.side-pl small { font-size: 13px; color: var(--faint); }
.side-empty { margin: 4px 12px; font-size: 13px; color: var(--faint); }
.side-foot { display: flex; align-items: center; gap: 4px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); }
.side-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px; border: 0; border-radius: 10px; background: none; font-weight: 600; text-align: left; color: var(--text); }
@media (hover: hover) { .side-me:hover { background: var(--hover); } }
.side-me .avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; font-size: 14px; }
@media (max-width: 1279px) {
  .side { padding: 16px 10px 10px; }
  .side-brand span, .side-link span, .side-h, .side-pl > span, .side-empty, .side-me > span:last-child { display: none; }
  .side-brand { justify-content: center; padding: 0 0 12px; }
  .side-link { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .side-pl { grid-template-columns: 1fr; justify-items: center; padding: 6px 0; }
  .side-pls { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .side-foot { flex-direction: column; }
  .side-me { justify-content: center; padding: 0; }
}

/* 홈 머리: 로고·계정은 왼쪽 메뉴에 있으니 인사만 크게 */
body.desk .home-head .wordmark, body.desk .home-actions { display: none; }
body.desk .home-head { padding: 4px 0 20px; }
body.desk .hello { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
body.desk :is(.car-home, .t-car) { display: none; }

/* ---- 재생 막대 ---- */
body.desk .bar:not([hidden]) { display: grid; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: var(--bar-h); grid-template-columns: minmax(220px, 1fr) minmax(360px, 640px) minmax(220px, 1fr); align-items: center; gap: 16px; padding: 0 16px; background: color-mix(in oklab, var(--np) 10%, var(--card)); border-top: 1px solid var(--line); transition: background-color .6s; }
.bar-now { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bar-open { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; padding: 4px 8px 4px 4px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--text); }
@media (hover: hover) { .bar-open:hover { background: var(--hover); } }
.bar-open .meta { min-width: 0; }
.bar-open .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-open .s { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-mid { display: grid; justify-items: center; gap: 0; }
.bar-ctl { display: flex; align-items: center; gap: 10px; }
.bar .ib { width: 38px; height: 38px; color: var(--dim); }
@media (hover: hover) { .bar .ib:hover { color: var(--text); background: var(--hover); } }
.bar .ib.on { color: var(--accent); }
.bar .b-play { width: 42px; height: 42px; background: var(--text); color: var(--bg); transition: transform .12s; }
@media (hover: hover) { .bar .b-play:hover { background: var(--text); color: var(--bg); transform: scale(1.06); } }
.bar .b-play .ic-play { margin-left: 2px; }
.bar.waiting .b-play { box-shadow: 0 0 0 3px var(--warn); }
.bar-seek { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.b-cur { text-align: right; }
.b-range-wrap { position: relative; }
.bar .seek-range, .vol-range { display: block; width: 100%; height: 20px; margin: 0; background: none; -webkit-appearance: none; appearance: none; --p: 0%; touch-action: none; cursor: pointer; }
.bar .seek-range::-webkit-slider-runnable-track, .vol-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), color-mix(in srgb, var(--text) 22%, transparent) var(--p)); }
.bar .seek-range::-moz-range-track, .vol-range::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), color-mix(in srgb, var(--text) 22%, transparent) var(--p)); }
.bar .seek-range:focus-visible::-webkit-slider-runnable-track, .vol-range:focus-visible::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), color-mix(in srgb, var(--text) 22%, transparent) var(--p)); }
.bar .seek-range::-webkit-slider-thumb, .vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--text); border: 0; opacity: 0; }
.bar .seek-range::-moz-range-thumb, .vol-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 0; opacity: 0; }
.bar .seek-range:focus-visible::-webkit-slider-thumb, .vol-range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.bar .seek-range:focus-visible::-moz-range-thumb, .vol-range:focus-visible::-moz-range-thumb { opacity: 1; }
/* 마우스를 올렸을 때만 (손가락으로 누른 뒤 남지 않게, UX.md 7) */
@media (hover: hover) {
  .bar .seek-range:hover::-webkit-slider-runnable-track, .vol-range:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), color-mix(in srgb, var(--text) 22%, transparent) var(--p)); }
  .bar .seek-range:hover::-webkit-slider-thumb, .vol-range:hover::-webkit-slider-thumb { opacity: 1; }
  .bar .seek-range:hover::-moz-range-thumb, .vol-range:hover::-moz-range-thumb { opacity: 1; }
}
.b-tip { position: absolute; bottom: 22px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap; }
.bar-tools { justify-self: end; display: flex; align-items: center; gap: 2px; }
.b-vol { display: flex; align-items: center; gap: 2px; margin: 0 4px; }
.vol-range { width: 100px; }

/* ---- 대기열 창 (Q) ---- */
body.desk.panel-open .qpanel { display: flex; }
.qpanel { position: fixed; top: 0; right: 0; bottom: var(--bar-h); width: var(--qpanel-w, 340px); z-index: 52; flex-direction: column; background: var(--card); border-left: 1px solid var(--line); }
.qpanel-top { display: flex; align-items: center; gap: 4px; padding: 14px 8px 2px 4px; }
.qpanel-top .queue-head { flex: 1; }
.qpanel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 16px; }
.qpanel .row { min-height: 56px; }
@media (hover: hover) { .qpanel .row:hover { background: var(--hover); } }

/* ---- 지금 재생: 화면 전체가 아니라 본문 자리에 (재생 막대가 버튼을 맡음) ---- */
body.desk .full { inset: 0 var(--panel-w) var(--bar-h) var(--side-w); transform: none; opacity: 0; transition: opacity .25s var(--ease); justify-content: center; padding: 0 48px 24px; }
body.desk .full.on { opacity: 1; }
body.desk .full :is(.seek, .controls, .full-tools, .full-next) { display: none; }
body.desk .full-top { max-width: none; }
body.desk .full-art-wrap { flex: 0 1 auto; max-width: none; }
body.desk .full-art { width: min(100%, 58vh, 540px); }
body.desk .full-info { max-width: min(100%, 58vh, 540px); margin-top: 20px; }
body.desk .full-info .t { font-size: 30px; }

/* ---- 홈: 카드는 격자로, 바로 틀기 타일은 한 줄 4개 ---- */
body.desk .shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; overflow: visible; margin: 0; padding: 0; scroll-snap-type: none; }
body.desk .card, body.desk .again-card { width: auto; padding: 10px; margin: -10px; border-radius: 14px; transition: background-color .15s; }
body.desk .card:hover { background: var(--hover); }
body.desk .card .art, body.desk .new-card .new-art { width: 100% !important; height: auto !important; aspect-ratio: 1; }
body.desk .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1279px) { body.desk .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.desk .tile:hover { background: color-mix(in srgb, var(--text) 5%, var(--card)); }
body.desk .resume { grid-template-columns: 112px minmax(0, 1fr) 64px; padding: 16px; max-width: 880px; }
body.desk .resume-art { width: 112px !important; height: 112px !important; }
body.desk .resume:hover { filter: brightness(1.05); }
body.desk .welcome { max-width: 640px; }
body.desk .sec { margin-top: 40px; }
body.desk .sec-head h2 { font-size: 24px; }

/* ---- 상세 머리 (폴더·플레이리스트·가수·앨범) ---- */
body.desk .hero { grid-template-columns: 220px minmax(0, 1fr); justify-items: start; text-align: left; align-items: end; column-gap: 32px; padding: 20px 0 28px; }
body.desk .hero .art { width: 220px !important; height: 220px !important; grid-row: span 2; }
body.desk .hero h1 { font-size: clamp(32px, 3.4vw, 52px); line-height: 1.12; }
body.desk .hero-sub { font-size: 15px; }
body.desk .hero-actions { width: auto; max-width: none; }
body.desk .play-all, body.desk .shuffle-all { flex: none; padding: 0 28px; }
body.desk .topbar { padding-left: 8px; padding-right: 8px; }
body.desk .topbar-title { text-align: left; padding-right: 0; font-size: 18px; }

/* ---- 곡 표: 번호(마우스를 올리면 재생) · 표지 · 제목/가수 · 앨범 · 길이 · ⋯ ---- */
body.desk .view .list:not(.editing) > .row { grid-template-columns: 36px 48px minmax(0, 6fr) minmax(0, 4fr) 56px 44px; gap: 0 14px; min-height: 60px; padding: 6px 8px; border-radius: 10px; }
body.desk .view .list:not(.editing) > .row > .right { display: contents; }
body.desk .view .list:not(.editing) > .row:has(.num) { grid-template-columns: 36px 48px minmax(0, 6fr) minmax(0, 4fr) 56px 44px; }
body.desk .view .list:not(.editing) > .list-head { display: grid; grid-template-columns: 36px 48px minmax(0, 6fr) minmax(0, 4fr) 56px 44px; gap: 0 14px; align-items: center; min-height: 36px; padding: 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--faint); }
.list-head .lh-t { grid-column: span 2; }
.list-head .lh-idx { text-align: center; }
.list-head .lh-dur { justify-self: end; display: inline-flex; }
body.desk .view .row .idx { display: grid; place-items: center; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.idx-p, .idx-eq { display: none; }
body.desk .row:hover .idx-n, body.desk .row.now .idx-n { display: none; }
body.desk .row:hover .idx-p { display: grid; color: var(--text); }
body.desk .row.now:not(:hover) .idx-eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.idx-eq i { width: 3px; height: 14px; border-radius: 1px; background: var(--accent); transform-origin: bottom; transform: scaleY(.4); }
body.playing .row.now .idx-eq i { animation: eq .9s ease-in-out infinite; }
.idx-eq i:nth-child(2) { animation-delay: -.3s; } .idx-eq i:nth-child(3) { animation-delay: -.6s; }
body.desk .view .row .eq { display: none !important; }
body.desk .view .row .alb, body.desk .view .row .d-dur { display: block; font-size: 14px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desk .view .row .d-dur { text-align: right; font-variant-numeric: tabular-nums; }
body.desk .view .row .dur:not(.d-dur) { display: none; }
body.desk .row:hover { background: var(--hover); }
body.desk .row:active { background: var(--press); box-shadow: none; }
body.desk .row .more { opacity: .5; }
body.desk .row:is(:hover, :focus-within) .more { opacity: 1; }
body.desk .row.now .t { color: var(--accent); }
@media (max-width: 1279px) {
  body.desk .view .list:not(.editing) > :is(.row, .row:has(.num), .list-head) { grid-template-columns: 36px 48px minmax(0, 1fr) 56px 44px; }
  body.desk .view .row .alb, body.desk .view .list-head .lh-alb { display: none; }
}

/* ---- 보관함·찾기 ---- */
body.desk .search-bar { max-width: 720px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
body.desk .search-hint { max-width: 720px; }
@media (min-width: 1280px) { body.desk .folder-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }
body.desk .frow:hover, body.desk .chip:hover, body.desk .seg-btn:not(.on):hover { background: var(--hover); }
body.desk .sort-chips .chip:not(.on):hover { background: var(--hover); }

/* ---- 메뉴·창: 누른 자리의 작은 메뉴(.pop) 또는 화면 가운데 창 ---- */
body.desk .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(480px, 92vw); max-height: min(80vh, 720px); max-height: min(80dvh, 720px); margin: 0; padding: 12px; border-radius: 16px; transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: transform .18s var(--ease), opacity .18s; }
body.desk .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
body.desk .sheet.tall { height: auto; max-height: min(84vh, 760px); max-height: min(84dvh, 760px); }
body.desk .sheet .grabber { display: none; }
body.desk .sheet-top { top: -12px; margin: -12px -12px 0; padding: 12px 12px 0; min-height: 0; border-radius: 16px 16px 0 0; touch-action: auto; }
body.desk .sheet.pop { left: var(--x); top: var(--y); width: 300px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); transform: scale(.97); transform-origin: top right; }
body.desk .sheet.pop.on { transform: none; }
body.desk .sheet.pop .sheet-close { display: none; }
body.desk .sheet.pop .sheet-track { padding: 6px 8px 10px; }
body.desk .sheet.pop .sheet-item { min-height: 40px; padding: 4px 10px; gap: 12px; }
body.desk .sheet.pop .sheet-item .l { font-size: 15px; }
body.desk .sheet-item:hover { background: var(--hover); }
body.desk .backdrop:has(+ .sheet.pop) { background: transparent; }
body.desk .backdrop { background: rgba(0, 0, 0, .35); }

/* ---- 알림 자리: 본문 가운데, 재생 막대 위 ---- */
body.desk.main-page, body.desk.main-page.has-mini, body.desk.main-page.full-open { --ak-rail-l: var(--side-w); --ak-rail-r: var(--panel-w); --ak-toast-b: calc(var(--bar-h) - 4px); }

/* ---- 마우스를 올렸을 때 ---- */
body.desk .ib:hover { background: var(--hover); color: var(--text); }
body.desk .btn:hover { filter: brightness(1.06); }
body.desk .more-link:hover, body.desk .full-ctx:hover { color: var(--text); }
body.desk .bar-open:active { background: var(--press); }

/* ---- 관리 화면이 열려도 재생 막대는 보이게 ---- */
body.desk.has-mini .admin-layer { bottom: var(--bar-h); }
body.desk.admin-open .bar { z-index: 76; }

/* ---- 스크롤 막대 ---- */
body.desk :is(.view, .side-pls, .qpanel-body, .sheet) { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 24%, transparent) transparent; }

/* ================= 모바일 3차 (2026-11-09): 시각 다듬기·움직임·쓰기 편함 ================= */
/* 표지 테두리: 밝은 표지가 밝은 바탕에 녹지 않게 (img 안쪽 그림자는 그려지지 않아 ::after로) */
.art img { box-shadow: none; }
.art:not(.ph)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
@media (prefers-color-scheme: dark) { .art:not(.ph)::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); } }
/* 다시 듣기 카드: 표지가 카드 폭을 채우고 재생 단추가 표지 안에 */
.again-card .art { width: 100% !important; height: auto !important; aspect-ratio: 1; }
.card .again-play { right: 8px; bottom: 8px; }
/* 상세 머리: 큰 표지 + 표지 색이 위에서 은은하게 */
.hero { position: relative; isolation: isolate; --tint: var(--sunk); gap: 16px; padding: 16px 0 12px; }
.hero::before { content: ''; position: absolute; z-index: -1; top: calc(-1 * (var(--safe-t) + 64px)); bottom: 0; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
  background: linear-gradient(180deg, color-mix(in oklab, var(--tint) 46%, var(--bg)) 0%, color-mix(in oklab, var(--tint) 16%, var(--bg)) 55%, var(--bg) 100%); pointer-events: none; }
.hero > .art { width: min(58vw, 232px) !important; height: min(58vw, 232px) !important; border-radius: 12px; }
.hero > .art.round { border-radius: 50%; }
/* 작은 플레이어: 진행 선은 카드 아래 끝을 꽉 채우고, 그림자는 조금 더 깊게. 위·옆으로 밀 수 있게 터치는 플레이어가 받음 */
.mini { touch-action: none; border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .22), inset 0 0 0 1px var(--line); }
.mini-bar { left: 0; right: 0; bottom: 0; height: 2px; border-radius: 0; background: color-mix(in srgb, var(--text) 10%, transparent); }
.mini-bar i { opacity: .85; }
.mini-open .art { border-radius: 8px; }
.mini-open:active { opacity: 1; transform: scale(.98); }
.mini .like + .ib, .mini .like-slot + .ib { margin-left: 2px; }
/* 탭: 켜진 탭에 알약 모양 바탕 (색만으로 구별하지 않게) */
.tabs a { position: relative; }
.tabs a .ic { position: relative; z-index: 1; }
.tabs a.on::before { content: ''; position: absolute; top: 6px; left: 50%; width: 56px; height: 30px; margin-left: -28px; border-radius: 999px; background: var(--accent-soft); }
.tabs a.on { font-weight: 700; }
/* 홈 리듬: 구획 사이는 넓게, 타일은 앞 선반과 떨어지게 */
.sec { margin-top: 36px; }
.sec-head { margin-bottom: 10px; }
.tiles { margin-top: 24px; }
.again + .tiles, .sec + .tiles { margin-top: 28px; }
/* 홈 머리: 계정 동그라미를 가볍게 */
.avatar { position: relative; isolation: isolate; background: none; color: var(--accent); font-size: 15px; text-transform: uppercase; }
.avatar::before { content: ''; position: absolute; inset: 5px; z-index: -1; border-radius: 50%; background: var(--accent-soft); }
.home-actions .ib { color: var(--text); }
.home-actions { gap: 0; margin-right: -6px; }
/* 이어 듣기: 아직 듣지 않은 곡은 빈 막대를 숨기고, 어두운 화면은 표지 색을 더 */
.resume-bar[data-p="0"] { visibility: hidden; }
.resume { border-radius: 16px; }
.resume-art { border-radius: 10px; }
@media (prefers-color-scheme: dark) { .resume { background: linear-gradient(120deg, color-mix(in oklab, var(--np) 40%, var(--card)), var(--card) 80%); } }
/* 둥글기 맞추기: 곡 표지 6, 카드 표지 10, 큰 표지 12, 카드 16, 시트 24 */
.new-row .new-art, .all-row .new-art { border-radius: 6px; }
/* 플레이리스트 머리: 받기는 둥근 아이콘 단추 (재생·셔플을 넓게) */
.hero-save { flex: none; width: 50px; min-height: 50px; padding: 0; border-radius: 50%; position: relative; }
.hero-save > :not(.ic) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* ux-ok: 부모 .hero-save가 relative라 문서를 늘리지 않음 */
.hero-actions:has(.hero-save) { flex-wrap: nowrap; }
@media (max-width: 420px) { .hero-actions:has(.hero-save) :is(.play-all, .shuffle-all) { padding: 0 12px; } }
/* 지금 재생: 제목·가수 대비, 간격 */
.full-info .t { font-weight: 800; }
.full-info .s { font-size: 18px; }
.seek { margin-top: 14px; }
.full-next { border-radius: 10px; min-height: 44px; }
.controls { margin: 14px 0 10px; }
.full-tools { margin-top: 8px; }
.controls .c-play { color: color-mix(in oklab, var(--np) 60%, #000); }
/* 곡 줄: 부제는 한 단계 조용하게, ⋯는 뒤로 */
.row .t { line-height: 1.3; }
.row .s { color: var(--faint); line-height: 1.3; margin-top: 3px; }
.row .more { color: var(--control); }
.sec-head h2 .cnt { color: var(--faint); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.grabber { background: var(--control); opacity: .5; }
.search-box:focus-within { border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); }

/* ---- 움직임 ---- */
/* 표지를 옆으로 끄는 동안은 손가락을 바로 따라오게 */
.full-art.dragging { transition: none; }
/* 표지 그림은 곡이 바뀔 때 새로 끼운다. 손가락이 그림에 닿아 있다가 그림이 빠지면 터치가 끊겨 끌던 화면이 그대로 멈추므로, 터치는 늘 남아 있는 .full-art가 받는다 */
body:not(.desk) .full-art > * { pointer-events: none; }
.full-art { position: relative; }
/* 줄을 누른 표시: 스크롤을 시작할 때 번쩍이지 않게 살짝 늦게 켜고 천천히 끔 */
.row, .frow { transition: background-color .18s; }
.row:active, .frow:active { transition-delay: 70ms; transition-duration: 0s; }
.card, .tile, .btn, .resume { transition: transform .18s var(--ease); }
/* 곡이 바뀔 때 지금 재생 바탕색이 서서히 */
html:has(body.full-open) { transition: --np .6s ease; }
.full { transition: transform .32s var(--ease); }
/* 화면 바꿈 (View Transitions): 아래 탭·작은 플레이어는 그대로, 본문만 살짝 밀려 들어옴 */
.tabs { view-transition-name: tabs; }
.mini { view-transition-name: mini; }
::view-transition-group(tabs), ::view-transition-group(mini) { animation: none; }
::view-transition-old(root) { animation: 90ms ease-in both vt-out; }
::view-transition-new(root) { animation: 220ms cubic-bezier(.2, .8, .2, 1) 40ms both vt-in; }
html[data-nav="pop"]::view-transition-new(root) { animation-name: vt-in-back; }
html[data-nav="tab"]::view-transition-new(root) { animation-name: vt-fade; animation-duration: 150ms; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-24px); } }
@keyframes vt-fade { from { opacity: 0; } }
/* 좋아요 누르면 고리가 퍼짐 */
.like { position: relative; }
.like.pop::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--accent); animation: like-ring .45s ease-out forwards; pointer-events: none; }
@keyframes like-ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
/* 빈 줄 모양은 빨리 불러오면 보이지 않게 조금 늦게 */
.skeleton { animation: vt-fade .2s .15s both; }
.controls .c-shuffle, .controls .c-repeat { transition: color .2s, background-color .2s; }

/* ---- 쓰기 편함 ---- */
/* 대기열 창의 닫기: 목록 끝까지 내리지 않아도 보이게 */
.sheet.tall .sheet-close { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -12px 16px var(--card); background: linear-gradient(var(--sunk), var(--sunk)), var(--card); } /* --sunk가 반투명이라 뒤 곡 이름이 비쳤음 */
/* 플레이리스트 편집: 손잡이 44px, 완료 막대는 위에 붙어 있게 */
.grip { width: 44px; }
.edit-bar { position: sticky; top: calc(var(--safe-t) + 60px); z-index: 10; }
.pl-tools { display: flex; gap: 8px; margin: 4px 0 6px; }
.pl-tools .btn { flex: 1; }
/* 다시 듣기 카드: 누른 뒤 받는 동안 */
.card[aria-busy="true"] .again-play { animation: breathe 1s ease-in-out infinite; }
/* 가수 글자 줄: 위에 붙어 있게 */
.letters { position: sticky; top: calc(var(--safe-t) + 60px); z-index: 14; padding-top: 6px; padding-bottom: 6px; background: var(--bg); }
/* 글자 크게: 빠졌던 곳 */
html.big .mini-open .s, html.big .resume-meta .s, html.big .resume-meta .ctx, html.big .queue-label, html.big .full-ctx .kind { font-size: 16px; }
html.big :where(.ak-sheet, .ak-dialog) { font-size: 17px; }
/* 큰 글씨 안내 카드 */
.hint-card { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 14px 8px 14px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.hint-card p { flex: 1; margin: 0; font-size: 15px; }
.hint-card b { display: block; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* 아이폰 홈 화면 앱(iOS 26~): 화면 맨 위에 고정된 띠가 없으면 아이폰이 머리줄 위에 뿌연 흐림을 덮는다.
   보이지 않는 고정 띠(.ios-edge, 각 HTML의 body 첫 줄)를 두면 흐림 대신 이 배경색으로 상태 표시줄 자리를 칠한다.
   글자 모양으로만 칠해서(background-clip: text) 실제로는 아무것도 그리지 않고, 누를 수도 없다 (2026-11-09) */
.ios-edge {
  position: fixed; top: 0; left: 0; right: 0; height: 11px; z-index: 2147483647; pointer-events: none;
  background-color: var(--bg); -webkit-background-clip: text; background-clip: text;
}
body.full-open .ios-edge { background-color: color-mix(in oklab, var(--np) 70%, #000); } /* 전체 재생 화면 맨 위 색 */
body.ak .ios-edge { background-color: var(--ak-card); }

/* ---------- 휴대폰 가로 화면: 목록 (2026-11-10) ----------
   아래 메뉴(60px)를 왼쪽 세로 막대로 → 높이 390px 가운데 목록이 쓰는 곳이 절반에서 3/4로. 노치 쪽 여백(safe-area)은 막대가 가져감
   PC 화면(body.desk)은 높이 560px 넘을 때만이라 이 조건과 겹치지 않는다.
   폭 560px 이상일 때만: 세로로 든 작은 휴대폰에서 키보드가 올라와 화면이 납작해진 것을 가로로 잘못 보지 않게 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  :root { --tabs-h: 0px; --mini-h: 56px; --rail-w: calc(76px + var(--sa-l)); }
  /* .main-page를 붙인다: 로그인 화면의 '로그인/가입 신청' 탭도 id가 tabs라 세로로 서 버렸음 */
  .main-page #tabs { top: 0; right: auto; width: var(--rail-w); height: auto; flex-direction: column; justify-content: center; gap: 6px;
    padding: var(--safe-t) 0 var(--safe-b) var(--sa-l); box-shadow: 1px 0 0 var(--line); }
  .main-page #tabs a { flex: none; height: 64px; }
  .view, .offline-bar { margin-left: var(--rail-w); }
  .page { padding-left: var(--gutter); }
  .mini { left: calc(var(--rail-w) + 8px); bottom: calc(var(--safe-b) + 8px); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .welcome { grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: center; }
  .welcome b, .welcome p { grid-column: 1; }
  .welcome p { margin: 0; }
  .welcome-btns { grid-column: 2; grid-row: 1 / 3; }
  .welcome-btns .btn { flex: none; padding: 0 20px; }
  /* --- 아래는 2026-11-10 가로 점검에서 더한 것 --- */
  /* 폭 제한(760px)을 풀어 넓은 휴대폰에서도 목록·작은 플레이어가 끝까지 (상세 머리 바탕색 옆에 4px 틈이 보였음) */
  .page, .mini { max-width: none; }
  /* 상세 화면(폴더·앨범·가수·플레이리스트): 머리가 화면을 다 차지해 곡이 한 줄도 안 보였음 → 표지를 줄이고 위 줄을 낮춰 첫 화면에 곡이 보이게 */
  .topbar { padding-top: calc(var(--safe-t) + 2px); padding-bottom: 2px; }
  .hero { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: end; column-gap: 20px; row-gap: 10px; padding: 2px 0 8px; }
  .hero > .art { width: 128px !important; height: 128px !important; grid-row: span 2; }
  .hero h1, html.big .hero h1 { font-size: 24px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero .play-all, .hero .shuffle-all, .hero-more, .btn.radio-btn, .hero-save { min-height: 46px; }
  .hero + .list, .hero + .list-actions { margin-top: 8px; }
  .edit-bar { top: calc(var(--safe-t) + 50px); }
  .empty { padding-top: 12px; padding-bottom: 24px; }
  .empty-ic { width: 56px; height: 56px; margin-bottom: 2px; }
  /* 아일랜드가 오른쪽일 때: 위 줄 바탕과 머리 바탕색이 오른쪽 끝까지 닿게 (여백만큼 덜 칠해져 띠가 보였음) */
  .topbar { margin-right: calc(-1 * max(var(--gutter), var(--sa-r))); padding-right: max(8px, var(--sa-r)); }
  .hero::before { right: calc(-1 * max(var(--gutter), var(--sa-r))); }
  /* 홈: 인사말을 로고 옆으로, 사이 여백을 줄여 '모음'이 빨리 보이게 */
  .home-head { padding: 0 0 8px; }
  .home-head > div:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .hello { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .resume { margin-bottom: 10px; }
  .page.home .tiles { margin-top: 10px; }
  body:not(.desk) .tiles > .tile:last-child:nth-child(odd) { grid-column: auto; } /* 세 개여도 한 줄에 (마지막을 한 줄로 늘리면 앞의 둘이 좁아졌음) */
  .page.home .sec { margin-top: 22px; }
  /* 보관함: '휴대폰에 받기'를 제목 옆으로 올려 한 줄을 아낌 */
  .page.library { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: center; }
  .page.library > * { grid-column: 1 / -1; min-width: 0; }
  .page.library > .lib-head { grid-column: 1; }
  .page.library > .lib-head h1 { margin: 2px 0 4px; }
  .page.library > .offline-row { grid-column: 2; grid-row: 1; justify-self: end; width: auto; max-width: 100%; min-height: 52px; margin: 0; padding: 2px 0; }
  .library .offline-row .new-art { width: 44px; height: 44px; }
  .library .offline-row .s { white-space: nowrap; }
  /* 시트(아래에서 올라오는 창): 낮은 화면을 거의 다 쓰고, 메뉴는 두 칸으로 → 곡 메뉴·잠자기가 스크롤 없이 한눈에 */
  .sheet { max-width: 640px; max-height: calc(100vh - var(--safe-t) - 12px); max-height: calc(100dvh - var(--safe-t) - 12px); }
  .sheet.tall { height: calc(100vh - var(--safe-t) - 12px); height: calc(100dvh - var(--safe-t) - 12px); }
  .sheet-items { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .sheet-item { min-height: 50px; }
  .sheet-track { padding-bottom: 8px; }
  /* 알림 띠: 목록에서는 세로 메뉴를 뺀 가운데, 재생 화면에서는 표지 아래쪽 (다음 곡·버튼을 가리지 않게) */
  /* 공통 부품(kit)의 아래 알림이 세로 메뉴를 피하게 메뉴 폭을 알려 준다 (kit README '가로 모드'. 안전 영역은 kit이 따로 더한다) */
  body.main-page:not(.full-open):not(.car-open):not(.admin-open) { --ak-rail-l: 76px; }
  body.main-page.has-mini { --ak-toast-b: calc(var(--mini-h) + 8px); } /* 작은 플레이어를 가리지 않게 그 위에 */
  body.main-page.full-open { --ak-toast-b: 42px; }
  body.full-open:not(.car-open) > .ak-toast { left: calc(max(24px, var(--sa-l)) + (100vw - max(24px, var(--sa-l)) - max(24px, var(--sa-r)) - 32px) * .21); right: auto; margin: 0; transform: translateX(-50%); max-width: 38vw; }
  /* 관리 화면이 덮였을 때는 세로 메뉴가 없으니 작은 플레이어도 왼쪽 끝부터 */
  body.admin-open .mini { left: max(8px, var(--sa-l)); }
  /* 로그인·가입: 왼쪽에 로고와 설명, 오른쪽에 입력 카드 → 로그인은 스크롤 없이 한 화면에 */
  .login-page main { display: grid; grid-template-columns: minmax(0, 332px) minmax(300px, 400px); justify-content: center; gap: 28px; align-items: start; padding: 16px max(16px, var(--sa-r)) calc(16px + var(--safe-b)) max(16px, var(--sa-l)); }
  .login-page main > .login-head, .login-page main > .card { width: auto; margin-left: 0; margin-right: 0; }
  .login-page main > .card { margin-top: auto; margin-bottom: auto; }
  .login-page .login-head { margin: clamp(0px, calc(50vh - 130px), 90px) 0 0; position: sticky; top: 16px; } /* 가입 양식이 길어 스크롤해도 로고는 제자리에 */
  .login-page .tabs button { min-height: 44px; }
  /* 작은 글 단추는 보이는 크기는 그대로 두고 누르는 곳만 44px로 */
  .un-all { position: relative; }
  .un-all::before { content: ''; position: absolute; inset: -8px -6px; }
  .full .full-info .s { min-height: 44px; margin: -4px 0; padding: 6px 0; } /* 자리는 36px 그대로, 누르는 곳만 위아래 4px씩 넓힘 */
}
/* 넓은 휴대폰 가로(아이폰 12~, 프로 맥스): 보관함의 플레이리스트·가수·폴더 줄을 두 칸으로 (오른쪽 절반이 비어 있었음) */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 800px) {
  .lib-body, .folder-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .lib-body > :not(.frow) { grid-column: 1 / -1; }
}
@keyframes drift { from { translate: -8px -6px; } to { translate: 8px 6px; } }
@media (prefers-reduced-motion: reduce) { .full.ambient .full-art-wrap, .full.ambient .full-info { animation: none; } }
