:root {
  --bg: #08111c;
  --panel: #0f1b2b;
  --line: #1e334d;
  --text: #f4f7fb;
  --muted: #8aa0b8;
  --accent: #00c8e0;
  --accent-2: #3aa0ff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; min-height: 100dvh; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #12324a 0%, var(--bg) 45%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
body.np-open { overflow: hidden; }

.app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  padding-top: calc(18px + var(--safe-top));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 28, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.menu-btn { display: none; }
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  white-space: nowrap;
}
.whoami { color: var(--muted); font-size: 13px; }
.nav-link, .nav-btn {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.nav-btn.danger { border-color: #6b2b2b; color: #ffb4b4; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
button.brand { cursor: pointer; }
button.brand:hover .name { color: var(--accent); }
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018; font-weight: 800;
}
.name { font-weight: 800; letter-spacing: 0.02em; font-size: 20px; }

.search { display: flex; flex: 1; gap: 8px; align-items: center; }
.search-mode {
  display: flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.search-mode-btn {
  height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.search-mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
}
.search input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 0 18px;
  outline: none;
}
.search input:focus { border-color: var(--accent); }
.search > button {
  height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-weight: 700;
  cursor: pointer;
}

main { padding: 28px; padding-bottom: 120px; max-width: 1100px; width: 100%; margin: 0 auto; }
body.picking main { padding-bottom: 180px; }
.heading h1 { margin: 0 0 6px; font-size: 28px; }
.heading p { margin: 0 0 18px; color: var(--muted); }
.chart-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}
.chart-pager[hidden] { display: none; }
.chart-pager button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chart-pager button:hover { color: var(--text); border-color: var(--accent); }
.chart-pager button.active {
  color: #041018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.status { color: var(--muted); margin-bottom: 12px; min-height: 1.2em; }

.list { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: 48px 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  background: transparent;
}
.row-actions { display: flex; align-items: center; gap: 10px; }
.row:hover, .row.active { background: rgba(0, 200, 224, 0.08); }
.row.checked {
  background: rgba(0, 200, 224, 0.18);
  box-shadow: inset 3px 0 0 var(--accent);
}
.num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.cover {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #123;
}
.meta { min-width: 0; }
.meta .title {
  font-weight: 700;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta .sub { color: var(--muted); font-size: 13px; }
.meta-link {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
}
.meta-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.meta-sep { color: var(--muted); }
.play-mini {
  opacity: 0;
  border: 0;
  background: var(--accent);
  color: #041018;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
}
.row:hover .play-mini, .row.active .play-mini { opacity: 1; }
.row-more { display: none; }
.extract-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mv-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mv-btn:hover { border-color: var(--accent); }
.radio-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.radio-btn:hover { color: var(--accent); border-color: var(--accent); }
.radio-btn-lg {
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
}
.mv-box { width: min(720px, 94vw); }
.mv-player {
  width: 100%;
  max-height: 42vh;
  background: #000;
  border-radius: 12px;
  margin: 8px 0 14px;
}
.mv-url-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.mv-url {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}
.mv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 36vh;
  overflow: auto;
}
.mv-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
}
.mv-item:hover, .mv-item.active { background: rgba(0, 200, 224, 0.08); border-color: var(--line); }
.mv-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #123;
}
.mv-item-title { font-weight: 700; margin-bottom: 4px; }
.mv-item-sub { color: var(--muted); font-size: 12px; }
.mv-item-play {
  border: 0;
  background: var(--accent);
  color: #041018;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 700;
  pointer-events: none;
}
.extract-btn-lg {
  display: block;
  margin: 12px auto 0;
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
}
.np-tools {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.np-tools .extract-btn-lg,
.np-tools .radio-btn-lg { margin: 0; }
.extract-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.55);
  padding: 20px;
}
.extract-modal[hidden] { display: none; }
.extract-box {
  width: min(92vw, 720px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.extract-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.extract-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.extract-title {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.extract-box textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #08111c;
  color: var(--accent);
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
}
.tab-bar { display: none; }
.pick-bar {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(12, 24, 38, 0.98);
  border-top: 1px solid var(--line);
}
.pick-bar[hidden] { display: none; }
.pick-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  padding-right: 4px;
}
.pick-bar button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.pick-bar #pick-play {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
}
.pick-bar #pick-clear { color: var(--muted); }

