/* Dhunne — User Site — shared stylesheet (auth pages + dashboard) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  /* ---- 60-30-10 color system ----
     60% dominant  — #013E37 deep teal. Every large surface (page background, sidebar,
       cards, panels) derives from this, via --surface/--surface-2/--surface-3.
     30% secondary — #FFEFB3 warm butter. The brand/selection color: logo, active states,
       primary buttons, links, "this is selected/on" indicators.
     10% accent    — #FF9B6A warm coral. Chosen as teal's near-complement on the color
       wheel (teal ≈ 172° hue, coral ≈ 19° hue) specifically so it reads as a genuine pop
       against both the dark teal AND the pale butter, rather than blending into either.
       Reserved for the rarest, most important moments — primarily the Play action itself
       (the one verb this whole app exists for) plus likes and "new" badges — never used for
       large surfaces, so it stays a true 10% accent rather than competing with butter. */
  --bg: #013E37; --surface: #0A4B42; --surface-2: #0F574C; --surface-3: #1A6358;
  --border: rgba(255,239,179,0.16); --accent: #FFEFB3; --accent-rgb: 255,239,179; --accent-dim: #F2DE9C; --accent-2: #FF9B6A;
  --text: #FBF6E6; --text-muted: rgba(251,246,230,0.62); --text-dim: rgba(251,246,230,0.36);
  --btn-ink: #013E37; --danger: #FF8A8A; --good: #8FD6C1; --warn: #FFC98A;
  --focus-ring: 0 0 0 3px rgba(var(--accent-rgb), 0.5);
}
*{box-sizing:border-box;}
html, body{ -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; }
input, textarea, [contenteditable="true"]{ -webkit-user-select:text; -moz-user-select:text; -ms-user-select:text; user-select:text; }
html,body{margin:0;padding:0;height:100%;}
body{background:var(--bg); color:var(--text); font-family:'Inter',sans-serif; overflow:hidden;}
::-webkit-scrollbar{width:10px;height:10px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--surface-3); border-radius:6px;}
::-webkit-scrollbar-thumb:hover{background:var(--accent-dim);}
.mono{font-family:'JetBrains Mono', monospace;}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
input, textarea, select{font-family:inherit; color:var(--text); background:var(--surface-2); border:1px solid var(--border); border-radius:999px; padding:10px 16px; font-size:14px;}
input:focus, textarea:focus, select:focus{border-color:var(--accent);}
a{color:inherit;}
.hidden{display:none !important;}

/* ---- Universal focus/hover system ---- */
button, a, input, select, textarea, [tabindex], .focusable{ transition: box-shadow .15s ease, filter .15s ease, transform .15s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, .focusable:focus-visible{ outline:none; box-shadow: var(--focus-ring); }
button:not(:disabled):hover, a:hover, [tabindex]:hover, .focusable:hover{ filter: brightness(1.08); }
.icon-btn:hover, .avatar:hover, .btn:hover, .logout-btn:hover{ transform: scale(1.06); }
input[type="range"]:focus-visible{ box-shadow:none; }
input[type="range"]:focus-visible::-webkit-slider-thumb{ box-shadow: var(--focus-ring); }

/* ---- Auth pages (login / signup) ---- */
.auth-page{ height:100vh; height:100dvh; width:100vw; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 20% 20%, rgba(255,239,179,0.08), transparent 45%), radial-gradient(circle at 80% 75%, rgba(255,155,106,0.08), transparent 40%), var(--bg); }
.auth-card{ width:380px; max-width:92vw; padding:40px 34px; background:var(--surface); border:1px solid var(--border); border-radius:28px; box-shadow:0 30px 80px rgba(0,0,0,0.45); }
.brand{ display:flex; align-items:center; gap:0; margin-bottom:8px; }
.topbar-brand{ display:flex; align-items:center; gap:0; flex-shrink:0; }
.brand-wordmark{ height:26px; width:auto; display:block; flex-shrink:0; border-radius:999px; }
.auth-tag{ color:var(--text-muted); font-size:13px; margin-bottom:28px; line-height:1.5; }
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:12px; color:var(--text-muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.06em; }
.field input{ width:100%; }
.password-field{ position:relative; }
.password-field input{ width:100%; padding-right:42px; }
.password-toggle-btn{ position:absolute; right:4px; top:50%; transform:translateY(-50%); width:32px; height:32px; display:flex; align-items:center; justify-content:center; color:var(--text-dim); border-radius:50%; }
.password-toggle-btn:hover{ color:var(--text); }
.auth-submit{ width:100%; margin-top:10px; padding:12px; border-radius:9px; background:var(--accent); color:var(--btn-ink); font-weight:600; font-size:14px; transition:background .15s; }
.auth-submit:hover{ background:var(--accent-dim); }
.auth-submit:disabled{ opacity:0.6; cursor:default; }
.auth-switch{ margin-top:18px; text-align:center; font-size:13px; color:var(--text-muted); }
.auth-switch a{ color:var(--accent); font-weight:600; }
.auth-error{ color:var(--danger); font-size:13px; margin-top:8px; min-height:16px; }
.auth-note{ margin-top:22px; font-size:11.5px; color:var(--text-dim); line-height:1.5; border-top:1px solid var(--border); padding-top:14px; }

