/* ---------- buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2);
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.is-on { color: var(--accent); }

.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); color: var(--bg);
}
.play-btn:hover:not(:disabled) { background: #fff; color: var(--bg); transform: scale(1.05); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev-2); color: var(--text);
  font-weight: 600; transition: background .15s, transform .15s var(--ease);
}
.btn:hover { background: #20202a; }
.btn:active { transform: scale(.97); }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.btn--primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.08); }
.btn--ghost { background: transparent; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(9, 9, 12, .25); border-top-color: var(--bg);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- artwork ---------- */
.artwork {
  --hue: 260;
  position: relative; overflow: hidden; flex: none;
  aspect-ratio: 1; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsl(var(--hue) 45% 34%), hsl(calc(var(--hue) + 50) 50% 18%));
}
.artwork--empty { background: var(--bg-elev-2); }
.artwork__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); }
.artwork img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.artwork img.is-loaded { opacity: 1; }

/* ---------- sliders ---------- */
.slider {
  --pct: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; touch-action: none;
}
.slider:disabled { cursor: default; opacity: .5; }
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--text) var(--pct), rgba(255, 255, 255, .18) var(--pct));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: #fff; border: 0; opacity: 0; transition: opacity .15s;
}
.slider::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .18); }
.slider::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--text); }
.slider::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
.seekbar:hover .slider::-webkit-slider-thumb, .volume:hover .slider::-webkit-slider-thumb,
.slider:focus-visible::-webkit-slider-thumb, .slider:active::-webkit-slider-thumb { opacity: 1; }
.seekbar:hover .slider::-moz-range-thumb, .volume:hover .slider::-moz-range-thumb,
.slider:focus-visible::-moz-range-thumb, .slider:active::-moz-range-thumb { opacity: 1; }
@media (pointer: coarse) {
  .slider { height: 32px; }
  .slider::-webkit-slider-thumb { opacity: 1; width: 18px; height: 18px; margin-top: -7px; }
  .slider::-moz-range-thumb { opacity: 1; width: 18px; height: 18px; }
}
.accent-fill .slider { --fill: var(--accent); }

/* ---------- seekbar / volume ---------- */
.seekbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; }
.time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; }
.time:last-child { text-align: right; }
.volume { display: flex; align-items: center; gap: 4px; }
.volume .slider { width: 110px; }

/* ---------- transport ---------- */
.transport { display: flex; align-items: center; justify-content: center; gap: 8px; }
.transport--full { gap: 14px; }