.player {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr 2fr;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  background: rgba(10, 20, 32, 0.96);
  border-top: 1px solid var(--line);
  cursor: pointer;
  z-index: 20;
}
.now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.now-cover {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #123;
  flex: 0 0 56px;
}
.now-meta { min-width: 0; }
.now-title, .now-artist, .now-lyric { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-title { font-weight: 700; }
.now-artist { color: var(--muted); font-size: 13px; margin-top: 4px; }
.now-lyric {
  color: var(--accent);
  font-size: 12px;
  margin-top: 3px;
  min-height: 1em;
}
.controls { display: flex; justify-content: center; gap: 10px; }
.controls button {
  border: 0; background: transparent; color: var(--text);
  font-size: 18px; cursor: pointer; width: 44px; height: 44px;
}
.controls .play {
  background: var(--text); color: #08111c; border-radius: 50%; font-size: 16px;
}
.controls .shuffle-btn {
  width: auto;
  min-width: 44px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.controls .shuffle-btn.on {
  color: var(--accent);
}
.controls .karaoke-btn.on {
  color: #ff9f43;
}
.seek { display: flex; align-items: center; gap: 10px; }
.seek span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; width: 40px; }
.seek input { flex: 1; accent-color: var(--accent); cursor: pointer; }
audio { display: none; }

.now-playing {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  background: #061018;
  overscroll-behavior: none;
  pointer-events: none;
  transform: translate3d(0, 110%, 0);
  opacity: 0;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.now-playing.open {
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}
.now-playing.open.np-settled {
  transform: none;
}
.np-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(48px) saturate(1.2);
  transform: scale(1.15);
}
.np-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,10,18,0.55) 0%, rgba(6,10,18,0.78) 42%, rgba(6,10,18,0.94) 100%);
}
.np-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 0;
}
.np-close {
  width: 48px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.np-bar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.np-lyrics-toggle {
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.np-queue-toggle { display: none; }
.now-playing.queue-open .np-queue-toggle {
  background: var(--accent);
  color: #041018;
  border-color: transparent;
}
.now-playing.lyrics-full .np-lyrics-toggle {
  background: var(--accent);
  color: #041018;
  border-color: transparent;
}
.np-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 8px 16px 0 24px;
}
.np-left {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.np-cover {
  width: min(72vw, 300px);
  height: min(72vw, 300px);
  border-radius: 18px;
  object-fit: cover;
  background: #111;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  transform-origin: top left;
  will-change: transform;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease, width 0.35s ease, height 0.35s ease, margin 0.35s ease;
}
.np-info {
  width: min(92vw, 560px);
  text-align: center;
  margin: 22px 0 8px;
  transition: opacity 0.25s ease, max-height 0.35s ease, margin 0.35s ease;
}
.np-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.np-artist {
  margin-top: 6px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
.np-lyrics {
  width: min(92vw, 640px);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  padding: 12px 8px 28px;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  scroll-behavior: auto;
  transition: width 0.35s ease, padding 0.35s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.np-lyrics::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.lyric-line {
  padding: 9px 12px;
  color: rgba(255,255,255,0.28);
  font-size: 17px;
  line-height: 1.45;
  transition: color 0.18s ease, font-size 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.lyric-line.near {
  color: rgba(255,255,255,0.55);
}
.lyric-line.active {
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  transform: scale(1.03);
}

.now-playing.lyrics-full .np-cover {
  width: 0;
  height: 0;
  opacity: 0;
  margin: 0;
  box-shadow: none;
  pointer-events: none;
}
.now-playing.lyrics-full .np-info {
  max-height: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}
.now-playing.lyrics-full .np-stage {
  padding: 0;
}
.now-playing.lyrics-full .np-lyrics {
  width: 100%;
  padding: 38vh 8vw;
  mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
}
.np-queue {
  display: flex;
  flex-direction: column;
  width: min(360px, 34vw);
  flex-shrink: 0;
  min-height: 0;
  margin: 0 0 8px 12px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: rgba(6, 12, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}
.now-playing.lyrics-full .np-queue {
  display: none;
}
.np-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 8px 12px;
}
.np-queue-head strong {
  font-size: 14px;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.np-queue-head span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}
.np-queue-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.np-queue-tool-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.np-queue-tool-btn:hover { border-color: rgba(255, 255, 255, 0.4); }
.np-queue-tool-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #041018;
}
.np-queue-tool-btn.danger {
  border-color: rgba(255, 100, 100, 0.4);
  color: #ffb4b4;
}
.np-queue-tool-btn.danger:hover { border-color: #ff8080; }
.np-queue-tool-btn[hidden] { display: none; }
.np-queue-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}
.np-queue-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.np-queue-item:has(.np-queue-check) {
  grid-template-columns: 20px 44px 1fr;
}
.np-queue-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: transparent;
  flex-shrink: 0;
}
.np-queue-check.on {
  background: var(--accent);
  border-color: transparent;
  color: #041018;
}
.np-queue-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #123;
}
.np-queue-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.np-queue-item.active {
  background: rgba(0, 200, 224, 0.16);
}
.np-queue-item.checked {
  background: rgba(0, 200, 224, 0.1);
}
.np-queue-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-queue-artist {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-queue-empty {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  padding: 18px 8px;
}
.now-playing.lyrics-full .lyric-line {
  padding: 16px 12px;
  font-size: clamp(20px, 4.2vw, 32px);
  line-height: 1.5;
}
.now-playing.lyrics-full .lyric-line.active {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 800;
  transform: scale(1.02);
}
.lyric-empty {
  color: rgba(255,255,255,0.4);
  padding: 40px 0;
}
.np-dock {
  position: relative;
  z-index: 2;
  padding: 8px 24px calc(18px + env(safe-area-inset-bottom));
}
.np-controls { margin-top: 6px; }
.np-controls .play { width: 58px; height: 58px; font-size: 20px; }

@media (max-width: 900px) {
  .top {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    padding-top: calc(10px + var(--safe-top));
  }
  .brand { min-width: 0; }
  .name { font-size: 17px; }
  .search { display: none; min-width: 0; flex-wrap: wrap; }
  body.tab-search .search {
    display: flex;
    grid-column: 1 / -1;
  }
  .search-mode { width: 100%; }
  .search-mode-btn { flex: 1; }
  .search input { height: 40px; padding: 0 12px; font-size: 16px; }
  .search > button { height: 40px; padding: 0 12px; font-size: 13px; }
  .menu-btn,
  .account { display: none; }

  main {
    padding: 16px 14px;
    padding-bottom: calc(188px + var(--safe-bottom));
  }
  body.picking main {
    padding-bottom: calc(252px + var(--safe-bottom));
  }
  .heading h1 { font-size: 22px; }
  .heading p { margin-bottom: 12px; font-size: 13px; }

  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "now controls"
      "seek seek";
    gap: 6px 8px;
    padding: 8px 12px;
  }
  .pick-bar {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    padding-bottom: 8px;
  }
  .pick-bar span {
    grid-column: 1 / -1;
  }
  .player .now { grid-area: now; }
  .player .controls { grid-area: controls; justify-content: flex-end; }
  .player .seek { grid-area: seek; }
  .now-cover { width: 44px; height: 44px; flex-basis: 44px; border-radius: 8px; }
  .now-lyric { display: none; }
  .now-artist { margin-top: 2px; font-size: 12px; }
  .player .karaoke-btn,
  .player .shuffle-btn { display: none; }
  .controls { gap: 2px; }
  .controls button { width: 40px; height: 40px; }
  .controls .play { width: 42px; height: 42px; }
  .seek span { width: 34px; font-size: 11px; }

  .row {
    grid-template-columns: 28px 48px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 6px;
  }
  .meta-link {
    pointer-events: none;
    text-decoration: none;
    cursor: inherit;
  }
  .cover { width: 48px; height: 48px; }
  .play-mini { display: none; }
  .row-actions { gap: 4px; }
  .row-actions .mv-btn,
  .row-actions .radio-btn,
  .row-actions .extract-btn,
  .row-actions .queue-btn,
  .row-actions .add-btn,
  .row-actions .remove-btn { display: none; }
  .row-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
  }
  .pl-actions { flex-wrap: wrap; }

  .np-bar { padding: 4px 10px 0; padding-top: max(4px, var(--safe-top)); }
  .np-queue-toggle { display: inline-flex; align-items: center; }
  .np-stage {
    flex-direction: column;
    padding: 4px 12px 0;
  }
  .np-cover {
    width: min(58vw, 240px);
    height: min(58vw, 240px);
  }
  .np-info { margin: 12px 0 4px; }
  .np-title { font-size: 18px; }
  .np-lyrics { padding: 8px 4px 12px; width: 100%; }
  .np-queue {
    display: none;
    position: absolute;
    inset: 52px 10px calc(148px + var(--safe-bottom)) 10px;
    width: auto;
    margin: 0;
    z-index: 6;
  }
  .now-playing.queue-open .np-queue { display: flex; }
  .now-playing.queue-open .np-left { visibility: hidden; }
  .now-playing.lyrics-full .np-queue { display: none; }
  .now-playing.lyrics-full .np-queue-toggle { display: none; }
  .now-playing.lyrics-full .np-lyrics { padding: 24vh 5vw; }
  .now-playing.lyrics-full .lyric-line { font-size: clamp(16px, 4.2vw, 24px); }
  .now-playing.lyrics-full .lyric-line.active { font-size: clamp(20px, 5.4vw, 32px); }
  .np-dock { padding: 4px 12px calc(12px + var(--safe-bottom)); }
  .np-tools { margin-top: 8px; flex-wrap: wrap; }
  .np-controls .play { width: 52px; height: 52px; }
  .np-controls .shuffle-btn { min-width: 40px; padding: 0 8px; font-size: 12px; }
  .sheet-actions.sheet-play { grid-template-columns: 1fr 1fr; }

  .extract-modal { padding: 12px; align-items: end; place-items: end center; }
  .extract-box, .mv-box, .pick-box {
    width: 100%;
    max-height: min(88dvh, 92vh);
    overflow: auto;
    padding-bottom: calc(16px + var(--safe-bottom));
  }
  .extract-box textarea { min-height: 120px; font-size: 16px; }
  .mv-player { max-height: 32vh; }
  .drawer { align-items: stretch; justify-content: stretch; }
  .drawer-panel {
    width: 100%;
    height: auto;
    max-height: 86dvh;
    margin-top: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(18px + var(--safe-bottom));
  }
  .tab-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
    background: rgba(8, 17, 28, 0.98);
    padding: 4px 4px calc(6px + var(--safe-bottom));
  }
  body.np-open .tab-bar { display: none; }
  .tab-item {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }
  .tab-item.active { color: var(--accent); }
  .tab-ico { font-size: 18px; line-height: 1; font-weight: 400; }
  .toast { bottom: calc(168px + var(--safe-bottom)); max-width: calc(100vw - 24px); }
  .auth-body { padding: 20px 16px; padding-bottom: calc(24px + var(--safe-bottom)); }
  .auth-card { width: 100%; padding: 22px 18px; }
  .admin-main { padding: 16px 14px; }
  .user-row { flex-wrap: wrap; }
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100%;
  min-height: 100dvh;
  padding: 24px;
}
.auth-card {
  width: min(92vw, 420px);
  background: rgba(15, 27, 43, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}
.auth-brand { margin-bottom: 18px; }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-sub { margin: 0 0 18px; color: var(--muted); }
.auth-form, .admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form label, .admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.auth-form input, .admin-form input[type="text"], .admin-form input[type="password"] {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #08111c;
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
}
.auth-form button, .admin-form button[type="submit"] {
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-weight: 800;
  cursor: pointer;
}
.auth-error {
  color: #ff9d9d;
  font-size: 13px;
  min-height: 1.2em;
}
.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.admin-app { grid-template-rows: auto 1fr; }
.admin-main { padding: 28px; max-width: 900px; width: 100%; margin: 0 auto; }
.admin-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 27, 43, 0.7);
}
.admin-panel h2 { margin: 0 0 14px; font-size: 18px; }
.users { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(8, 17, 28, 0.7);
}
.user-name { font-weight: 700; }
.user-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.user-locked { color: var(--muted); font-size: 12px; }

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