/* ---- OTP verification page ---- */
#otp-confetti-canvas{ position:fixed; top:0; left:0; width:100vw; height:100vh; height:100dvh; pointer-events:none; z-index:1; }
.otp-container{ position:relative; width:100%; max-width:400px; padding:40px 20px; display:flex; flex-direction:column; align-items:center; text-align:center; z-index:10; margin:0 auto; }
.otp-back{ color:var(--text-dim); font-size:12.5px; margin-bottom:18px; display:flex; align-items:center; gap:5px; align-self:flex-start; }
.otp-back:hover{ color:var(--text); }
.otp-brand{ display:flex; align-items:center; gap:0; margin-bottom:20px; }
.otp-title{ font-size:24px; font-weight:600; margin-bottom:12px; font-family:'Fraunces',serif; }
.otp-subtitle{ font-size:14px; color:var(--text-muted); line-height:1.5; margin-bottom:34px; min-height:42px; }
.otp-wrapper{ display:flex; gap:12px; margin-bottom:14px; position:relative; height:64px; justify-content:center; align-items:center; cursor:text; }
.otp-wrapper.shake-error{ animation: otpShake 0.4s; }
@keyframes otpShake{ 0%,100%{transform:translateX(0);} 25%{transform:translateX(-8px);} 75%{transform:translateX(8px);} }
#otp-hidden-input{ position:absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor:text; z-index:2; border:none; background:none; padding:0; }
.otp-visual-container{ display:flex; gap:12px; }
.otp-visual-box{
  width:56px; height:64px; background-color:rgba(255,239,179,0.05); border:1px solid rgba(255,239,179,0.3);
  border-radius:18px; color:var(--accent); font-size:28px; font-weight:500; text-align:center; line-height:64px;
  outline:none; position:relative; transform-origin:center center; opacity:1; transform:translateY(0);
  animation: otpSlideUpFade 0.6s cubic-bezier(0.16,1,0.3,1) backwards;
}
.otp-visual-box:nth-child(1){animation-delay:.1s;} .otp-visual-box:nth-child(2){animation-delay:.2s;}
.otp-visual-box:nth-child(3){animation-delay:.3s;} .otp-visual-box:nth-child(4){animation-delay:.4s;}
@keyframes otpSlideUpFade{0%{transform:translateY(20px);opacity:0;}100%{transform:translateY(0);opacity:1;}}
@keyframes otpTypePop{0%{transform:scale(1);}50%{transform:scale(1.15); border-color:var(--accent);}100%{transform:scale(1);}}
.otp-visual-box.animate-pop{ animation: otpTypePop 0.25s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes otpFocusPulse{0%{box-shadow:0 0 0 0 rgba(255,239,179,0.3);}70%{box-shadow:0 0 0 12px rgba(255,239,179,0);}100%{box-shadow:0 0 0 0 rgba(255,239,179,0);}}
.otp-wrapper:focus-within .otp-visual-box.current-focus{ border-color:var(--accent); animation: otpFocusPulse 1.5s infinite; }
.otp-visual-box.current-focus::after{ content:''; position:absolute; left:calc(50% - 1.5px); top:16px; bottom:16px; width:3px; background-color:var(--accent); animation: otpBlink 1s step-end infinite; border-radius:2px; }
.otp-visual-box.current-focus.filled::after{ display:none; }
@keyframes otpBlink{50%{opacity:0;}}
.otp-error-text{ font-size:12.5px; color:var(--danger); min-height:18px; margin-bottom:6px; }
.otp-footer-text{ font-size:14px; color:var(--text-muted); transition:opacity .5s ease; }
.otp-footer-text span{ color:var(--accent); font-weight:600; cursor:pointer; }
.otp-footer-text span:hover{ opacity:.7; text-decoration:underline; }
.otp-secure-text{ display:none; font-size:14px; color:var(--accent); align-items:center; gap:6px; opacity:0; animation: otpFadeIn .8s ease forwards; }
.otp-secure-text svg{ width:16px; height:16px; }
.otp-success-box{ position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) scale(0); width:64px; height:64px; background-color:rgba(255,239,179,0.05); border:2px solid var(--accent); border-radius:18px; display:flex; justify-content:center; align-items:center; opacity:0; z-index:5; }
.otp-success-box svg{ width:32px; height:32px; color:var(--accent); stroke-dasharray:50; stroke-dashoffset:50; }
.otp-wrapper.animating .otp-visual-box{ animation-duration:1.2s; animation-timing-function:cubic-bezier(0.4,0,0.2,1); animation-fill-mode:forwards; pointer-events:none; }
.otp-wrapper.animating .otp-visual-box:nth-child(1){animation-name:otpCollapse1; animation-delay:0s;}
.otp-wrapper.animating .otp-visual-box:nth-child(2){animation-name:otpCollapse2; animation-delay:.15s;}
.otp-wrapper.animating .otp-visual-box:nth-child(3){animation-name:otpCollapse3; animation-delay:.3s;}
.otp-wrapper.animating .otp-visual-box:nth-child(4){animation-name:otpCollapse4; animation-delay:.45s;}
@keyframes otpCollapse1{40%{transform:translate(40px,-20px) rotate(45deg) scale(.8); opacity:.8;}100%{transform:translate(102px,0) rotate(90deg) scale(0); opacity:0;}}
@keyframes otpCollapse2{40%{transform:translate(15px,-20px) rotate(45deg) scale(.8); opacity:.8;}100%{transform:translate(34px,0) rotate(90deg) scale(0); opacity:0;}}
@keyframes otpCollapse3{40%{transform:translate(-15px,-20px) rotate(45deg) scale(.8); opacity:.8;}100%{transform:translate(-34px,0) rotate(90deg) scale(0); opacity:0;}}
@keyframes otpCollapse4{40%{transform:translate(-40px,-20px) rotate(45deg) scale(.8); opacity:.8;}100%{transform:translate(-102px,0) rotate(90deg) scale(0); opacity:0;}}
.otp-success-box.show{ animation: otpPopIn .8s cubic-bezier(0.175,0.885,0.32,1.275) forwards; }
.otp-success-box.show svg{ animation: otpDrawCheck .6s ease forwards; animation-delay:.4s; }
@keyframes otpPopIn{0%{transform:translate(-50%,-50%) scale(0); opacity:0;}100%{transform:translate(-50%,-50%) scale(1); opacity:1;}}
@keyframes otpDrawCheck{to{stroke-dashoffset:0;}}
@keyframes otpFadeIn{to{opacity:1;}}

