/* ==========================================================================
   Frishta — design tokens, base, layout, components, views
   ========================================================================== */

:root {
  --bg-0: #0e0f11;
  --bg-1: #16181b;
  --bg-2: #1e2125;
  --bg-3: #2a2e33;
  --bg-4: #353a40;
  --line: #2c3036;
  --text-1: #f2f4f5;
  --text-2: #a7aeb5;
  --text-3: #737b84;
  --accent: #3ddc97;
  --accent-strong: #22b87a;
  --accent-ink: #062a1b;
  --accent-soft: rgba(61, 220, 151, 0.14);
  --danger: #f0616d;
  --warn: #f5b54a;
  --info: #5fb3f5;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Manrope", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 48px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --sidebar-w: 280px;
  --player-h: 84px;
  --mobile-nav-h: 64px;
  --hero-tint: #2a5a47;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-md); font-weight: 600;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ==========================================================================
   Layout
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  grid-template-areas: "side main" "player player";
  gap: 8px;
  height: 100vh;
  height: 100dvh;
  padding: 8px 8px 0;
}

.sidebar {
  grid-area: side;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
}
.sidebar > * { background: var(--bg-1); border-radius: var(--r-lg); }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: transparent !important;
  border-radius: var(--r-lg);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
/* Official logo, shown unaltered (original 1408 x 768 artwork, proportions kept) */
.brand-logo, .topbar-brand img, .auth-logo {
  display: block; width: 100%; height: auto; aspect-ratio: 1408 / 768; object-fit: contain;
  border-radius: 12px; background: #dfe9f6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.brand:hover .brand-logo, .topbar-brand:hover img { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .1); }
.topbar-brand { display: none; }
.auth-logo { max-width: 300px; margin: 0 auto 24px; border-radius: 14px; }
.nav-primary { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-primary a, .library-title {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: var(--r-md);
  color: var(--text-2); font-weight: 600;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-primary a:hover, .library-title:hover { color: var(--text-1); text-decoration: none; background: var(--bg-2); }
.nav-primary a.active, .library-title.active { color: var(--text-1); }
.nav-primary a.active svg { color: var(--accent); }
.nav-primary svg, .library-title svg { width: 22px; height: 22px; }

.library-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px; }
.library-head { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.library-list { flex: 1; overflow-y: auto; margin-top: 6px; padding-bottom: 8px; }
.lib-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: var(--r-md);
}
.lib-item:hover { background: var(--bg-2); text-decoration: none; }
.lib-item.active { background: var(--bg-3); }
.lib-item .thumb { width: 44px; height: 44px; border-radius: var(--r-sm); }
.lib-item .meta { min-width: 0; }
.lib-item .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item .sub { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item.playing .name { color: var(--accent); }
.library-empty { padding: 16px 12px; background: var(--bg-2); border-radius: var(--r-md); margin: 6px 4px; }
.library-empty h3 { font-size: 15px; margin-bottom: 4px; }
.library-empty p { color: var(--text-2); font-size: 13px; margin-bottom: 12px; }

.main {
  grid-area: main;
  position: relative;
  background: var(--bg-1);
  border-radius: var(--r-lg);
  overflow-y: auto; overflow-x: hidden;
  min-width: 0;
  scroll-behavior: auto;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px;
  background: rgba(22, 24, 27, 0);
  transition: background .2s var(--ease);
}
.topbar.scrolled { background: rgba(22, 24, 27, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-nav { display: flex; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.view { padding: 0 24px 48px; min-height: calc(100% - 64px); }
.view:focus { outline: none; }

.mobile-nav { display: none; }

/* ==========================================================================
   Components
   ========================================================================== */

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  color: var(--text-2);
  transition: color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.icon-btn:hover:not(:disabled) { color: var(--text-1); background: var(--bg-3); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn.round { background: rgba(0, 0, 0, 0.45); color: var(--text-1); }
.icon-btn.active { color: var(--accent); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 20px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 14px; letter-spacing: 0.01em; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease), border-color .15s;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #5ae6a8; }
.btn-light { background: var(--text-1); color: var(--bg-0); }
.btn-light:hover:not(:disabled) { background: #fff; }
.btn-outline { border-color: var(--bg-4); color: var(--text-1); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { color: var(--text-1); background: var(--bg-3); }
.btn-danger { background: var(--danger); color: #2a0609; }
.btn-danger:hover:not(:disabled) { background: #ff7b86; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
  animation: spin .8s linear infinite;
}
.btn-light.loading::after, .btn-outline.loading::after { border-color: var(--text-2) transparent var(--text-2) transparent; }

.play-fab {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.play-fab:hover { transform: scale(1.05); background: #5ae6a8; }
.play-fab:active { transform: scale(0.97); }
.play-fab svg { width: 24px; height: 24px; }
.play-fab.sm { width: 46px; height: 46px; }
.play-fab.sm svg { width: 20px; height: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--bg-3); color: var(--text-1); font-size: 13.5px; font-weight: 600;
  transition: background .15s var(--ease), color .15s;
}
.chip:hover { background: var(--bg-4); text-decoration: none; }
.chip.active { background: var(--text-1); color: var(--bg-0); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
}
.badge.muted { background: var(--bg-3); color: var(--text-2); }
.badge.warn { background: rgba(245, 181, 74, .15); color: var(--warn); }
.badge.danger { background: rgba(240, 97, 109, .15); color: var(--danger); }
.explicit {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px;
  background: var(--text-3); color: var(--bg-0); font-size: 10px; font-weight: 800; margin-right: 6px; flex-shrink: 0;
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--accent-strong), #1b6b8f);
  display: inline-grid; place-items: center; font-weight: 700; color: var(--bg-0); font-size: 14px;
}
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.5); font-weight: 600; font-size: 14px;
}
.user-btn:hover { background: var(--bg-3); }

/* Artwork */
.art {
  position: relative; overflow: hidden; background: var(--bg-3);
  display: grid; place-items: center; color: var(--text-3);
}
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.placeholder svg { width: 40%; height: 40%; opacity: .7; }
.art.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.art.mosaic img { width: 100%; height: 100%; }
.art-gradient-1 { background: linear-gradient(135deg, #2c6e55, #16353c); }
.art-gradient-2 { background: linear-gradient(135deg, #5a3f8f, #1f2a4f); }
.art-gradient-3 { background: linear-gradient(135deg, #8f5a3f, #3a1f2a); }
.art-gradient-4 { background: linear-gradient(135deg, #3f6f8f, #1f2f3a); }
.art-gradient-liked { background: linear-gradient(135deg, #3ddc97, #1b5f8f); color: #fff; }
.art-gradient-liked svg { opacity: 1 !important; }

/* Cards & shelves */
.section { margin-top: 32px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 22px; }
.section-head a { color: var(--text-2); font-size: 13.5px; font-weight: 700; }
.section-head a:hover { color: var(--text-1); }

.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(150px, 17%, 210px);
  gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; margin: 0 -8px;
}
.shelf > * { scroll-snap-align: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0 -8px; }

.card {
  position: relative; display: block; padding: 12px; border-radius: var(--r-md);
  transition: background .2s var(--ease);
  min-width: 0;
}
.card:hover { background: var(--bg-2); text-decoration: none; }
.card .art { aspect-ratio: 1; border-radius: var(--r-md); box-shadow: var(--shadow-1); margin-bottom: 12px; }
.card.round .art { border-radius: 50%; }
.card-title { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .play-fab {
  position: absolute; right: 20px; top: calc(12px + (100% - 24px) * 0); width: 48px; height: 48px;
  opacity: 0; transform: translateY(8px); transition: opacity .2s var(--ease), transform .2s var(--ease), background .15s;
}
.card .art-wrap { position: relative; }
.card .art-wrap .play-fab { position: absolute; right: 8px; bottom: 20px; top: auto; }
.card:hover .play-fab, .card:focus-within .play-fab, .card .play-fab.is-playing { opacity: 1; transform: translateY(0); }
.card .play-fab svg { width: 20px; height: 20px; }

.genre-tile {
  position: relative; display: block; aspect-ratio: 1.6; padding: 16px; border-radius: var(--r-md); overflow: hidden;
  font: 800 20px/1.1 var(--font-display); letter-spacing: -0.02em;
  transition: transform .2s var(--ease), filter .2s;
}
.genre-tile:hover { text-decoration: none; transform: translateY(-2px); filter: brightness(1.08); }
.genre-tile .count { position: absolute; left: 16px; bottom: 14px; font: 600 12.5px var(--font); opacity: .85; }
.genre-tile::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 90px; height: 90px; border-radius: 18px;
  background: rgba(255, 255, 255, .16); transform: rotate(24deg);
}
.grid-genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

/* Hero (detail pages) */
.hero {
  position: relative; display: flex; align-items: flex-end; gap: 24px;
  margin: -64px -24px 0; padding: 88px 24px 24px;
  background: linear-gradient(180deg, var(--hero-tint) 0%, color-mix(in srgb, var(--hero-tint) 45%, var(--bg-1)) 100%);
  background: linear-gradient(180deg, var(--hero-tint) 0%, rgba(22, 24, 27, 0.6) 100%), var(--bg-1);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -180px; height: 180px; background: linear-gradient(180deg, rgba(0,0,0,.18), transparent); pointer-events: none; }
.hero .art { width: 220px; height: 220px; border-radius: var(--r-md); box-shadow: var(--shadow-2); flex-shrink: 0; }
.hero.round .art { border-radius: 50%; }
.hero-text { min-width: 0; }
.hero-kind { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.hero-kind svg { width: 20px; height: 20px; color: var(--info); }
.hero h1 { font-size: clamp(32px, 6vw, 72px); font-weight: 800; letter-spacing: -0.04em; margin: 6px 0 10px; overflow-wrap: anywhere; }
.hero-desc { color: var(--text-2); font-size: 14px; margin-bottom: 8px; max-width: 70ch; }
.hero-meta { font-size: 14px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hero-meta strong { color: var(--text-1); }
.hero-meta .dot::before { content: "•"; margin: 0 2px; }

.action-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; padding: 24px 0 16px; }
.action-bar .icon-btn { width: 44px; height: 44px; }
.action-bar .icon-btn svg { width: 28px; height: 28px; }

/* Track list */
.tracks { width: 100%; }
.track-head, .track {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: 32px minmax(180px, 4fr) minmax(120px, 3fr) 120px;
  padding: 0 16px;
}
.tracks.no-album .track-head, .tracks.no-album .track { grid-template-columns: 32px minmax(180px, 1fr) 120px; }
.track-head {
  height: 36px; color: var(--text-2); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; position: sticky; top: 60px; background: var(--bg-1); z-index: 5;
}
.track-head svg { width: 16px; height: 16px; }
.track-head .t-dur { display: flex; justify-content: flex-end; padding-right: 40px; }
.track {
  height: 56px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px;
  transition: background .12s;
  user-select: none;
}
.track:hover, .track:focus-within, .track.menu-open { background: var(--bg-3); }
.track.selected { background: var(--bg-4); }
.t-num { position: relative; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.t-num .num { display: inline-block; min-width: 16px; }
.t-num .t-play { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); display: none; color: var(--text-1); width: 32px; height: 32px; place-items: center; }
.t-num .t-play svg { width: 16px; height: 16px; }
.track:hover .t-num .num, .track:focus-within .t-num .num { visibility: hidden; }
.track:hover .t-num .t-play, .track:focus-within .t-num .t-play { display: grid; }
.t-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-main .art { width: 40px; height: 40px; border-radius: 4px; }
.t-main .art.placeholder svg { width: 20px; height: 20px; }
.t-text { min-width: 0; }
.t-title { color: var(--text-1); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; text-align: left; line-height: 1.35; }
button.t-title { cursor: default; }
.muted { color: var(--text-2); }
.q-item .play-hit { display: block; overflow: hidden; }
.t-artists { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.t-artists a:hover, .t-album a:hover { color: var(--text-1); }
.t-album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: tabular-nums; }
.t-end .like-btn { opacity: 0; }
.t-end .like-btn.liked { opacity: 1; color: var(--accent); }
.track:hover .t-end .like-btn, .track:focus-within .like-btn { opacity: 1; }
.t-end .more-btn { opacity: 0; }
.track:hover .more-btn, .track:focus-within .more-btn, .track.menu-open .more-btn { opacity: 1; }
.track.playing .t-title { color: var(--accent); }
.track.playing .t-num .num { color: var(--accent); }
.track.unavailable { opacity: .45; }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; width: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.eq.paused i { animation-play-state: paused; height: 40%; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--text-1); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: var(--r-md);
  color: var(--text-1); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.field-error svg { width: 14px; height: 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(240, 97, 109, .12); color: #ffb3b9; border: 1px solid rgba(240, 97, 109, .35);
  padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 16px;
}
.form-error svg { color: var(--danger); margin-top: 1px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 70px; }
.password-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 6px 8px; border-radius: var(--r-sm); }
.password-wrap button:hover { color: var(--text-1); }

/* Search */
.search-bar { position: relative; max-width: 520px; margin: 4px 0 20px; }
.search-bar svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-2); width: 22px; height: 22px; pointer-events: none; }
.search-bar .input { min-height: 52px; padding-left: 50px; padding-right: 48px; border-radius: var(--r-pill); font-size: 16px; background: var(--bg-2); }
.search-bar .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.top-result {
  display: block; padding: 20px; border-radius: var(--r-md); background: var(--bg-2); position: relative; min-height: 220px;
  transition: background .2s;
}
.top-result:hover { background: var(--bg-3); text-decoration: none; }
.top-result .art { width: 96px; height: 96px; border-radius: var(--r-md); margin-bottom: 18px; box-shadow: var(--shadow-1); }
.top-result.round .art { border-radius: 50%; }
.top-result h3 { font-size: 28px; margin-bottom: 6px; }
.top-result .play-fab { position: absolute; right: 20px; bottom: 20px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.top-result:hover .play-fab, .top-result:focus-within .play-fab { opacity: 1; transform: none; }
.search-top { display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; gap: 24px; }
.search-top h2 { font-size: 22px; margin-bottom: 14px; }

/* Page headers */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.select.inline { width: auto; min-height: 36px; padding: 6px 12px; border-radius: var(--r-pill); font-size: 13.5px; }

/* Empty / error states */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 64px 24px; color: var(--text-2);
}
.empty .empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; color: var(--text-2); margin-bottom: 6px; }
.empty .empty-icon svg { width: 32px; height: 32px; }
.empty h2 { color: var(--text-1); font-size: 22px; }
.empty p { max-width: 42ch; }
.empty .btn { margin-top: 10px; }

/* Skeletons */
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r-sm); }
.sk-line { height: 12px; margin: 8px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-title { height: 28px; width: 260px; border-radius: var(--r-md); margin: 12px 0 20px; }
.sk-card .sk-art { aspect-ratio: 1; border-radius: var(--r-md); margin-bottom: 12px; }
.sk-row { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; }
.sk-row .sk-art { width: 40px; height: 40px; }
.sk-hero { height: 300px; margin: -64px -24px 24px; border-radius: 0; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.load-more { display: flex; justify-content: center; padding: 24px 0; }
.load-sentinel { height: 1px; }

/* Toasts */
.toasts {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + 20px); transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; z-index: 300; pointer-events: none;
  width: min(92vw, 520px);
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: var(--text-1); color: var(--bg-0); padding: 10px 16px; border-radius: var(--r-md);
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2);
  animation: toast-in .25s var(--ease);
}
.toast.error { background: #ffd9dc; color: #4a0a10; }
.toast.leaving { animation: toast-out .2s var(--ease) forwards; }
.toast button { font-weight: 800; text-decoration: underline; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* Modal (native <dialog>) */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--bg-2); color: var(--text-1);
  width: min(94vw, 480px); max-height: 88vh; box-shadow: var(--shadow-2);
}
dialog.modal.wide { width: min(96vw, 760px); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .66); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in .2s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.modal-head h2 { font-size: 22px; }
.modal-body { padding: 8px 24px 8px; overflow-y: auto; max-height: calc(88vh - 140px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }
.modal-body p { color: var(--text-2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Context menu */
.menu {
  position: fixed; z-index: 400; min-width: 220px; max-width: 300px; padding: 4px;
  background: var(--bg-3); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  animation: modal-in .12s var(--ease);
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-1); text-align: left;
}
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--bg-4); text-decoration: none; outline: none; }
.menu svg { width: 18px; height: 18px; color: var(--text-2); }
.menu hr { border: 0; border-top: 1px solid var(--bg-4); margin: 4px 0; }
.menu .danger { color: #ff9aa3; }

/* Playlist picker */
.picker-list { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.picker-list button { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); text-align: left; }
.picker-list button:hover { background: var(--bg-3); }
.picker-list .art { width: 44px; height: 44px; border-radius: var(--r-sm); }

/* Auth pages */
.auth-wrap { min-height: calc(100% - 20px); display: grid; place-items: center; padding: 24px 0 48px; }
.auth-card {
  width: min(100%, 420px); padding: 36px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line);
}
.auth-card .brand-mark { width: 44px; height: 44px; margin-bottom: 18px; }
.auth-card h1 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 26px; }
.auth-card .switch { width: auto; height: auto; text-align: center; color: var(--text-2); margin-top: 22px; font-size: 14px; }
.btn-google { gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f2f2f2; color: #1f1f1f; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3, var(--text-2)); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .switch a { color: var(--text-1); font-weight: 700; text-decoration: underline; }
.strength { height: 4px; border-radius: 4px; background: var(--bg-4); overflow: hidden; margin-top: 4px; }
.strength span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* Profile */
.profile-hero .art { background: linear-gradient(135deg, var(--accent-strong), #1b6b8f); color: var(--bg-0); font: 800 80px var(--font-display); }
.panel { background: var(--bg-2); border-radius: var(--r-lg); padding: 24px; }
.panel h2 { font-size: 18px; margin-bottom: 16px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }

/* Library */
.lib-grid-head { display: flex; gap: 8px; margin-bottom: 16px; }
.liked-card .art { background: linear-gradient(135deg, #3ddc97, #1b5f8f); color: #fff; }
.liked-card .art svg { width: 36%; height: 36%; opacity: 1; }
.liked-tile {
  grid-column: span 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; border-radius: var(--r-md);
  background: linear-gradient(135deg, #2b9d6c, #1a4f7a); min-height: 240px; position: relative;
}
.liked-tile:hover { text-decoration: none; filter: brightness(1.05); }
.liked-tile h3 { font-size: 30px; font-weight: 800; }
.liked-tile p { color: rgba(255, 255, 255, .85); margin-top: 6px; }

.footer-note { color: var(--text-3); font-size: 12.5px; padding: 40px 0 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  :root { --sidebar-w: 84px; }
  .brand-name, .nav-primary span, .library-title span, .library-head .icon-btn, .lib-item .meta, .library-empty { display: none; }
  .brand { justify-content: center; padding: 10px 6px; }
  .brand-logo { border-radius: 8px; }
  .nav-primary a, .library-title { justify-content: center; padding: 12px; }
  .library-head { justify-content: center; padding: 0; }
  .lib-item { justify-content: center; }
  .track-head, .track { grid-template-columns: 32px minmax(160px, 3fr) minmax(100px, 2fr) 104px; }
}

@media (max-width: 900px) {
  .search-top { grid-template-columns: 1fr; }
  .hero .art { width: 180px; height: 180px; }
}

@media (max-width: 767px) {
  :root { --player-h: 64px; }
  body { font-size: 14.5px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "main";
    padding: 0; gap: 0;
  }
  .sidebar { display: none; }
  .main { border-radius: 0; padding-bottom: calc(var(--player-h) + var(--mobile-nav-h) + 16px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 16px; }
  .topbar-nav .icon-btn[data-action="forward"], .topbar-nav .icon-btn[data-action="back"] { display: none; }
  .topbar-brand { display: block; width: 92px; }
  .topbar-brand img { border-radius: 8px; }
  .auth-logo { max-width: 240px; }
  .view { padding: 0 16px 32px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, rgba(14, 15, 17, .82), var(--bg-0) 45%);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-2); }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav a.active { color: var(--text-1); }
  .mobile-nav a.active svg { color: var(--accent); }
  .mobile-nav svg { width: 24px; height: 24px; }

  .hero { flex-direction: column; align-items: flex-start; margin: -60px -16px 0; padding: 76px 16px 16px; gap: 16px; }
  .hero .art { width: min(58vw, 240px); height: min(58vw, 240px); align-self: center; }
  .hero h1 { font-size: 30px; margin: 2px 0 6px; }
  .action-bar { padding: 16px 0 8px; }
  .shelf { grid-auto-columns: 42%; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-genres { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .genre-tile { font-size: 17px; }
  .section-head h2 { font-size: 19px; }
  .track-head { display: none; }
  .track, .tracks.no-album .track { grid-template-columns: minmax(0, 1fr) auto; padding: 0 4px; height: 60px; gap: 8px; }
  .track .t-num, .track .t-album { display: none; }
  .t-end .dur { display: none; }
  .t-end .like-btn, .t-end .more-btn { opacity: 1; }
  .t-end .like-btn:not(.liked) { display: none; }
  .track:hover { background: transparent; }
  .toasts { bottom: calc(var(--player-h) + var(--mobile-nav-h) + 16px); }
  .liked-tile { grid-column: span 2; min-height: 160px; }
  .auth-card { padding: 28px 20px; border: 0; background: transparent; }
  .panel { padding: 18px; }
}

@media (hover: none) {
  .card .play-fab { display: none; }
}

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

/* ==========================================================================
   Personalised recommendations
   ========================================================================== */

.section-head > div { min-width: 0; }
.section-sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }

/* Explanations ("Because you like …") */
.card-reason {
  margin-top: 6px; font-size: 12px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
}
.card-reason::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; opacity: .8; }
.t-reason { color: var(--accent); font-size: 12px; margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.t-reason::before { content: "· "; color: var(--text-3); }

/* Card controls: Not interested + menu */
.card-dismiss, .card-more {
  position: absolute; top: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(14, 15, 17, .72); color: var(--text-1); opacity: 0; transform: scale(.9);
  transition: opacity .15s var(--ease), transform .15s var(--ease), background .15s; backdrop-filter: blur(4px);
}
.card-dismiss { right: 8px; }
.card-more { left: 8px; }
.card-dismiss svg, .card-more svg { width: 16px; height: 16px; }
.card:hover .card-dismiss, .card:hover .card-more, .card:focus-within .card-dismiss, .card:focus-within .card-more { opacity: 1; transform: none; }
.card-dismiss:hover { background: var(--danger); }
.card-more:hover { background: var(--bg-4); }
@media (hover: none) { .card-dismiss, .card-more { opacity: 1; transform: none; } }

/* Mix tiles */
.mix-art { background: linear-gradient(140deg, var(--mix, #3ddc97), rgba(14, 15, 17, .9) 120%); color: #fff; align-items: end; justify-items: start; }
.mix-covers { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; opacity: .35; mix-blend-mode: luminosity; }
.mix-covers img { width: 100%; height: 100%; object-fit: cover; }
.mix-label {
  position: relative; z-index: 1; margin: 12px; font: 800 22px/1.05 var(--font-display); letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45); overflow-wrap: anywhere;
}
.mix-art::after { content: "MIX"; position: absolute; top: 10px; right: 12px; font: 800 11px var(--font); letter-spacing: .14em; opacity: .85; }

/* Onboarding banner on home */
.taste-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 22px; margin: 4px 0 8px;
  border-radius: var(--r-lg); background: linear-gradient(120deg, rgba(61, 220, 151, .18), rgba(47, 111, 143, .22)); border: 1px solid rgba(61, 220, 151, .25);
}
.taste-banner-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex-shrink: 0; }
.taste-banner-text { flex: 1; min-width: 220px; }
.taste-banner-text h2 { font-size: 20px; }
.taste-banner-text p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.rec-off-note { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; margin: 4px 0 8px; }
.rec-off-note svg { width: 16px; height: 16px; }
.rec-off-note a { color: var(--accent); font-weight: 700; }

/* "Choose your music taste" */
.taste { max-width: 1040px; margin: 0 auto; padding-bottom: 96px; }
.taste-head { margin: 4px 0 20px; }
.taste-head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-top: 14px; }
.taste-kicker { color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.taste-progress { display: flex; gap: 6px; margin-top: 14px; }
.taste-dot { width: 34px; height: 6px; border-radius: 6px; background: var(--bg-4); transition: background .2s, width .2s; }
.taste-dot.done { background: rgba(61, 220, 151, .55); }
.taste-dot.current { background: var(--accent); width: 54px; }
.taste-search { max-width: 460px; margin-top: 0; }
.taste-selected { margin: -6px 0 16px; }
.taste-selected .chip svg { width: 14px; height: 14px; }
.taste-artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.taste-artist {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; border-radius: var(--r-lg);
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.taste-artist:hover { background: var(--bg-2); }
.taste-artist .art { width: 100%; max-width: 120px; aspect-ratio: 1; border-radius: 50%; box-shadow: var(--shadow-1); transition: box-shadow .2s, transform .2s; }
.taste-artist.selected .art { box-shadow: 0 0 0 3px var(--accent), var(--shadow-1); transform: scale(.96); }
.taste-name { font-weight: 700; font-size: 14px; text-align: center; overflow-wrap: anywhere; }
.taste-check {
  position: absolute; top: 12px; right: 18px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease);
}
.taste-check svg { width: 16px; height: 16px; }
.selected > .taste-check { opacity: 1; transform: none; }
.taste-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.taste-tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 104px; padding: 16px; text-align: left;
  border-radius: var(--r-lg); background: linear-gradient(140deg, color-mix(in srgb, var(--tile) 70%, transparent), var(--bg-2));
  background: linear-gradient(140deg, var(--tile), var(--bg-2) 85%); border: 2px solid transparent;
  transition: transform .15s var(--ease), border-color .15s, filter .15s;
}
.taste-tile:hover { transform: translateY(-2px); filter: brightness(1.08); }
.taste-tile.selected { border-color: var(--accent); }
.taste-tile strong { font: 800 18px/1.15 var(--font-display); }
.taste-tile small { color: rgba(255, 255, 255, .78); font-size: 12.5px; }
.taste-tile .taste-check { top: 10px; right: 10px; }
.taste-chips .chip { padding: 10px 16px; font-size: 15px; }
.taste-chips .chip svg { width: 16px; height: 16px; }
.taste-chips .chip small { opacity: .7; font-weight: 600; }
.taste-foot {
  position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 28px; padding: 14px 0; background: linear-gradient(180deg, rgba(22, 24, 27, 0), var(--bg-1) 30%);
}

/* Search */
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 16px; color: var(--text-2); }
.search-filters svg { width: 18px; height: 18px; }
.search-suggest:empty { display: none; }
.search-suggest { margin: -6px 0 14px; }
.did-you-mean { color: var(--text-2); margin-bottom: 10px; }
.link-btn { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.quick-picks { margin: 0; }
.quick-picks .chip small { color: var(--text-2); font-weight: 600; text-transform: capitalize; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chip, var(--accent)); }
.chip-split { padding: 0; overflow: hidden; }
.chip-split > button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; }
.chip-split .chip-x { padding: 6px 10px 6px 6px; color: var(--text-2); }
.chip-split .chip-x:hover { color: var(--text-1); }
.chip-split svg { width: 14px; height: 14px; }
.result-count { margin: -4px 0 8px; font-size: 13.5px; }

/* Toggle switch (shared with admin) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-of-type { border-bottom: 0; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--bg-4); border-radius: 24px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-1); transition: transform .15s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Preferences page */
.pref-panels { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.pref-wide { grid-row: span 2; }
.pref-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: 0; }
.pref-row .chip { cursor: default; }
.pref-head { display: flex; align-items: center; justify-content: space-between; }
.pref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pref-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 6px; border-radius: var(--r-sm); }
.pref-list li:hover { background: var(--bg-3); }
.pref-list li > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pref-list li svg { width: 16px; height: 16px; color: var(--text-3); }
.pref-list small { margin-left: 6px; }
.pref-item .art { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }

@media (max-width: 767px) {
  .taste-artists { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .taste-artist { padding: 10px 4px; }
  .taste-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .taste-tile { min-height: 88px; padding: 12px; }
  .taste-tile strong { font-size: 15px; }
  .taste-foot { position: static; background: none; margin-top: 20px; padding: 0; }
  .taste-foot .toolbar { width: 100%; }
  .taste-foot .toolbar .btn { flex: 1; }
  .taste { padding-bottom: 24px; }
  .taste-banner { padding: 16px; }
  .t-reason { display: none; }
  .pref-wide { grid-row: auto; }
}

/* ---------- First-time onboarding (/welcome) ---------- */
.onboard { max-width: 980px; }
.onboard-steps { display: flex; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; flex-wrap: wrap; }
.onboard-step { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font-size: 13px; font-weight: 700; transition: background .15s, color .15s; }
.onboard-step .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--text-1); font-size: 12px; }
.onboard-step .num svg { width: 14px; height: 14px; }
.onboard-step.done .num { background: rgba(61, 220, 151, .55); color: var(--accent-ink); }
.onboard-step.current { background: var(--accent-soft); color: var(--text-1); }
.onboard-step.current .num { background: var(--accent); color: var(--accent-ink); }
.onboard-step:hover { color: var(--text-1); }
.onboard-body { animation: onboard-in .28s var(--ease); }
@keyframes onboard-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.onboard-hero { max-width: 640px; margin: 8px auto 0; text-align: center; }
.onboard-hero h2 { font-size: clamp(20px, 3vw, 26px); margin: 16px 0 8px; }
.onboard-hero p { color: var(--text-2); }
.onboard-logo { width: 200px; max-width: 60%; border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.onboard-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; text-align: left; }
.onboard-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--bg-2); }
.onboard-list svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.onboard-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-top: 8px; text-align: left; }
.onboard-privacy svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.onboard-form { max-width: 760px; }
.onboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.field label .opt { color: var(--text-3); font-weight: 600; font-size: 12px; margin-left: 4px; }
.input[readonly] { opacity: .75; }
.ok-text, .warn-text { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.ok-text { color: var(--accent); }
.warn-text { color: var(--warn); }
.ok-text svg, .warn-text svg { width: 14px; height: 14px; }
.onboard-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.onboard-section:first-of-type { padding-top: 4px; }
.onboard-section h3 { font-size: 19px; margin-bottom: 4px; }
.onboard-section > .muted { font-size: 14px; margin-bottom: 14px; }
.onboard-section .taste-search { margin: 12px 0 14px; }
.onboard-section-body { margin-top: 12px; }
.listen-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.listen-option { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--bg-2); border: 2px solid transparent; cursor: pointer; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.listen-option:hover { background: var(--bg-3); transform: translateY(-1px); }
.listen-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.listen-option input { position: absolute; opacity: 0; pointer-events: none; }
.listen-option:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.listen-option strong { display: block; font-size: 14.5px; }
.listen-option small { color: var(--text-2); font-size: 12.5px; }
.listen-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); flex-shrink: 0; }
.listen-option.selected .listen-icon { background: var(--accent); color: var(--accent-ink); }
.listen-icon svg { width: 18px; height: 18px; }
.taste-rank { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--bg-0); color: var(--accent); font: 800 12px/1.5 var(--font-display); }
.top3 { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--bg-2); }
.top3 .label { display: flex; align-items: center; gap: 6px; }
.top3 .label svg { width: 15px; height: 15px; color: var(--accent); }
.top3 ol { list-style: none; padding: 0; margin: 10px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.top3 li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--bg-3); font-weight: 700; font-size: 13.5px; }
.top3 li.is-top { background: var(--accent-soft); outline: 1px solid rgba(61, 220, 151, .45); }
.top3 .rank { color: var(--accent); font-weight: 800; }
.top3 li:not(.is-top) .rank { display: none; }
.top3 .hint { font-size: 12.5px; color: var(--text-3); }
.rot90 { transform: rotate(90deg); }
.taste-album .art { border-radius: var(--r-md); }
.taste-album small { font-size: 12px; text-align: center; margin-top: -6px; }
.onboard-review .pref-row p { margin-top: 4px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.onboard-done .onboard-hero { margin-bottom: 24px; }
.done-badge { width: 72px; height: 72px; margin: 8px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); animation: done-pop .45s var(--ease); }
.done-badge svg { width: 36px; height: 36px; }
@keyframes done-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.onboard-done h1 { font-size: clamp(26px, 4vw, 36px); margin: 14px 0 8px; }
.onboard-email-state { display: inline-block; margin-top: 10px; padding: 10px 16px; border-radius: var(--r-lg); background: var(--bg-2); color: var(--text-1) !important; font-size: 14px; }
.onboard-email-state svg { width: 16px; height: 16px; color: var(--accent); vertical-align: -3px; margin-right: 4px; }
.onboard-email-state .link-btn { margin-left: 6px; }
.panel-note { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; margin: -8px 0 14px; }
.panel-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }

/* One-time welcome message after the first sign-in */
.welcome-notice {
  position: fixed; z-index: 90; top: 76px; right: 20px; width: min(420px, calc(100vw - 32px)); display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 14px 16px 16px; border-radius: var(--r-lg); background: linear-gradient(135deg, #12382a, var(--bg-2) 70%); border: 1px solid rgba(61, 220, 151, .35);
  box-shadow: var(--shadow-1); opacity: 0; transform: translateY(-12px) scale(.98); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.welcome-notice.show { opacity: 1; transform: none; }
.welcome-notice-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.welcome-notice h2 { font-size: 17px; margin-bottom: 4px; }
.welcome-notice p { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.welcome-notice-cta { color: var(--accent) !important; font-weight: 700; margin-top: 6px; }
.welcome-notice-close { flex-shrink: 0; margin: -6px -4px 0 0; }

@media (max-width: 767px) {
  .onboard-step .txt { display: none; }
  .onboard-step.current .txt { display: inline; }
  .onboard-step { padding: 4px; }
  .onboard-step.current { padding-right: 12px; }
  .listen-options { grid-template-columns: 1fr; }
  .welcome-notice { top: 12px; right: 16px; left: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .onboard-body, .done-badge { animation: none; }
  .welcome-notice { transition: none; }
}

/* Singer / publisher registration */
.creator-apply { max-width: 860px; margin: 0 auto; padding-bottom: 40px; }
.creator-apply .panel h2 { font-size: 18px; margin: 0 0 14px; }
.creator-apply .chip svg { width: 16px; height: 16px; }
.creator-apply .opt { color: var(--text-3); font-weight: 600; font-size: 12px; margin-left: 4px; }