.pl-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -6px 0 16px;
}
.pl-actions[hidden] { display: none; }
.pl-primary {
  border: 0;
  border-radius: 999px;
  height: 34px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.queue-btn, .add-btn, .remove-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.queue-btn:hover, .add-btn:hover { color: var(--accent); border-color: var(--accent); }
.remove-btn:hover { color: #ffb4b4; border-color: #6b2b2b; }

.drag-handle {
  width: 100%;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.row.dragging {
  background: rgba(0, 200, 224, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.list.reorderable .row { user-select: none; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: flex-end;
}
.drawer[hidden] { display: none; }
.drawer-panel {
  width: min(92vw, 380px);
  height: 100%;
  overflow-y: auto;
  padding: 18px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.pl-create { display: flex; gap: 8px; margin: 12px 0; }
.pl-create input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #08111c;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}
.pl-create input:focus { border-color: var(--accent); }
.pl-create button {
  border: 0;
  border-radius: 999px;
  height: 40px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-weight: 800;
  cursor: pointer;
}
.pl-items { display: flex; flex-direction: column; gap: 6px; }
.pl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(8, 17, 28, 0.7);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pl-item:hover, .pl-item.active { border-color: var(--accent); background: rgba(0, 200, 224, 0.08); }
.pl-item-name { font-weight: 700; }
.pl-item-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pl-empty { color: var(--muted); font-size: 13px; padding: 14px 4px; }
.pick-box { width: min(92vw, 420px); }
.pick-box .pl-items { max-height: 46vh; overflow-y: auto; }

.sheet-modal { align-items: end; place-items: end center; }
.sheet-box {
  width: min(100%, 520px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
}
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet-actions.sheet-play {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sheet-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.sheet-actions button,
.sheet-actions a {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #08111c;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  padding: 0 14px;
}
.sheet-actions.sheet-play button {
  text-align: center;
  padding: 0 6px;
  font-size: 13px;
  min-height: 52px;
}
.sheet-actions.sheet-account button,
.sheet-actions.sheet-account a {
  text-align: center;
  justify-content: center;
}
.sheet-actions button:hover,
.sheet-actions a:hover { border-color: var(--accent); color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(8, 17, 28, 0.96);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.hide { opacity: 0; transform: translate(-50%, 8px); }