/* ---- Dashboard shell ---- */
#dashboard-root{ height:100vh; height:100dvh; width:100vw; display:none; flex-direction:column; }
.shell{ flex:1; display:flex; min-height:0; }
.sidebar{ width:250px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:20px 14px; transition:width .18s, padding .18s; overflow-x:hidden; overflow-y:auto; }
.sidebar.collapsed{ width:0; padding-left:0; padding-right:0; border-right:none; }
.sidebar .brand{ padding:0 6px 22px 6px; }
.sidebar 
.nav-item{ display:flex; align-items:center; gap:12px; padding:9px 12px; border-radius:8px; font-size:14px; font-weight:500; color:var(--text-muted); margin-bottom:2px; width:100%; text-align:left; }
.nav-item svg{ flex-shrink:0; }
.nav-item:hover{ color:var(--text); background:var(--surface-2); }
.nav-item.active{ color:var(--accent); background:var(--surface-2); }
.sidebar-divider{ height:1px; background:var(--border); margin:16px 6px; }
.sidebar-section-title{ font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-dim); padding:0 12px; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center; }
.new-playlist-btn{ color:var(--accent); font-size:16px; line-height:1; }
.playlist-list{ overflow-y:auto; flex:1; min-height:0; }
.playlist-item{ display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:8px; width:100%; text-align:left; font-size:13.5px; color:var(--text-muted); }
.playlist-item:hover{ color:var(--text); background:var(--surface-2); }
.playlist-item.active{ color:var(--text); background:var(--surface-2); }
.playlist-swatch{ width:26px; height:26px; border-radius:5px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:var(--btn-ink); }
.playlist-item span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user{ margin-top:10px; padding:10px 8px; border-top:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.avatar{ width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg, var(--accent), var(--accent-2)); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; color:var(--btn-ink); flex-shrink:0; }
.sidebar-user-name{ font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user-handle{ font-size:11px; color:var(--text-dim); }
.logout-btn{ margin-left:auto; color:var(--text-dim); font-size:11px; padding:4px 8px; border-radius:6px; }
.logout-btn:hover{ color:var(--danger); background:var(--surface-2); }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{ display:flex; align-items:center; gap:10px; padding:16px 28px; border-bottom:1px solid var(--border); background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent); }
.topbar-menu-btn{ width:34px; height:34px; flex-shrink:0; }
.topbar-spacer{ flex:1; }
.search-wrap{ position:relative; display:flex; align-items:center; flex-shrink:0; }
.search-toggle-btn{ width:34px; height:34px; flex-shrink:0; }
.search-box{ display:flex; align-items:center; gap:10px; background:var(--surface-2); border:1px solid var(--border); border-radius:999px; padding:13px 20px; margin:0; overflow:hidden; box-sizing:border-box;
  transition: width .2s ease, opacity .2s ease, padding .2s ease, border-color .2s ease; }
.search-box:focus-within{ border-color: var(--accent); box-shadow: none !important; }
.search-box.collapsed{ width:0; padding:0; margin:0; border-color:transparent; opacity:0; pointer-events:none; }
.search-box.expanded{ width:360px; opacity:1; }
/* Between the mobile breakpoint and a full-width desktop, the sidebar is still fully visible
   (unlike on mobile, where it collapses) but the topbar itself has much less room than on a
   wide desktop — a fixed 280px box was overflowing into the avatar here. Letting the wrap
   shrink and capping the box to whatever room it actually has fixes that without touching
   the mobile-specific calc() sizing below, which was already correct. */
@media (min-width: 761px) and (max-width: 1100px){
  .search-wrap{ min-width:0; flex-shrink:1; }
  .search-box{ max-width:100%; }
}
.search-box input{ background:transparent !important; border:none !important; outline:none !important; box-shadow:none !important; padding:0; margin:0; flex:1; width:100%; border-radius:0; font-size:16px; min-width:0;
  -webkit-appearance:none; -moz-appearance:none; appearance:none; }
#global-search, #guest-search,
#global-search:focus, #global-search:focus-visible, #global-search:hover, #global-search:active,
#guest-search:focus, #guest-search:focus-visible, #guest-search:hover, #guest-search:active{ outline:none !important; box-shadow:none !important; border:none !important; -webkit-appearance:none !important; }
.search-box svg{ color:var(--text-dim); flex-shrink:0; }
.topbar-profile-wrap{ position:relative; flex-shrink:0; }
.topbar-profile-btn{ border:2px solid transparent; padding:0; }
.topbar-profile-btn:hover{ border-color:var(--accent); }
.topbar-profile-menu{ display:none; position:absolute; top:44px; right:0; background:var(--surface-3); border:1px solid var(--border); border-radius:18px; padding:12px 14px; min-width:180px; z-index:30; box-shadow:0 12px 30px rgba(0,0,0,0.5); }
.topbar-profile-menu.open{ display:block; }
.topbar-profile-name{ font-size:13.5px; font-weight:700; }
.topbar-profile-handle{ font-size:11.5px; color:var(--text-dim); margin-bottom:10px; }
.topbar-profile-signout{ width:100%; text-align:left; font-size:12.5px; color:var(--danger); padding:7px 8px; border-radius:6px; }
.topbar-profile-signout:hover{ background:var(--surface-2); }

.btn{ padding:9px 16px; border-radius:8px; font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:7px; }
.btn-accent{ background:var(--accent); color:var(--btn-ink); }
.btn-accent:hover{ background:var(--accent-dim); }
.btn-ghost{ background:var(--surface-2); color:var(--text); border:1px solid var(--border); }
.btn-ghost:hover{ background:var(--surface-3); }
.btn-danger-ghost{ background:transparent; color:var(--danger); border:1px solid rgba(255,138,138,0.4); }
.btn-sm{ padding:6px 11px; font-size:12px; }
.btn-danger-ghost:hover{ background:rgba(255,138,138,0.1); }

.content{ flex:1; overflow-y:auto; padding:26px 28px 30px 28px; }
.view-title{ font-family:'Fraunces', serif; font-size:26px; font-weight:600; margin:0 0 4px 0; }
.view-sub{ color:var(--text-muted); font-size:13.5px; margin:0 0 22px 0; }
.section-label{ font-size:14px; font-weight:700; margin:26px 0 12px 0; display:flex; align-items:center; gap:8px; }
.section-label .num{ color:var(--accent); font-family:'JetBrains Mono', monospace; font-size:12px; }

.chip-row{ display:flex; gap:8px; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; margin-bottom:22px; scrollbar-width:none; -ms-overflow-style:none; }
.chip-row::-webkit-scrollbar{ display:none; height:0; }
.chip{ padding:7px 14px; border-radius:20px; font-size:12.5px; font-weight:600; background:var(--surface-2); border:1px solid var(--border); color:var(--text-muted); white-space:nowrap; flex-shrink:0; }
.chip:hover{ color:var(--text); background:var(--surface-3); }
.chip.active{ background:var(--accent); color:var(--btn-ink); border-color:var(--accent); }

