:root {
  --bg-shell: #000000;
  --bg: #121212;
  --bg-elev: #181818;
  --bg-hover: #1F1F1F;
  --bg-press: #2A2A2A;
  --line: #2C2C2C;
  --text: #FFFFFF;
  --text-sub: #B3B3B3;
  --text-faint: #9A9A9A;
  --accent: #7B6CFF;
  --accent-hover: #9588FF;
  --accent-press: #6356E0;
  --accent-soft: rgba(123, 108, 255, .18);
  --danger: #FF7A7A;
  --danger-bg: #3A1616;
  --radius: 8px;
  --radius-lg: 12px;
  --banner-h: 28px;
  --player-h: 88px;
  --sidebar-w: 252px;
  --now-w: 300px;
  --tabs-h: 56px;
  --mini-h: 64px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hero: #5B4EA8;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg-shell); color: var(--text); font: 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i20 { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i24 { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.fill { width: 20px; height: 20px; flex: none; fill: currentColor; stroke: none; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible, .slider:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible { outline: 2px solid #7B6CFF; outline-offset: 2px; }
.app { min-height: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.banner {
  height: var(--banner-h); flex: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #000; color: var(--text-sub);
  font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; z-index: 50;
  border-bottom: 1px solid #1A1A1A;
}
.banner .pill {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover);
  letter-spacing: .4px;
}
.shell {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--now-w);
  grid-template-rows: 1fr var(--player-h);
  gap: 8px;
  padding: 0 8px 8px;
}
.panel {
  background: var(--bg);
  border-radius: var(--radius);
  min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.sidebar { grid-column: 1; grid-row: 1; }
.main { grid-column: 2; grid-row: 1; overflow: auto; background: var(--bg); }
.now { grid-column: 3; grid-row: 1; }
.player { grid-column: 1 / -1; grid-row: 2; background: var(--bg-shell); border-radius: 0; display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; gap: 16px; padding: 0 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px; border-radius: 6px;
  color: var(--text-sub); font-weight: 600; text-align: left; width: 100%;
}
.nav-item:hover { color: var(--text); background: var(--bg-hover); }
.nav-item.is-active { color: var(--text); }
.nav-item.is-active svg { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.side-lib-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px; color: var(--text-sub); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px; color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text); background: var(--bg-press); }
.plist { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 12px; overflow: auto; }
.plist-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 6px 8px; border-radius: 6px; color: var(--text);
}
.plist-item:hover { background: var(--bg-hover); }
.plist-item.is-selected { background: var(--bg-press); }
.plist-item.is-archived { opacity: .55; }
.plist-item .meta { min-width: 0; flex: 1; }
.plist-item .name { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist-item .count { display: block; font-size: 12px; color: var(--text-faint); }
.side-section { padding: 8px 8px 16px; }
.side-section summary {
  list-style: none; cursor: pointer;
  color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 8px;
}
.side-section summary::-webkit-details-marker { display: none; }

.cover {
  flex: none; border-radius: 4px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.88); font-weight: 800;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  letter-spacing: -.02em; user-select: none;
}
.cover--xs { width: 40px; height: 40px; font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.cover--sm { width: 48px; height: 48px; font-size: 16px; }
.cover--hero { width: 192px; height: 192px; font-size: 72px; border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.cover--tile { width: 100%; aspect-ratio: 1; font-size: 42px; border-radius: 6px; }
.cover--player { width: 56px; height: 56px; font-size: 18px; }
.main-settings, .main-home, .main-search, .main-library { padding: 24px; }
.hero {
  position: relative;
  padding: 24px 24px 20px;
  display: flex; gap: 24px; align-items: flex-end;
  min-height: 240px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hero) 72%, #000) 0%, var(--bg) 100%);
}
.hero-meta { min-width: 0; flex: 1; padding-bottom: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }
.hero h1 { margin: 0 0 12px; font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -1.8px; }
.hero .sub { margin: 0 0 18px; color: var(--text-sub); font-size: 13px; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  font-weight: 700; font-size: 13px; white-space: nowrap;
}
.btn-play {
  width: 52px; height: 52px; padding: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px rgba(123,108,255,.28);
}
.btn-play:hover { background: var(--accent-hover); transform: scale(1.04); }
.btn-play svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px #3A3A3A; }
.btn-ghost:hover { background: var(--bg-hover); box-shadow: inset 0 0 0 1px #5A5A5A; }
.btn-soft { background: var(--bg-press); color: var(--text); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.table-wrap { padding: 8px 16px 24px; }
.thead, .trow {
  display: grid;
  grid-template-columns: 36px 16px 1fr 110px 56px 40px;
  align-items: center; gap: 8px;
  padding: 0 8px;
}
.thead {
  height: 36px; color: var(--text-faint); font-size: 12px; font-weight: 500;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.trow { height: 56px; border-radius: 6px; }
.trow:hover { background: var(--bg-hover); }
.trow.is-current { background: var(--bg-hover); }
.trow.is-current .t-title { color: var(--accent-hover); }
.trow.is-unavailable .t-title { color: var(--text-faint); text-decoration: line-through; text-decoration-color: #555; }
.trow.is-unavailable .t-artist, .trow.is-unavailable .t-num { color: var(--text-faint); }
.t-num { color: var(--text-faint); text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.t-title-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-info { min-width: 0; }
.t-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-artist { font-size: 13px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-time { color: var(--text-sub); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.handle { width: 16px; height: 40px; color: var(--text-faint); display: flex; align-items: center; justify-content: center; cursor: grab; border-radius: 4px; }
.handle:hover { color: var(--text); }
.trow .arch { color: var(--text-faint); width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.arch:hover { color: var(--text); background: var(--bg-press); }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; justify-self: start;
}
.badge-sc { background: #2C2418; color: #E8C48A; }
.badge-yt { background: #1C242C; color: #C5D0DA; }
.badge-au { background: #221C36; color: #C4B5FD; }
.badge-off { background: var(--danger-bg); color: var(--danger); }
.eq { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 14px; }
.eq span { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(1) { height: 6px; animation-delay: 0s; }
.eq span:nth-child(2) { height: 14px; animation-delay: .2s; }
.eq span:nth-child(3) { height: 9px; animation-delay: .35s; }
@keyframes eq { 0%,100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
.empty { padding: 48px 24px; text-align: center; color: var(--text-sub); }
.archived-block { margin: 8px 16px 24px; color: var(--text-faint); }
.archived-block summary { cursor: pointer; font-size: 12px; font-weight: 600; padding: 8px 0; }
h2.section { margin: 0 0 16px; font-size: 22px; letter-spacing: -.4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.tile { text-align: left; color: var(--text); border-radius: 8px; padding: 0 0 8px; }
.tile:hover .cover { transform: scale(1.02); }
.tile .cover { margin-bottom: 10px; transition: transform .2s ease; }
.tile .n { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .c { font-size: 13px; color: var(--text-sub); }
.search-box {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-press); max-width: 480px;
}
.search-box input { all: unset; flex: 1; min-width: 0; }
.search-box input::placeholder { color: var(--text-faint); }
.search-lead { color: var(--text-sub); margin: 16px 0 24px; max-width: 48ch; }
.setting-card {
  background: var(--bg-elev); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 12px; display: flex; gap: 16px; max-width: 640px;
}
.setting-card .ic {
  width: 40px; height: 40px; border-radius: 8px; background: var(--bg-press);
  display: flex; align-items: center; justify-content: center; flex: none; color: var(--text);
}
.setting-card h3 { margin: 0 0 4px; font-size: 16px; }
.setting-card p { margin: 0 0 12px; color: var(--text-sub); }
.setting-card .when { font-size: 12px; color: var(--text-faint); margin: -6px 0 12px; }
.lead { color: var(--text-sub); max-width: 60ch; margin: 0 0 24px; }

.now { padding: 16px; overflow: auto; }
.now-kicker { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-sub); margin-bottom: 12px; }
.stage {
  width: 100%;
  min-width: 200px; min-height: 200px;
  aspect-ratio: 1;
  max-height: 260px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)),
    repeating-linear-gradient(-45deg, #1A1A1A 0 8px, #161616 8px 16px);
  color: var(--text-sub);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 16px;
  box-shadow: inset 0 0 0 1px #2A2A2A;
}
.stage .k { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-faint); }
.stage .l { font-weight: 650; font-size: 13px; color: var(--text); max-width: 26ch; line-height: 1.4; }
.now-title { margin: 14px 0 0; font-size: 16px; font-weight: 700; }
.now-artist { color: var(--text-sub); font-size: 13px; margin-top: 2px; }
.now-note { margin: 12px 0 0; font-size: 11px; line-height: 1.45; color: var(--text-faint); }
.p-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-now .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-now .a { font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-transport { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.p-btns { display: flex; align-items: center; gap: 8px; }
.p-btn { width: 36px; height: 36px; border-radius: 999px; color: var(--text-sub); display: inline-flex; align-items: center; justify-content: center; }
.p-btn:hover { color: var(--text); }
.p-btn.is-on { color: var(--accent-hover); }
.p-play {
  width: 40px; height: 40px; border-radius: 999px; background: #fff; color: #111;
  display: inline-flex; align-items: center; justify-content: center;
}
.p-play:hover { transform: scale(1.06); }
.p-play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 480px; }
.progress .tm { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; min-width: 7ch; width: auto; flex: none; }
.progress .tm.end { text-align: right; }
.slider {
  -webkit-appearance: none; appearance: none;
  height: 16px; background: transparent;
  flex: 1; min-width: 0; margin: 0; cursor: pointer; border-radius: 4px;
  --track: #3A3A3A; --fill: #3A3A3A;
}
.slider.accent { --fill: var(--accent); }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--fill) var(--pos, 0%), var(--track) var(--pos, 0%)); }
.slider::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--fill) var(--pos, 0%), var(--track) var(--pos, 0%)); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0;
}
.slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.p-extra { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.vol { display: flex; align-items: center; gap: 6px; width: 136px; color: var(--text-sub); }
.vol .slider { width: 92px; flex: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 60; border: 0; width: 100%; height: 100%; }
.sheet {
  position: fixed; z-index: 70; background: #181818;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  color: var(--text);
}
.sheet-modal {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  border-radius: 12px; padding: 24px;
  max-height: calc(100vh - 48px); overflow: auto;
}
.sheet-handle { display: none; width: 36px; height: 4px; border-radius: 999px; background: #444; margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-head p { margin: 4px 0 0; font-size: 12px; color: var(--text-sub); }
.seg { display: flex; padding: 3px; gap: 2px; background: #111; border-radius: 999px; }
.seg button { flex: 1; height: 32px; border-radius: 999px; color: var(--text-sub); font-weight: 600; font-size: 13px; }
.seg button.is-selected { background: #3A3A3A; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 12px; }
.field label { font-size: 12px; color: var(--text-sub); }
.field-input {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px; border-radius: 8px; background: #111;
  box-shadow: inset 0 0 0 1px #2A2A2A;
}
.field-input:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
.field-input input { all: unset; flex: 1; min-width: 0; }
.field-input input::placeholder { color: var(--text-faint); }
.hint { font-size: 12px; color: var(--text-faint); margin: 0 0 16px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.search-hit { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; }
.search-hit:hover { background: var(--bg-hover); }
.search-hit .info { flex: 1; min-width: 0; }
.search-hit .t { font-weight: 600; }
.search-hit .a { font-size: 12px; color: var(--text-sub); }
.np-sheet {
  position: fixed; inset: var(--banner-h) 0 0 0; z-index: 80;
  background: #1A1528;
  display: flex; flex-direction: column;
  padding: 8px 20px 28px;
  overflow: auto;
}
.np-sheet .sheet-handle { display: block; }
.np-top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.np-stage { max-height: none; aspect-ratio: 1; min-height: 200px; width: min(100%, 360px); margin: 0 auto 20px; }
.np-sheet .now-title { font-size: 22px; text-align: left; }
.np-controls { margin-top: 8px; display: flex; flex-direction: column; gap: 18px; }
.np-controls .p-btns { justify-content: center; gap: 20px; }
.np-controls .p-play { width: 64px; height: 64px; }
.np-controls .p-play svg { width: 28px; height: 28px; }
.np-controls .progress { max-width: none; }
.np-controls .vol { width: auto; max-width: none; }
.np-controls .vol .slider { flex: 1; width: auto; }
.toast {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--player-h) + 16px);
  min-height: 40px; padding: 10px 16px; border-radius: 8px;
  background: #fff; color: #111; font-weight: 600; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-width: calc(100vw - 32px);
}
.m-top, .mini, .tabs { display: none; }

@media (max-width: 600px) {
  .shell { display: flex; flex-direction: column; padding: 0; gap: 0; }
  .sidebar, .now, .player { display: none !important; }
  .main {
    flex: 1; border-radius: 0; overflow: auto;
    padding-bottom: calc(var(--mini-h) + var(--tabs-h) + 8px);
  }
  .m-top {
    display: flex; align-items: center; gap: 8px;
    height: 52px; padding: 0 8px; flex: none;
    background: var(--bg); position: sticky; top: 0; z-index: 10;
  }
  .m-top .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero {
    flex-direction: column; align-items: center; text-align: center;
    padding: 8px 20px 16px; min-height: 0 !important; height: auto;
    gap: 10px; overflow: visible;
  }
  .hero-meta { flex: none; height: auto; width: 100%; padding: 0; }
  .hero-actions { margin-top: 2px; margin-bottom: 0; min-height: 52px; position: relative; z-index: 2; }
  .cover--hero { width: 140px; height: 140px; font-size: 56px; }
  .hero h1 { font-size: 28px; letter-spacing: -0.8px; margin-bottom: 8px; }
  .hero-meta { width: 100%; padding: 0; }
  .hero .sub { margin-bottom: 12px; }
  .hero-actions { justify-content: center; }
  .thead { display: none; }
  .table-wrap { padding: 8px 8px 16px; }
  .trow { grid-template-columns: 16px 1fr auto 48px 36px; gap: 6px; height: 52px; padding: 0 4px; }
  .t-num { display: none; }
  .trow .arch { opacity: 1; }
  .mini {
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 8px; right: 8px;
    bottom: calc(var(--tabs-h) + 6px);
    height: var(--mini-h);
    background: #2A2440;
    border-radius: 8px;
    padding: 8px;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
  }
  .mini .info { flex: 1; min-width: 0; text-align: left; }
  .mini .t { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini .a { font-size: 11px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    height: var(--tabs-h); background: #000;
    border-top: 1px solid #1A1A1A; z-index: 40;
    padding: 0 8px;
  }
  .tabs button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--text-faint); font-size: 10px; font-weight: 600;
  }
  .tabs button.is-active { color: var(--text); }
  .tabs button.is-active svg { color: var(--accent-hover); }
  .sheet-modal {
    top: auto; left: 0; right: 0; bottom: 0; transform: none;
    width: 100%; max-height: 86vh;
    border-radius: 16px 16px 0 0; padding: 12px 16px 24px;
  }
  .sheet-handle { display: block; }
  .toast { bottom: calc(var(--mini-h) + var(--tabs-h) + 16px); }
  .main-settings, .main-home, .main-search, .main-library { padding: 16px 16px 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  body.view-home .m-back, body.view-search .m-back, body.view-library .m-back, body.view-settings .m-back { visibility: hidden; }
}
@media (min-width: 601px) {
  body.view-home .hero, body.view-search .hero, body.view-library .hero, body.view-settings .hero,
  body.view-home .table-wrap, body.view-search .table-wrap, body.view-library .table-wrap, body.view-settings .table-wrap,
  body.view-home .archived-block, body.view-search .archived-block, body.view-library .archived-block, body.view-settings .archived-block { display: none; }
}

/* ===== Real app v1 additions (preview CSS above kept as the design base) ===== */
:root { --banner-h: 0px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }
html, body { height: 100%; overscroll-behavior: none; }
.app { height: 100vh; height: 100dvh; padding-top: var(--safe-t); }
.shell { padding-top: 8px; }
a { color: var(--accent-hover); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-actions .btn-ghost svg { width: 16px; height: 16px; }
.trow { user-select: none; -webkit-user-select: none; cursor: default; }
.trow .t-title-block { cursor: pointer; }
.handle { touch-action: none; }
.trow.dragging, .plist-item.dragging, .lib-row.dragging { position: relative; z-index: 5; background: var(--bg-press); box-shadow: 0 8px 24px rgba(0,0,0,.5); transition: none !important; }
.drag-shift { transition: transform .15s ease; }
.badge-off { cursor: help; }
.trow .t-num.playing { color: var(--accent-hover); }
.archived-block .trow { opacity: .7; }
.empty h2 { color: var(--text); margin: 0 0 8px; font-size: 22px; }
.empty p { margin: 0 auto 20px; max-width: 44ch; }
.empty .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-accent { background: var(--accent); color: #121212; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.small { font-size: 12px; color: var(--text-faint); }
.plist-item { position: relative; }
.plist-item .handle { width: 16px; }
.side-scroll { flex: 1; min-height: 0; overflow: auto; }
.side-foot { padding: 8px; border-top: 1px solid #1E1E1E; }
.side-slot { display: none; margin: 8px; width: auto; aspect-ratio: auto; height: 216px; min-height: 200px; max-height: none; }
.stage.slot { position: relative; }
.stage .k, .stage .l { pointer-events: none; }
/* The official player sits in a fixed layer laid over the visible "slot". */
#player-host { position: fixed; z-index: 45; left: 0; top: 0; width: 320px; height: 320px; visibility: hidden; transform: translateX(-200vw); border-radius: 8px; overflow: hidden; background: #000; }
#player-host.over-sheet { z-index: 85; }
#player-host .engine { position: absolute; inset: 0; }
#player-host iframe { width: 100%; height: 100%; border: 0; display: block; }
.au-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: #111; }
.au-art { flex: 1; min-height: 0; width: 100%; object-fit: cover; display: block; }
.au-credit { padding: 8px 10px; font-size: 11px; line-height: 1.35; color: var(--text-sub); background: #141414; }
.au-credit b { color: var(--text); font-weight: 600; }
.engine audio { display: none; }
.now-src { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }
.src-link { color: var(--text-sub); font-size: 12px; }
.lib-list { display: flex; flex-direction: column; gap: 2px; max-width: 720px; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 6px; }
.lib-row:hover { background: var(--bg-hover); }
.lib-row .open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; }
.lib-row .meta { min-width: 0; }
.lib-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.lib-row .count { font-size: 12px; color: var(--text-faint); }
.lib-row.is-archived .open { opacity: .6; }
.section-gap { margin-top: 28px; }
.search-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.select { height: 40px; border-radius: 999px; background: var(--bg-press); color: var(--text); border: 0; padding: 0 14px; font: inherit; font-weight: 600; max-width: 100%; }
.results { margin-top: 16px; max-width: 760px; }
.search-hit .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit .a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit .dur { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.attrib { font-size: 11px; color: var(--text-faint); margin-top: 10px; }
.msg { font-size: 13px; color: var(--text-sub); padding: 12px 8px; }
.msg.err { color: var(--danger); }
.add-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; background: #111; margin: 0 0 12px; }
.sheet-modal #pane-audius .results { max-height: 46vh; overflow: auto; margin-top: 8px; }
.setting-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.setting-card > div { min-width: 0; }
.kbd-hint { font-size: 12px; color: var(--text-faint); }
.np-sheet { inset: 0; padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(28px + var(--safe-b)); }
.np-stage.slot { width: min(100%, 360px); }
.mini .p-play { flex: none; }
.mini-progress { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.mini-progress i { display: block; height: 100%; width: 0; background: var(--accent-hover); }
#dock { display: none; }
.p-btn.rep-one { position: relative; }
.p-btn.rep-one::after { content: '1'; position: absolute; top: 4px; right: 4px; font-size: 9px; font-weight: 800; color: var(--accent-hover); }
.hero .cover--hero { background: linear-gradient(145deg, #9B8CFF 0%, #5B4EA8 55%, #1B1F4A 100%); }

/* Tablet: no right column; the player slot sits at the bottom of the sidebar (still ≥ 200×200). */
@media (min-width: 601px) and (max-width: 1099px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .now { display: none; }
  .side-slot { display: flex; }
  .player { grid-template-columns: 1fr 1.6fr 1fr; }
  .hero h1 { font-size: 44px; }
  .cover--hero { width: 160px; height: 160px; font-size: 60px; }
  .thead, .trow { grid-template-columns: 30px 16px 1fr 96px 48px 36px; }
}
@media (max-width: 600px) {
  .app { padding-top: 0; }
  .m-top { padding-top: var(--safe-t); height: calc(52px + var(--safe-t)); }
  .tabs { height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); }
  .mini { bottom: calc(var(--tabs-h) + var(--safe-b) + 6px); position: fixed; }
  .mini[hidden] { display: none !important; }
  .main { padding-bottom: calc(var(--mini-h) + var(--tabs-h) + var(--safe-b) + 16px); }
  body.has-dock .main { padding-bottom: calc(var(--mini-h) + var(--tabs-h) + var(--safe-b) + 224px); }
  body.has-dock #dock { display: block; position: fixed; left: 8px; right: 8px; height: 200px; bottom: calc(var(--tabs-h) + var(--safe-b) + var(--mini-h) + 12px); z-index: 39; border-radius: 8px; background: #000; }
  .trow .handle { opacity: 1; }
  .lib-row { padding: 8px 4px; }
  .toast { bottom: calc(var(--mini-h) + var(--tabs-h) + var(--safe-b) + 16px); }
  body.has-dock .toast { bottom: calc(var(--mini-h) + var(--tabs-h) + var(--safe-b) + 224px); }
  .setting-card { padding: 16px; }
  .search-row .select { flex: 1; }
}
/* .main is a flex column (panel); never let its sections shrink and overlap. */
.main > * { flex-shrink: 0; }
.add-to { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
@media (max-width: 600px) { .add-to { width: 100%; } .add-to .select { flex: 1; min-width: 0; } }
@media (max-width: 600px) { .shell { padding-top: 0; } }

/* ===== Design review round 1 (16.11.2026) ===== */
/* M7: hover-reveal only with a real mouse. */
@media (hover: hover) and (pointer: fine) {
  .trow .arch { opacity: 0; }
  .trow:hover .arch, .trow:focus-within .arch, .trow.is-current .arch { opacity: 1; }
  .plist-item .handle { opacity: 0; }
  .plist-item:hover .handle, .plist-item .handle:focus-visible { opacity: 1; }
}
/* M2: dark text on violet fills (4.85:1). */
.btn-accent, .btn-accent:hover { color: #121212; }
.btn-accent:active { background: var(--accent-press); }
/* M3: hero actions — Play, Add track, More (⋯). Labelled pills only on laptop. */
.hero-actions { flex-wrap: nowrap; }
.hero-actions .hero-pill { display: none; }
.more-btn { width: 44px; height: 44px; border-radius: 999px; color: var(--text); box-shadow: inset 0 0 0 1px #3A3A3A; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.more-btn:hover { background: var(--bg-hover); }
@media (min-width: 1100px) {
  .hero-actions .hero-pill { display: inline-flex; }
  .hero-actions .more-btn { display: none; }
}
.menu { position: fixed; z-index: 44; min-width: 200px; background: #242424; border-radius: 8px; padding: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; border-radius: 6px; text-align: left; font-weight: 600; color: var(--text); }
.menu button:hover, .menu button:focus-visible { background: #333; }
/* M4: YouTube thumbs are never the cover; a cropped, blurred hint sits behind the gradient + initial. */
.cover .cover-letter { position: relative; z-index: 1; }
.cover img.cover-yt { position: absolute; left: 50%; top: 50%; width: 177.78%; height: 133.33%; max-width: none; object-fit: cover; transform: translate(-50%, -50%) scale(1.2); filter: blur(16px); opacity: .4; inset: auto; }
/* N5: Source badge under the artist on phone. */
.badge-inline { display: none; margin-top: 3px; }
/* N1: search skeleton. */
.skel { display: flex; align-items: center; gap: 12px; padding: 8px; }
.skel i { display: block; background: #222; border-radius: 4px; }
.skel .sq { width: 40px; height: 40px; flex: none; }
.skel .ln { height: 10px; margin: 4px 0; }
.skel-wrap { animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.msg.err { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero .sub .num { font-variant-numeric: tabular-nums; }
/* N6: sheet motion (instant with reduced motion, via the global rule). */
@keyframes sheet-in-desk { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes sheet-out-desk { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(.98); } }
@keyframes sheet-in-phone { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out-phone { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.sheet-modal.is-opening { animation: sheet-in-desk 260ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.sheet-modal.is-closing { animation: sheet-out-desk 180ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.np-sheet.is-opening { animation: sheet-in-phone 260ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.np-sheet.is-closing { animation: sheet-out-phone 180ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.scrim.is-opening { animation: fade-in 260ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.scrim.is-closing { animation: fade-out 180ms cubic-bezier(0.23, 1, 0.32, 1) both; }
/* M1 (tablet/laptop): modal sits beside the official player slot, never over it. */
@media (min-width: 601px) and (max-width: 1099px) {
  .sheet-modal { left: calc(248px + (100vw - 248px) / 2); width: min(460px, calc(100vw - 248px - 32px)); }
}
@media (min-width: 1100px) {
  .sheet-modal { left: calc((100vw - 308px) / 2); width: min(460px, calc(100vw - 308px - 32px)); }
}
#top-slot { display: none; }
@media (max-width: 600px) {
  .sheet-modal.is-opening { animation-name: sheet-in-phone; }
  .sheet-modal.is-closing { animation-name: sheet-out-phone; }
  /* M1 (phone): with a sheet open, the player is pinned to the top and the sheet stays below it. */
  body.player-pinned #top-slot { display: block; position: fixed; left: 8px; right: 8px; top: calc(8px + var(--safe-t)); height: 200px; z-index: 61; }
  body.player-pinned .sheet-modal { max-height: calc(100dvh - 200px - 16px - var(--safe-t) - var(--safe-b)); bottom: 0; }
  /* N5 + M5: phone rows — handle, title (badge under artist), time, archive. */
  .trow { grid-template-columns: 44px minmax(0, 1fr) 40px 44px; gap: 4px; height: 66px; padding: 0 2px 0 0; }
  .trow > .badge { display: none; }
  .badge-inline { display: inline-flex; }
  .trow .handle { width: 44px; height: 44px; }
  .hero-actions { min-height: 52px; }
}
/* M5: 44×44 hit areas on touch screens. */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .icon-btn, .arch, .trow .arch { width: 44px; height: 44px; }
  .handle { width: 44px; height: 44px; }
  .p-btn { width: 44px; height: 44px; }
  .mini .p-play, .m-top .icon-btn { width: 44px; height: 44px; }
  .seg button { height: 44px; }
  .select { height: 44px; }
  .nav-item { height: 44px; }
  .slider { height: 44px; }
  .slider::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; }
  .slider::-moz-range-thumb { width: 16px; height: 16px; }
  .side-section summary, .archived-block summary { min-height: 44px; display: flex; align-items: center; }
  .src-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
  .search-hit { gap: 8px; }
  .search-hit .icon-btn + .icon-btn { margin-left: 0; }
  .lib-row { gap: 8px; }
  .plist-item .handle { width: 44px; height: 44px; margin-left: -6px; }
  .plist-item { gap: 6px; }
  .p-play { width: 44px; height: 44px; }
  .attrib a { display: inline-flex; align-items: center; min-height: 44px; }
  .np-controls .p-btns { gap: 12px; }
  .player .p-btns { gap: 8px; }
}
@media (pointer: coarse) and (min-width: 601px) {
  .thead, .trow { grid-template-columns: 28px 44px minmax(0, 1fr) 96px 48px 44px; }
  .trow { height: 60px; }
}
@media (pointer: coarse) and (max-width: 600px) {
  .trow { grid-template-columns: 44px minmax(0, 1fr) 40px 44px; }
}
@media (pointer: coarse) and (min-width: 601px) { :root { --player-h: 104px; } }
.scrim.is-closing, .sheet-modal.is-closing, .np-sheet.is-closing { pointer-events: none; }
.cover img:not(.cover-yt) { z-index: 2; }