/* ---------- track info / text ---------- */
.track-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.track-info__art { width: 56px; border-radius: 8px; }
.track-text { min-width: 0; }
.track-text__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text__artist { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text__artist.is-error { color: var(--danger); }
.track-text--large { text-align: center; }
.track-text--large .track-text__title { font-size: 22px; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.track-text--large .track-text__artist { font-size: 16px; margin-top: 4px; }

/* ---------- search box ---------- */
.searchbox {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); transition: border-color .15s, background .15s;
}
.searchbox:focus-within { border-color: var(--accent); background: var(--bg-elev); color: var(--text); }
.searchbox__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.searchbox__input::placeholder { color: var(--text-3); }
.searchbox__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- lists ---------- */
.queue-list { display: flex; flex-direction: column; gap: 2px; }
.queue-list:empty::after { content: "Nothing queued yet"; display: block; padding: 24px 8px; color: var(--text-3); text-align: center; }
.row { display: flex; align-items: center; border-radius: var(--radius-sm); }
.row:hover, .row.is-current { background: var(--hover); }
.row__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: transparent; text-align: left; border-radius: var(--radius-sm); }
.row__art-wrap { position: relative; width: 48px; flex: none; }
.row__art { width: 48px; }
.row__text { flex: 1; min-width: 0; }
.row__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-current .row__title { color: var(--accent); }
.row__artist { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.row__action { width: 40px; height: 40px; opacity: 0; }
.row:hover .row__action, .row.is-current .row__action, .row__action:focus-visible { opacity: 1; }
@media (pointer: coarse) { .row__action { opacity: .75; } }

.eq { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 14px; background: rgba(0, 0, 0, .5); border-radius: var(--radius-sm); }
.eq i { width: 4px; height: 6px; background: var(--accent); border-radius: 2px; }
.eq.is-playing i { animation: eq 0.9s ease-in-out infinite; }
.eq.is-playing i:nth-child(2) { animation-delay: .2s; }
.eq.is-playing i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

/* ---------- empty states, cards, hero ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px; text-align: center; color: var(--text-2); }
.empty[hidden] { display: none; }
.empty h2 { font-size: 18px; color: var(--text); }
.empty p { max-width: 380px; }
.empty .btn { margin-top: 8px; }
.empty__icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--bg-elev-2); color: var(--text-3); }
.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card p { color: var(--text-2); }
.card__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.hero { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 28px; border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 0% 0%, rgba(155, 140, 255, .28), transparent 60%), radial-gradient(100% 120% at 100% 100%, rgba(255, 122, 182, .2), transparent 55%), var(--bg-elev); border: 1px solid var(--line); margin-bottom: 20px; }
.hero__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .08); color: var(--text); }
.hero h2 { font-size: clamp(22px, 4vw, 30px); line-height: 1.15; }
.hero p { color: var(--text-2); max-width: 520px; }
.hero__actions { margin-top: 8px; }

/* ---------- toast ---------- */
.toaster { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player-h) + 20px); z-index: 80; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--bg-elev-2); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: toast-in .25s var(--ease); }
.toast--error { border-color: rgba(255, 122, 133, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- brand ---------- */
.brand, .topbar__brand { display: flex; align-items: center; min-height: 44px; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }

/* ---------- search ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.results-head, .recent__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.results-head h2, .recent__head h2 { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-list { margin-bottom: 8px; }
.notice { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px dashed var(--line); color: var(--text-3); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elev-2); }
.chip__label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; border: 0; background: transparent; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__label .icon { color: var(--text-3); }
.chip__remove { display: grid; place-items: center; width: 36px; height: 40px; border: 0; background: transparent; color: var(--text-3); border-radius: 0 999px 999px 0; }
.chip__remove:hover { color: var(--text); }

.skeleton-list { display: flex; flex-direction: column; gap: 2px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 8px; }
.sk { display: block; background: linear-gradient(90deg, var(--bg-elev-2) 25%, #232330 50%, var(--bg-elev-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
.sk--art { width: 48px; height: 48px; border-radius: var(--radius-sm); flex: none; }
.sk-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk--line { height: 12px; width: 70%; }
.sk--short { width: 40%; height: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- channels / artists ---------- */
.artwork--round { border-radius: 50%; }
.row--channel .row__art { width: 48px; }
.row__chev { display: grid; place-items: center; color: var(--text-3); }
.results-section + .results-section { margin-top: 22px; }
.results-section .results-head { margin-top: 0; }

.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 6px -6px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 600; }
.back-link:hover { background: var(--hover); color: var(--text); }
.back-link .icon { transform: rotate(90deg); }
.channel-hero { display: flex; align-items: center; gap: 24px; margin: 4px 0 24px; }
.channel-hero__art { width: 128px; flex: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.channel-hero__text { min-width: 0; }
.channel-hero h1 { font-size: clamp(24px, 4vw, 36px); line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.channel-hero__meta { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.channel-hero__desc { margin-top: 8px; color: var(--text-3); font-size: 14px; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.channel-hero__actions { margin-top: 14px; }
.sk--round { border-radius: 50%; }
.sk--hero { width: 128px; height: 128px; flex: none; }
@media (max-width: 599px) {
  .channel-hero { gap: 16px; }
  .channel-hero__art, .sk--hero { width: 88px; height: 88px; }
}

/* ---------- touch polish ---------- */
button, a, [role="tab"], .row__main, .chip__label { touch-action: manipulation; }   /* no double-tap zoom / 300ms delay */
.icon-btn, .play-btn, .btn, .np__tab, .bottom-nav__item, .row__main { -webkit-user-select: none; user-select: none; }
.artwork img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; }
.mini-player { touch-action: none; }
.mini-player .transport { touch-action: manipulation; }

/* bigger scrub target + live feedback while dragging the seek bar */
.seekbar.is-dragging .slider::-webkit-slider-runnable-track { height: 8px; }
.seekbar.is-dragging .slider::-webkit-slider-thumb { opacity: 1; width: 22px; height: 22px; margin-top: -7px; }
.seekbar.is-dragging .slider::-moz-range-track, .seekbar.is-dragging .slider::-moz-range-progress { height: 8px; }
.seekbar.is-dragging .slider::-moz-range-thumb { opacity: 1; width: 22px; height: 22px; }
.seekbar.is-dragging .time { color: var(--text); font-weight: 600; }
.nowplaying .seekbar .slider { height: 40px; }   /* generous touch zone around the 4px track */

/* small buttons still need a finger-sized hit area on touch screens */
@media (pointer: coarse) {
  .btn--small { min-height: 44px; }
}

/* ---------- YouTube player element ---------- */
.video-host { position: fixed; z-index: 35; background: #000; border-radius: 12px; overflow: hidden; pointer-events: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .55); }
.video-host.is-empty { visibility: hidden; }
.video-host iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-host.on-sheet { z-index: 61; }
/* hidden by default: keeps its size and keeps playing, but is transparent and behind everything */
.video-host.is-hidden { opacity: 0; z-index: -1; pointer-events: none; box-shadow: none; }
.video-host.needs-tap { pointer-events: auto; outline: 3px solid var(--accent); }
.video-host.is-ad { outline: 3px solid #ffb02e; pointer-events: auto; }   /* so an ad can be skipped */
.video-host.is-dock { right: 12px; bottom: calc(var(--player-h) + 12px); width: 320px; height: 180px; }
.np__video-slot, .expanded__video-slot { display: none; }
@media (max-width: 899px) {
  .video-host.is-dock { right: calc(8px + var(--sar)); bottom: calc(var(--nav-h) + var(--mini-h) + var(--sab) + 16px); width: 224px; height: 126px; }
  .video-host.is-dock.on-sheet { bottom: calc(16px + var(--sab)); }
}
.nowplaying.show-video .np__video-slot { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: rgba(255, 255, 255, .04); }
.nowplaying.show-video .np__art { display: none; }
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
  .nowplaying.show-video .np__video-slot { width: min(46vw, 62vh); }
}
/* volume cannot be set by a web page on iPhone/iPad */
.ios .volume { display: none; }

/* ---------- cover button in the player bar ---------- */
.bar-art { position: relative; flex: none; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.bar-art:disabled { cursor: default; }
.bar-art .artwork { width: 56px; transition: transform .15s var(--ease), filter .15s; }
.bar-art:hover:not(:disabled) .artwork { transform: scale(1.04); filter: brightness(1.1); }
.bar-art__arrow { display: none; position: absolute; inset: 0; place-items: center; border-radius: 8px; background: var(--bg-elev-2); border: 1px solid var(--line); }
.bar-art.is-open .artwork { visibility: hidden; }
.bar-art.is-open .bar-art__arrow { display: grid; }
.bar-art:hover .bar-art__arrow { background: #24242e; }

/* ---------- Cover | Video switch ---------- */
.media-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.media-toggle__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; }
.media-toggle__btn:hover { color: var(--text); }
.media-toggle__btn[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: var(--text); }
.media-toggle-icon .icon { color: var(--text-2); }
.media-toggle-icon[aria-pressed="true"] .icon { color: var(--accent); }
.np__header-end { display: grid; place-items: center; }

/* ---------- ?debug=1 panel ---------- */
.debug { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 300; max-height: 42vh; display: flex; flex-direction: column; background: rgba(0, 0, 0, .88); border: 1px solid #444; border-radius: 10px; font: 11px/1.4 ui-monospace, Menlo, monospace; color: #cfc; }
.debug__bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #333; }
.debug__bar strong { flex: 1; color: #fff; }
.debug__btn { min-height: 32px; padding: 0 12px; border: 1px solid #555; border-radius: 6px; background: #222; color: #fff; font: inherit; }
.debug__body[hidden] { display: none; }
.debug__log { margin: 0; padding: 8px; overflow: auto; max-height: calc(42vh - 48px); white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }

/* ---------- queue: reorder, undo ---------- */
.row__grip { flex: none; display: grid; place-items: center; width: 32px; height: 44px; margin-left: 2px; border: 0; background: transparent; color: var(--text-3); border-radius: var(--radius-sm); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.row__grip:hover, .row__grip:focus-visible { color: var(--text); background: var(--hover); }
.row--sortable .row__main { padding-left: 4px; }
.queue-list.is-sorting { -webkit-user-select: none; user-select: none; }
.queue-list.is-sorting .row { transition: transform .15s var(--ease); }
.queue-list.is-sorting .row.is-dragging { transition: none; position: relative; z-index: 5; background: var(--bg-elev-2); box-shadow: 0 8px 28px rgba(0, 0, 0, .55); cursor: grabbing; }
.queue-list.is-sorting .row__grip { cursor: grabbing; }
.page-count { font-size: .6em; font-weight: 500; color: var(--text-3); }
.results-head__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.channel-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toast--action { display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: auto; }
.toast__btn { flex: none; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--accent); font-weight: 600; }
.toast__btn:hover { background: var(--hover); }
@media (pointer: coarse) { .row__grip { width: 40px; height: 48px; } .toast__btn { min-height: 44px; } }

/* ---------- Safari diagnostics: ?vh=a|b|c (alternative ways to hide the YouTube box) ---------- */
/* a: plain box while hidden - no rounded-corner clipping, no shadow */
body[data-vh="a"] .video-host.is-hidden, body[data-vh="c"] .video-host.is-hidden { border-radius: 0; overflow: visible; box-shadow: none; }
/* b: park it off-screen instead of making it transparent */
body[data-vh="b"] .video-host.is-hidden { opacity: 1; z-index: auto; left: -10000px !important; right: auto; }
/* c: a, and almost (not fully) transparent, in front of the page */
body[data-vh="c"] .video-host.is-hidden { opacity: .01; z-index: 1; }

/* ---------- Library, playlists, favorites ---------- */
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.library-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 24px; }
.library-tile { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); color: inherit; }
.library-tile:hover { background: var(--hover); }
.library-tile__icon { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(155, 140, 255, .28), rgba(255, 122, 182, .18)); color: var(--accent); }
.library-tile__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.library-tile__text small, .playlist-card__info small { color: var(--text-3); font-size: 13px; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.playlist-card { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.playlist-card:hover { background: var(--hover); }
.playlist-card__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 6px 10px 10px; color: inherit; }
.playlist-card__art { width: 58px; flex: none; border-radius: var(--radius-sm); }
.playlist-card__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.playlist-card__info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-card__play { margin-right: 6px; }
.playlist-head { display: flex; gap: 20px; align-items: flex-end; margin-bottom: 22px; }
.playlist-head__art { width: 168px; flex: none; border-radius: var(--radius); }
.playlist-head__text { flex: 1; min-width: 0; }
.playlist-head .page-title { margin-bottom: 4px; overflow-wrap: anywhere; }
.playlist-head .page-head__actions { margin-top: 14px; }

/* hearts and the "more" button on song rows */
.row__like { opacity: .5; }
.row:hover .row__like, .row.is-current .row__like, .row__like:focus-visible, .row__like.is-on { opacity: 1; }
.row__like.is-on, .fav-btn.is-on { color: var(--accent); }
.row__more { display: none; opacity: .75; }
@media (pointer: coarse) { .row__like { opacity: .75; } .row__like.is-on { opacity: 1; } }
@media (max-width: 640px) {
  .row__action--secondary { display: none; }
  .row__more { display: inline-flex; }
  .playlist-head { flex-direction: column; align-items: flex-start; }
  .playlist-head__art { width: 104px; }
  .library-tiles { grid-template-columns: 1fr; }
}
.fav-btn { flex: none; }
.player-bar__left .track-info { gap: 10px; }
.np__title-row, .expanded__title-row { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.np__title-row .track-text, .expanded__title-row .track-text { flex: 1; min-width: 0; }
.np__quick { display: flex; flex: none; }

/* ---------- dialogs, menus and sheets ---------- */
.dlg-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .66); }
.dlg { width: min(100%, 460px); max-height: min(80vh, 640px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg, 16px); background: var(--bg-elev); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); overflow: hidden; animation: dlg-in .18s var(--ease); }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 8px 4px 20px; }
.dlg__head h2 { min-width: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg__body { padding: 8px 20px 16px; overflow-y: auto; overscroll-behavior: contain; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dlg__text { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.field { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-error { color: var(--danger, #ff7a85); font-size: 14px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.menu__item { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; text-align: left; }
.menu__item:hover, .menu__item:focus-visible { background: var(--hover); }
.menu__item--new { color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.menu__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__meta { color: var(--text-3); font-size: 13px; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@media (max-width: 640px) {
  .dlg-backdrop { align-items: end; padding: 0; }
  .dlg { width: 100%; max-height: 85vh; border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .24s var(--ease); }
  .dlg__body { padding-bottom: 12px; }
}

.toaster.toaster--top { bottom: auto; top: calc(env(safe-area-inset-top) + 64px); z-index: 90; }