.hero-banner{ display:flex; gap:22px; align-items:center; background:linear-gradient(120deg, var(--surface-2), var(--surface)); border:1px solid var(--border); border-radius:28px; padding:22px; margin-bottom:28px; cursor:pointer; transition:background .15s; }
.hero-banner:hover{ background:var(--surface-3); }
.hero-cover-wrap{ flex-shrink:0; }
.hero-cover{ width:120px; height:120px; border-radius:20px; object-fit:cover; box-shadow:0 16px 40px rgba(0,0,0,0.4); }
.hero-cover-fallback{ width:120px; height:120px; border-radius:20px; display:flex; align-items:center; justify-content:center; font-size:40px; color:var(--text-dim); box-shadow:0 16px 40px rgba(0,0,0,0.4); }
.hero-info{ min-width:0; }
.hero-kicker{ font-size:11.5px; text-transform:uppercase; letter-spacing:0.1em; color:var(--accent); font-weight:700; margin-bottom:6px; }
.hero-title{ font-family:'Fraunces',serif; font-size:26px; font-weight:600; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hero-sub{ font-size:13.5px; color:var(--text-muted); margin-bottom:14px; }

.track-table{ width:100%; border-collapse:collapse; }
.track-row{ display:grid; grid-template-columns: 34px 1fr 150px 90px 40px; gap:14px; align-items:center; padding:9px 10px; border-radius:8px; cursor:pointer; }
.track-row:hover{ background:var(--surface-2); }
.track-row.playing{ background:rgba(255,239,179,0.07); }
.track-idx{ color:var(--text-dim); font-family:'JetBrains Mono', monospace; font-size:12.5px; text-align:center; }
.track-row.playing .track-idx{ color:var(--accent); }
.track-main{ display:flex; align-items:center; gap:12px; min-width:0; }
.track-cover{ width:42px; height:42px; border-radius:10px; object-fit:cover; flex-shrink:0; background:var(--surface-3); }
.track-cover-fallback{ width:42px; height:42px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:var(--surface-3); color:var(--text-dim); font-size:16px; }
.track-titles{ min-width:0; }
.track-title{ font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.track-row.playing .track-title{ color:var(--accent); }
.track-artist{ font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.track-album{ font-size:12.5px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.track-dur{ font-family:'JetBrains Mono', monospace; font-size:11.5px; color:var(--text-dim); text-align:right; }
.track-actions{ display:flex; align-items:center; gap:6px; justify-content:flex-end; position:relative; }
.icon-btn{ width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; color:var(--text-dim); flex-shrink:0; }
.icon-btn:hover{ background:var(--surface-3); color:var(--text); }
.icon-btn.liked{ color:var(--accent-2); }
.track-menu{ position:absolute; top:32px; right:0; background:var(--surface-3); border:1px solid var(--border); border-radius:16px; z-index:20; min-width:170px; box-shadow:0 12px 30px rgba(0,0,0,0.5); padding:6px; }
.track-menu button{ display:flex; width:100%; text-align:left; padding:8px 10px; font-size:12.5px; border-radius:6px; color:var(--text); }
.track-menu button:hover{ background:var(--surface-2); }
.track-menu-header{ font-size:10.5px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-dim); padding:6px 10px 4px 10px; }
.new-badge{ position:absolute; top:8px; left:8px; background:var(--accent-2); color:var(--btn-ink); font-size:10px; font-weight:800; letter-spacing:0.04em; padding:3px 8px; border-radius:10px; text-transform:uppercase; box-shadow:0 4px 10px rgba(0,0,0,0.35); }
.trending-badge{ background:var(--accent); }

.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(130px,150px)); gap:16px; justify-content:start; }
.grid-card{ background:var(--surface); border:1px solid var(--border); border-radius:24px; padding:12px; transition:background .15s; }
.grid-card.borderless{ border:none; box-shadow:none; background:transparent; }
.grid-card.borderless:hover{ background:var(--surface-2); }
.grid-card:hover{ background:var(--surface-2); }
.grid-cover-wrap{ position:relative; margin-bottom:10px; }
.grid-cover{ width:100%; aspect-ratio:1/1; border-radius:16px; object-fit:cover; background:var(--surface-3); display:block; }
.grid-cover-fallback{ width:100%; aspect-ratio:1/1; border-radius:16px; background:var(--surface-3); display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:30px; }
.grid-play{ position:absolute; bottom:8px; right:8px; width:38px; height:38px; border-radius:50%; background:var(--accent-2); display:flex; align-items:center; justify-content:center; color:var(--btn-ink); opacity:0; transform:translateY(6px); transition:all .15s; box-shadow:0 6px 16px rgba(0,0,0,0.4); }
.grid-card:hover .grid-play{ opacity:1; transform:translateY(0); }
.grid-title{ font-size:13.5px; font-weight:600; margin-bottom:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.grid-sub{ font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.empty-state{ text-align:center; padding:60px 20px; color:var(--text-muted); }
.empty-state .glyph{ font-size:34px; margin-bottom:10px; opacity:0.6; }
.empty-state .msg{ font-size:14px; margin-bottom:4px; color:var(--text); }
.empty-state .sub{ font-size:12.5px; }

.playlist-header{ display:flex; gap:22px; align-items:flex-end; margin-bottom:26px; }
.playlist-cover-big{ width:150px; height:150px; border-radius:24px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:52px; font-weight:700; color:var(--btn-ink); box-shadow:0 16px 40px rgba(0,0,0,0.4); }
.playlist-kicker{ font-size:11.5px; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); margin-bottom:6px; }
.playlist-name-input{ font-family:'Fraunces', serif; font-size:32px; font-weight:600; background:none; border:none; padding:2px 0; width:100%; border-bottom:2px solid transparent; }
.playlist-name-input:focus{ border-bottom:2px solid var(--accent); }
.playlist-meta{ font-size:13px; color:var(--text-muted); margin-top:8px; }

.now-bar{ flex-shrink:0; background:var(--surface); border-top:1px solid var(--border); display:flex; flex-direction:column; padding-bottom:env(safe-area-inset-bottom, 0px); }
.now-bar-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 16px 10px 16px; }
.np-track{ cursor:pointer; display:flex; align-items:center; gap:10px; min-width:0; flex:1; }
.np-title-marquee{ min-width:0; flex:1; overflow:hidden; white-space:nowrap; position:relative; }
.np-title-marquee-inner{ display:inline-block; font-size:13.5px; font-weight:600; white-space:nowrap; }
.np-title-marquee.overflowing .np-title-marquee-inner{ animation: npMarquee linear infinite; }
.np-marquee-gap{ display:inline-block; width:36px; }
@keyframes npMarquee{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
.np-cover{ width:40px; height:40px; border-radius:10px; object-fit:cover; flex-shrink:0; }
.np-cover-fallback{ width:40px; height:40px; border-radius:10px; background:var(--surface-3); display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:16px; flex-shrink:0; }
.np-titles{ min-width:0; overflow:hidden; }
.np-title{ font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-artist{ font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-buttons{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.np-buttons button{ color:var(--text-muted); }
.np-buttons button:hover{ color:var(--text); }
.np-buttons button.on{ color:var(--accent); }
.np-play{ width:32px; height:32px; border-radius:50%; background:var(--accent-2); color:var(--btn-ink); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.np-play:hover{ transform:scale(1.06); }
.np-progress{ display:flex; align-items:center; gap:10px; width:100%; }
.np-progress .t{ font-size:10.5px; color:var(--text-dim); font-family:'JetBrains Mono', monospace; width:32px; flex-shrink:0; }
.np-progress .t.end{ text-align:right; }
.seek{ flex:1; -webkit-appearance:none; appearance:none; height:20px; background:transparent; outline:none !important; border:none !important; cursor:pointer; }
/* The visual line lives on the track pseudo-elements, not the input itself — this keeps the
   actual clickable/draggable hit area a comfortable 20px tall while the line drawn on screen
   stays hairline-thin (1px), so thinning the line never shrinks how easy it is to grab. */
.seek:focus, .seek:focus-visible, .seek:hover, .seek:active{ outline:none !important; border:none !important; box-shadow:none !important; }
.seek::-webkit-slider-runnable-track{ height:2px; border-radius:1px; border:none !important;
  background:linear-gradient(to right, var(--accent) var(--fill-pct, 0%), var(--surface-3) var(--fill-pct, 0%)); }
.seek::-webkit-slider-thumb{ -webkit-appearance:none; width:2px; height:2px; border-radius:1px; background:transparent; border:none; cursor:pointer; box-shadow:none; margin-top:0; }
.seek::-moz-range-thumb{ width:2px; height:2px; border-radius:1px; background:transparent; border:none; cursor:pointer; box-shadow:none; }
.seek::-moz-range-track{ height:2px; border-radius:1px; border:none !important;
  background:linear-gradient(to right, var(--accent) var(--fill-pct, 0%), var(--surface-3) var(--fill-pct, 0%)); }
.seek::-moz-range-progress{ display:none; } /* Firefox's own native fill layer — fully hidden (not just transparent) so no default border/groove can show; the gradient above is the only fill drawn */
.seek::-moz-focus-outer{ border:0 !important; }
input[type="range"].seek:focus-visible{ box-shadow:none !important; } /* overrides the site-wide focus-ring rule specifically for this control — a focus ring would look odd on an invisible thumb */

/* ---- Volume popup (mini player) ---- */
.volume-popup-wrap{ position:relative; flex-shrink:0; }
.volume-popup{
  position:absolute; bottom:46px; right:0; width:230px;
  background:var(--surface-3); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,0.5); z-index:300; padding:14px;
  transform-origin: bottom right; transform:scale(0.85); opacity:0; pointer-events:none;
  transition: transform .18s cubic-bezier(0.16,1,0.3,1), opacity .15s ease;
}
.volume-popup.open{ transform:scale(1); opacity:1; pointer-events:auto; }
.volume-popup-header{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:9px; }
.volume-popup-slider-row{ display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.volume-popup-slider-row input[type="range"]{ flex:1; -webkit-appearance:none; appearance:none; height:2px; border-radius:1px; outline:none; border:none; cursor:pointer;
  background:linear-gradient(to right, var(--accent) var(--fill-pct, 0%), var(--surface-2) var(--fill-pct, 0%)); }
.volume-popup-slider-row input[type="range"]::-webkit-slider-runnable-track{ height:2px; border-radius:1px; background:transparent; border:none; }
.volume-popup-slider-row input[type="range"]::-webkit-slider-thumb{ -webkit-appearance:none; width:10px; height:10px; border-radius:50%; background:var(--text); cursor:pointer; margin-top:-4px; box-shadow:0 1px 3px rgba(0,0,0,0.4); }
.volume-popup-slider-row input[type="range"]::-moz-range-thumb{ width:10px; height:10px; border-radius:50%; background:var(--text); border:none; cursor:pointer; box-shadow:0 1px 3px rgba(0,0,0,0.4); }
.volume-popup-slider-row input[type="range"]::-moz-range-track{ height:2px; border-radius:1px; border:none;
  background:linear-gradient(to right, var(--accent) var(--fill-pct, 0%), var(--surface-2) var(--fill-pct, 0%)); }
.volume-popup-slider-row input[type="range"]::-moz-range-progress{ display:none; }
.volume-popup-divider{ height:1px; background:var(--border); margin:12px 0 10px 0; }
.volume-device-row{ display:flex; align-items:center; gap:9px; padding:7px 4px; font-size:12.5px; color:var(--text-muted); border-radius:8px; }
.volume-device-row.active{ color:var(--text); }
.volume-device-row svg{ flex-shrink:0; color:var(--text-dim); }
.volume-device-row.active svg{ color:var(--accent); }

/* ---- Full-screen Now Playing view ---- */
#now-playing-screen{
  position:fixed; inset:0; z-index:300; display:flex; flex-direction:column;
  background: var(--bg); /* fallback — overridden per-track via inline style when a color can be read from the cover art */
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(0.4,0,0.2,1), background .5s ease;
  pointer-events: none;
}
#now-playing-screen.open{ transform: translateY(0); pointer-events: auto; }
.np-screen-content{ flex:1; display:flex; flex-direction:column; min-height:0; max-width:520px; width:100%; margin:0 auto; padding:0 20px; }
.np-screen-topbar{ display:flex; align-items:center; justify-content:space-between; padding:18px 0 6px 0; flex-shrink:0; }
.np-screen-source{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); }
.np-screen-body{ flex:1; min-height:0; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding:10px 0 20px 0; overflow-y:auto; overflow-x:hidden; }
.np-player-panel{ display:flex; flex-direction:column; align-items:center; text-align:center; width:100%; }
.np-screen-cover-wrap{ width:min(78vw, 340px); margin-bottom:26px; }
.np-screen-cover{ width:100%; aspect-ratio:1/1; border-radius:24px; overflow:hidden; box-shadow:0 8px 24px rgba(0,0,0,0.2); background:var(--surface-2); display:flex; align-items:center; justify-content:center; }
.np-screen-cover img, .np-screen-cover video{ width:100%; height:100%; object-fit:cover; display:block; }
.np-screen-cover .np-screen-cover-fallback{ font-size:64px; color:var(--text-dim); }
.np-screen-title{ font-family:'Fraunces',serif; font-size:24px; font-weight:600; margin-bottom:4px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-screen-artist{ font-size:14px; color:var(--text-muted); }
.np-skeleton-block{ display:none; flex-direction:column; align-items:center; width:100%; }
.np-player-panel.skeleton .np-screen-cover-wrap,
.np-player-panel.skeleton .np-screen-title,
.np-player-panel.skeleton .np-screen-artist{ display:none; }
.np-player-panel.skeleton .np-skeleton-block{ display:flex; }
.np-skeleton-cover{ width:min(78vw, 340px); aspect-ratio:1/1; border-radius:16px; margin-bottom:26px; background:linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size:200% 100%; animation:npShimmer 1.6s ease-in-out infinite; }
.np-skeleton-line{ height:16px; border-radius:6px; background:linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size:200% 100%; animation:npShimmer 1.6s ease-in-out infinite; }
.np-skeleton-title{ width:200px; margin-bottom:10px; }
.np-skeleton-artist{ width:130px; height:12px; }
@keyframes npShimmer{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }
.np-screen-controls.skeleton .np-screen-progress{ opacity:0.4; pointer-events:none; }

.np-queue-panel{
  position:absolute; inset:0; background:var(--surface); border-radius:24px 24px 0 0; padding:18px 4px 10px 4px;
  display:flex; flex-direction:column; transform:translateY(100%); transition:transform .25s ease; z-index:5;
}
#now-playing-screen.queue-open .np-queue-panel{ transform:translateY(0); }
#now-playing-screen.browsing .np-queue-panel{
  position:static; transform:none; border-radius:20px; box-shadow:none;
  margin-top:24px; width:min(520px, 92vw); flex:1; min-height:320px;
}
#now-playing-screen.browsing .np-screen-body{ justify-content:flex-start; }
#now-playing-screen.browsing #np-screen-list-btn{ display:none; } /* list is always visible in browse mode — no toggle needed */
/* Wide screens: true two-column layout matching the reference — song list always visible on
   the left, player fixed on the right — for both normal (mini-bar) and browse (album/playlist)
   entry points alike, since there's finally room for both at once. */
@media (min-width: 900px){
  .np-screen-content{ max-width:1100px; }
  .np-screen-body{ flex-direction:row; align-items:stretch; justify-content:center; gap:48px; overflow:visible; padding:24px 0; }
  .np-queue-panel{
    position:static !important; transform:none !important; width:400px; flex:0 0 400px; order:-1;
    border-radius:20px; box-shadow:none; margin-top:0; max-height:100%;
  }
  .np-player-panel{ flex:0 1 420px; align-self:center; margin:0; }
  #np-screen-list-btn{ display:none; } /* the list is always visible now — no toggle needed, any mode */
  .np-screen-controls{ width:868px; max-width:100%; margin:0 auto; } /* matches .np-screen-body's natural width (400px list + 48px gap + 420px player) so the block below lines up the same way */
  .np-screen-controls .np-screen-row1,
  .np-screen-controls .np-screen-progress,
  .np-screen-controls .np-screen-buttons{ width:420px; margin-left:auto; margin-right:0; } /* right-aligned under the player column */
}
.np-queue-header{ display:flex; align-items:center; justify-content:space-between; padding:0 16px 12px 16px; flex-shrink:0; }
.np-queue-order{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--text-muted); }
.np-queue-position{ font-family:'JetBrains Mono', monospace; font-size:12px; color:var(--text-dim); }
.np-queue-list{ flex:1; overflow-y:auto; padding:0 8px; }
.np-queue-row{ display:flex; align-items:center; gap:12px; padding:8px 8px; border-radius:8px; cursor:pointer; }
.np-queue-row:hover{ background:var(--surface-2); }
.np-queue-row.playing{ background:rgba(255,239,179,0.07); }
.np-queue-row.playing .np-queue-row-title{ color:var(--accent); }
.np-queue-row-cover{ width:40px; height:40px; border-radius:10px; object-fit:cover; flex-shrink:0; background:var(--surface-3); }
.np-queue-row-cover-fallback{ width:40px; height:40px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:var(--surface-3); color:var(--text-dim); font-size:14px; }
.np-queue-row-titles{ min-width:0; flex:1; }
.np-queue-row-title{ font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.np-queue-row-artist{ font-size:11.5px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.np-screen-controls{ flex-shrink:0; padding-bottom:26px; }
.np-screen-row1{ display:flex; align-items:center; justify-content:space-between; max-width:220px; margin:0 auto 20px auto; }
.np-screen-row1 .icon-btn.liked{ color:var(--accent-2); }
.np-screen-progress{ margin-bottom:14px; }
.np-screen-progress .seek{ width:100%; }
.np-screen-times{ display:flex; justify-content:space-between; font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-dim); margin-top:6px; }
.np-screen-buttons{ display:flex; align-items:center; justify-content:center; gap:30px; }
.np-screen-buttons button{ color:var(--text-muted); }
.np-screen-buttons button:hover{ color:var(--text); }
.np-screen-buttons button.on{ color:var(--accent); }
.np-screen-play{ width:56px; height:56px; border-radius:50%; background:var(--accent-2); color:var(--btn-ink); display:flex; align-items:center; justify-content:center; }
.np-screen-play:hover{ transform:scale(1.05); color:var(--bg); }

@media (max-width: 480px){
  .np-screen-cover-wrap{ width:82vw; }
}

/* ---- Playlist cover (custom upload or default to the first track's art) ---- */
.playlist-cover-big{ overflow:hidden; cursor:pointer; position:relative; }
.playlist-cover-big img{ width:100%; height:100%; object-fit:cover; }
.playlist-cover-big .cover-edit-hint{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(1,62,55,0.55); opacity:0; transition:opacity .15s; font-size:11.5px; font-weight:700; color:var(--accent); text-align:center; padding:8px; }
.playlist-cover-big:hover .cover-edit-hint{ opacity:1; }
.playlist-swatch{ overflow:hidden; }
.playlist-swatch img{ width:100%; height:100%; object-fit:cover; }

/* =========================================================================================
   GUEST LANDING PAGE (index.html) — reuses every token, .chip/.chip-row, .grid/.grid-card,
   .btn, .icon-btn, .search-wrap/.search-box, .np-* player classes, .toast/.page-loader and
   the focus/hover system above. Nothing here overrides an existing rule; it only adds the
   pieces that page needs and doesn't already have (header chrome, ad slot, music-list rows,
   the restricted mini bar, and the sign-in popup).
   ========================================================================================= */
#guest-root{ height:100vh; height:100dvh; width:100vw; display:none; flex-direction:column; overflow:hidden; }
.guest-header{ display:flex; align-items:center; gap:12px; padding:14px 28px; border-bottom:1px solid var(--border); background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent); flex-shrink:0; }
.guest-header .topbar-brand{ display:flex; align-items:center; gap:0; text-decoration:none; }
.guest-lang-btn{ display:flex; align-items:center; gap:6px; width:auto; padding:0 10px; font-size:12.5px; font-weight:600; }
.guest-mobile-menu{ display:none; flex-direction:column; gap:4px; padding:10px 28px 16px 28px; border-bottom:1px solid var(--border); background:var(--surface); flex-shrink:0; }
.guest-mobile-menu.open{ display:flex; }
.guest-mobile-menu a, .guest-mobile-menu button{ padding:9px 10px; border-radius:8px; font-size:13.5px; font-weight:500; color:var(--text-muted); text-align:left; text-decoration:none; }
.guest-mobile-menu a:hover, .guest-mobile-menu button:hover{ color:var(--text); background:var(--surface-2); }

.guest-main{ flex:1; overflow-y:auto; padding:22px 28px 120px 28px; }
.guest-section{ margin-bottom:32px; }
.guest-section-header{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px; }
.guest-section-header h2{ font-family:'Fraunces',serif; font-size:20px; font-weight:600; margin:0; }
.card-row{ display:flex; gap:16px; overflow-x:auto; overflow-y:hidden; padding-bottom:6px; scrollbar-width:none; -ms-overflow-style:none; }
.card-row::-webkit-scrollbar{ display:none; height:0; }
.card-row .grid-card{ flex:0 0 145px; }

.ad-slot{ border-radius:24px; overflow:hidden; margin-bottom:32px; background:var(--surface); border:1px solid var(--border); }
.ad-slot img, .ad-slot video{ width:100%; max-height:220px; object-fit:cover; display:block; }
.ad-slot a{ display:block; }

.guest-music-list{ display:grid; grid-template-columns:1fr; gap:2px 24px; }
@media (min-width: 760px){ .guest-music-list.two-col{ grid-template-columns:1fr 1fr; } }
.guest-music-row{ display:flex; align-items:center; gap:12px; padding:8px; border-radius:8px; cursor:pointer; }
.guest-music-row:hover{ background:var(--surface-2); }
.guest-music-row .track-cover, .guest-music-row .track-cover-fallback{ width:46px; height:46px; }
.guest-music-row-titles{ min-width:0; flex:1; }
.guest-music-row-title{ font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.guest-music-row-artist{ font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Restricted mini player: no queue, no like/add, and it does not expand — tapping it opens
   the sign-in popup instead, since the full Now Playing screen is an account feature. */
.guest-now-bar{
  display:none; align-items:center; gap:16px; height:76px; flex-shrink:0; background:var(--surface); border-top:1px solid var(--border);
  padding:0 20px; cursor:pointer; padding-bottom:env(safe-area-inset-bottom, 0px);
}
.guest-now-bar.visible{ display:flex; }
.guest-now-bar .np-controls{ display:flex; flex-direction:column; align-items:center; gap:6px; flex:1; max-width:420px; width:100%; }
.guest-seek-track{ flex:1; height:4px; border-radius:2px; background:var(--surface-3); overflow:hidden; }
.guest-seek-fill{ height:100%; width:0%; background:var(--accent); transition:width .2s linear; }

.guest-popup-backdrop{ display:none; position:fixed; inset:0; z-index:500; background:rgba(1,15,13,0.72); align-items:center; justify-content:center; padding:20px; }
.guest-popup-backdrop.open{ display:flex; }
.guest-popup{ position:relative; width:380px; max-width:100%; background:var(--surface); border:1px solid var(--border); border-radius:28px; padding:34px 30px 26px 30px; text-align:center; box-shadow:0 30px 80px rgba(0,0,0,0.5); }
.guest-popup-close{ position:absolute; top:14px; right:14px; }
.guest-popup-title{ font-family:'Fraunces',serif; font-size:22px; font-weight:600; margin:0 0 8px 0; }
.guest-popup-sub{ font-size:13.5px; color:var(--text-muted); line-height:1.5; margin:0 0 22px 0; }
.guest-popup-btn{ display:flex; align-items:center; justify-content:center; width:100%; margin-bottom:10px; }
.guest-popup-skip{ font-size:12.5px; color:var(--text-dim); margin-top:6px; }
.guest-popup-skip:hover{ color:var(--text-muted); }

@media (max-width: 760px){
  .guest-header{ padding:12px 16px; gap:8px; }
  .guest-header .brand-wordmark{ height:20px; } /* shrink rather than hide — it's the only logo element now that the icon is gone */
  .guest-main{ padding:18px 16px 120px 16px; }
  .card-row .grid-card{ flex-basis:118px; }
}

/* ---- Language selection popup ---- */
.lang-popup-wrap{ position:relative; }
.lang-popup{
  position:fixed; top:58px; right:96px; width:290px; max-height:380px; overflow-y:auto;
  background:var(--surface-3); border:1px solid var(--border); border-radius:18px;
  box-shadow:0 20px 50px rgba(0,0,0,0.5); z-index:300; padding:10px;
  transform-origin: top right; transform:scale(0.85); opacity:0; pointer-events:none;
  transition: transform .18s cubic-bezier(0.16,1,0.3,1), opacity .15s ease;
}
.lang-popup.open{ transform:scale(1); opacity:1; pointer-events:auto; }
.lang-popup-header{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); padding:6px 8px 10px 8px; display:flex; justify-content:space-between; align-items:center; }
#lang-popup-count{ color:var(--accent); font-family:'JetBrains Mono', monospace; font-size:11px; }
.lang-table{ width:100%; border-collapse:collapse; }
.lang-table tr{ cursor:pointer; }
.lang-table tr td{ padding:8px; font-size:13px; border-radius:8px; transition:background .1s; }
.lang-table tr:hover td{ background:var(--surface-2); }
.lang-table td.lang-check{ width:22px; padding-right:2px; }
.lang-checkbox{ width:17px; height:17px; border-radius:5px; border:1.5px solid var(--text-dim); display:flex; align-items:center; justify-content:center; color:var(--btn-ink); }
.lang-table tr.selected .lang-checkbox{ background:var(--accent); border-color:var(--accent); }
@media (max-width: 760px){
  .lang-popup-wrap{ display:none; } /* the mobile menu's own "Choose languages" button opens the same popup */
  .lang-popup{ top:auto; bottom:16px; left:16px; right:16px; width:auto; transform-origin:bottom center; }
}

/* ---- Server-driven home sections (table card + raw card, from home-sections.js) ---- */
.hs-section{ margin-bottom:30px; }
.hs-section-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:12px; }
.hs-section-title{ font-family:'Fraunces',serif; font-size:18px; font-weight:600; margin:0; }
.hs-table-grid{ display:grid; grid-template-columns:1fr; gap:2px 24px; }
@media (min-width: 760px){ .hs-table-grid{ grid-template-columns:1fr 1fr; } }
.hs-table-row{ display:flex; align-items:center; gap:12px; padding:8px; border-radius:8px; cursor:pointer; }
.hs-table-row:hover{ background:var(--surface-2); }
.hs-table-row.playing{ background:rgba(255,239,179,0.07); }
.hs-table-row.playing .hs-table-title{ color:var(--accent); }
.hs-table-titles{ min-width:0; flex:1; }
.hs-table-title{ font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hs-table-subtitle{ font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hs-raw-card{ flex:0 0 145px; }

.toast{ position:fixed; bottom:104px; left:50%; transform:translateX(-50%) translateY(10px); background:var(--surface-3); border:1px solid var(--border); padding:10px 18px; border-radius:9px; font-size:13px; opacity:0; pointer-events:none; transition:all .2s; z-index:350; box-shadow:0 10px 30px rgba(0,0,0,0.4); }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.modal-backdrop{ position:fixed; inset:0; background:rgba(8,10,12,0.6); display:flex; align-items:center; justify-content:center; z-index:400; }
.modal{ background:var(--surface); border:1px solid var(--border); border-radius:24px; padding:24px; width:360px; max-width:90vw; }
.modal h3{ font-family:'Fraunces', serif; margin:0 0 14px 0; font-size:19px; }
.modal-actions{ display:flex; gap:10px; margin-top:18px; justify-content:flex-end; }

.page-loader{ height:100vh; height:100dvh; width:100vw; display:flex; align-items:center; justify-content:center; background:var(--bg); color:var(--text-muted); font-size:13px; }
#welcome-overlay{
  position:fixed; inset:0; z-index:600; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 50% 45%, rgba(255,239,179,0.10), transparent 60%), rgba(1,15,13,0.55);
  opacity:0; pointer-events:none; transition:opacity .5s ease;
}
#welcome-overlay.show{ opacity:1; }
#welcome-overlay-text{
  font-family:'Fraunces',serif; font-size:clamp(28px,5vw,44px); font-weight:600; color:var(--accent);
  text-align:center; padding:0 24px; transform:translateY(10px); opacity:0; transition:transform .6s ease, opacity .6s ease;
}
#welcome-overlay.show #welcome-overlay-text{ transform:translateY(0); opacity:1; }

@media (max-width: 760px){
  .sidebar{ position:fixed; left:-260px; width:250px; top:0; bottom:88px; z-index:50; transition:left .2s; box-shadow:20px 0 40px rgba(0,0,0,0.5); padding:20px 14px; }
  .sidebar.open{ left:0; width:250px; padding:20px 14px; border-right:1px solid var(--border); }
  .search-box.expanded{ width:calc(100vw - 130px); max-width:none; }
  .topbar{ gap:10px; padding:14px 16px; }
  .now-bar-row{ padding:10px 12px; gap:10px; }
  .np-buttons{ gap:12px; }
  .np-buttons{ gap:10px; }
  .track-row{ grid-template-columns: 24px 1fr 40px; }
  .track-album, .track-dur{ display:none; }

  /* Playlist/folder/album header: a fixed 150px cover next to a 32px name
     was fine on desktop but ate most of a narrow phone screen and left the
     name squeezed into almost no space. Stack vertically instead, and
     shrink the cover to something proportionate to the viewport. */
  .playlist-header{ flex-direction:column; align-items:flex-start; gap:14px; }
  .playlist-cover-big{ width:104px; height:104px; font-size:36px; }
  .playlist-name-input{ font-size:22px; }
  .playlist-header .btn{ font-size:12.5px; padding:8px 12px; }

  .content{ padding:18px 16px 26px 16px; }
  .grid{ grid-template-columns:repeat(auto-fill, minmax(105px,128px)); gap:12px; }
  .card-row .grid-card{ flex-basis:118px; }

  /* Touch targets: icon-only buttons under ~40px are hard to tap reliably
     on a phone — bump the hit area without changing how large the icon
     itself looks. */
  .icon-btn{ width:36px; height:36px; }
  .chip{ padding:8px 15px; }
}
