/* Muzyc v0.8 | Interaction polish, no new UI framework or continuous animation loops. */
:root{
  --touch-target:44px;
  --content-max:1170px;
  --ease-ui:cubic-bezier(.22,.68,0,1.02);
}
html{scroll-padding-top:96px}
body{min-height:100dvh}
.content{max-width:var(--content-max)}
/* Stronger typographic hierarchy without excessive labels. */
.page-title,.hero h1,.section-head h2{font-feature-settings:'kern';text-wrap:balance}
.page-title{font-size:clamp(26px,2.65vw,35px);font-weight:850;line-height:1.55;letter-spacing:-.04em}
.section-head{align-items:center}
.section-head h2{font-size:18px;line-height:1.65}
.section-head p{line-height:1.8;margin:1px 0 0}
.lead{font-size:12.5px;line-height:1.9}
.topbar{position:relative;isolation:isolate}
.top-search{transition:border-color .18s ease,box-shadow .18s ease}
.top-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 13%,transparent)}
::placeholder{opacity:1}
/* Button motion is short, predictable and disabled for reduced-motion settings. */
.btn,.icon-btn,.mini-action,.flat-icon,.mobile-link,.nav-link{touch-action:manipulation}
.btn{transition:background-color .18s ease,border-color .18s ease,color .18s ease,transform .18s var(--ease-ui)}
.btn:active,.icon-btn:active,.mini-action:active{transform:scale(.97)}
.btn:disabled{opacity:.52;transform:none}
.text-link{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:5px}
.btn.primary{box-shadow:0 8px 20px rgba(163,134,234,.09)}
/* Cards: visual density and whole-row clarity. */
.music-card{overflow:hidden;transition:transform .2s var(--ease-ui),border-color .17s ease,background-color .17s ease}
.music-card .cover-lg{aspect-ratio:1.18}
.music-card h3{line-height:1.6;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;min-height:2.9em;overflow:hidden}
.music-card p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:8px}
.music-card .card-actions{margin-top:auto}
.track-row{padding-block:12px}
.track-row .row-actions{gap:4px;justify-content:flex-end}
.track-row:focus-within{border-radius:12px;background:var(--surface2)}
.track-name strong,.group-info h3{overflow-wrap:anywhere}
.playlist-tile{cursor:pointer}
.playlist-tile:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
/* Home: give the message room, without making the hero excessively tall. */
.hero{min-height:269px;padding:32px clamp(26px,3.2vw,46px)}
.hero h1{font-size:clamp(31px,3.4vw,45px);line-height:1.5;letter-spacing:-.04em}
.hero p{max-width:390px;font-size:12.5px;margin-bottom:22px}
.hero .btn.primary{min-height:46px}
.stat-grid{gap:12px}
.stat-card{min-width:0;min-height:95px}
.stat-card b{line-height:1.35}
.stat-card small{line-height:1.6}
/* Result lists: recognizable source, predictable actions, readable on narrow screens. */
.provider-card .domain{line-height:1.6}
.provider-card h3{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.55;min-height:0}
.provider-card .card-actions{margin-top:9px}
.provider-card .card-actions>.btn{flex:0 1 auto}
.results-grid{align-items:stretch}
.web-card{height:100%}
.web-card p{overflow-wrap:anywhere}
/* Forms: generous target and stable focus. */
.form-label{line-height:1.8}
.field,.select,.textarea{min-height:50px;line-height:1.7;font-size:16px}
.field:focus,.select:focus,.textarea:focus{outline:2px solid transparent;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.auth-heading h1{max-width:15em;line-height:1.58}
.auth-card .brand{gap:10px}
.credential-tab{min-height:48px}
.pin-visibility{border-radius:10px}
.auth-footnote{line-height:1.9}
/* Less disorienting waiting/error feedback. */
.load-failed{display:grid;justify-items:start;align-content:center;gap:10px;min-height:210px;padding:30px;border-radius:18px;border:1px solid var(--border);background:var(--surface)}
.load-failed>svg{color:var(--accent);width:27px;height:27px}
.load-failed h2{font-size:17px;margin:0}
.load-failed p{margin:0 0 10px;color:var(--muted);font-size:13px}
.empty{padding:24px;gap:7px}
.empty p{max-width:370px;margin-inline:auto;text-wrap:pretty}
#toast-area{pointer-events:none}
#toast-area .toast{pointer-events:auto;max-width:min(450px,calc(100vw - 28px));line-height:1.75}
/* Popups: focused dialog, no accidental behind-the-sheet scrolling. */
body.modal-open{overflow:hidden;overscroll-behavior:none}
.modal-backdrop{overscroll-behavior:contain}
.modal{overscroll-behavior:contain;min-width:0}
.modal-header{position:sticky;top:-1px;z-index:2;background:var(--surface);padding-top:3px}
.modal-header h2{line-height:1.6}
.modal-footer{flex-wrap:wrap}
.modal-footer .btn{min-height:46px}
/* Group chat: preserve natural reading flow and stop excessive visual noise. */
.chat-head{border-bottom:1px solid var(--border)}
.chat-scroll{overflow-anchor:none;scrollbar-gutter:stable;scroll-behavior:auto}
.bubble{max-width:min(82%,485px);overflow-wrap:anywhere}
.bubble p{line-height:1.9}
.bubble-foot{gap:5px}
.bubble-foot .mini-action{color:var(--muted)}
.chat-form .field{min-width:0;flex:1}
.chat-form{isolation:isolate}
/* Music bar should stay stable when track changes. */
.player{z-index:32}
.player-track b,.player-track small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.player .player-play:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
/* Desktop: avoid visually awkward width on medium laptop screens. */
@media(min-width:921px) and (max-width:1220px){
  .sidebar{width:226px}
  .main{margin-right:226px;max-width:calc(100% - 226px);padding-inline:27px}
  .player{right:226px}
  .cards{grid-template-columns:repeat(auto-fill,minmax(155px,1fr))}
  .results-grid{grid-template-columns:1fr}
}
@media(max-width:920px){
  html{scroll-padding-top:75px}
  .main{padding-inline:clamp(14px,3.6vw,25px)}
  .topbar{margin-bottom:19px}
  .mobile-brand{font-weight:900;letter-spacing:-.05em}
  .top-actions .avatar-small{display:grid}
  .page-intro{margin-bottom:17px}
  .page-title{font-size:clamp(24px,5.5vw,31px)}
  .section-head{margin-top:24px;margin-bottom:11px}
  .section-head h2{font-size:16.5px}
  .hero{min-height:229px;padding:26px 22px}
  .hero h1{font-size:clamp(26px,6.9vw,39px);line-height:1.52}
  .hero p{max-width:280px;font-size:11.5px;line-height:1.85}
  .hero-art{pointer-events:none}
  .stat-grid{gap:8px}
  .stat-card{padding:11px 7px;min-height:103px}
  .cards{gap:10px}
  .music-card{padding:9px;border-radius:15px}
  .music-card h3{font-size:12px;min-height:0}
  .music-card .cover-lg{aspect-ratio:1.15}
  .music-card .mini-action{min-width:44px;min-height:44px;width:44px;height:44px}
  .group-layout{min-width:0}
  .chat-form{padding:10px;gap:7px}
  .chat-form input{height:48px;min-width:0}
  .bubble{max-width:90%}
  .bubble p{font-size:12.5px}
  .mobile-nav{z-index:34;transition:transform .16s ease,opacity .16s ease,visibility .16s ease}
  .mobile-nav .mobile-link{position:relative;min-height:52px;justify-content:center}
  .mobile-nav .mobile-link:active{background:var(--surface2)}
  .mobile-nav .mobile-link.active{border-radius:12px}
  .player{z-index:33;transition:transform .16s ease,opacity .16s ease,visibility .16s ease}
  .player .player-track{min-width:0}
  .player .player-track b{max-width:32vw}
  .modal{padding:22px 18px calc(22px + env(safe-area-inset-bottom));max-height:calc(100dvh - 16px)}
  /* Keyboard appears: audio keeps playing, fixed dock leaves the typing area. */
  body.mobile-typing .mobile-nav,body.mobile-typing .player{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(115%)}
  body.mobile-typing .main{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  body.mobile-typing .chat{min-height:310px}
  .auth-card{align-items:center}
  .auth-heading{margin:28px 0 22px}
  .auth-heading h1{font-size:clamp(27px,6.4vw,33px)}
}
@media(max-width:420px){
  .main{padding-inline:15px}
  .section-head .btn{padding-inline:10px}
  .stat-card{gap:6px}
  .stat-icon{width:34px;height:34px}
  .stat-card b{font-size:19px}
  .stat-card small{font-size:10px}
  .provider-card{grid-template-columns:76px minmax(0,1fr);gap:8px 10px}
  .provider-card .cover-lg{width:76px;height:76px!important;min-height:76px!important}
  .provider-card .card-actions{flex-wrap:wrap}
  .provider-card .card-actions>.btn{min-height:42px}
  .track-row{gap:8px}
  .track-row .duration{display:none}
  .track-row .row-actions{gap:2px}
  .auth-card{padding-inline:18px}
  .auth-switch-row{line-height:2}
}
@media(max-width:350px){
  .hero{padding-inline:18px}
  .hero-art{left:-115px;opacity:.17}
  .provider-card{grid-template-columns:67px minmax(0,1fr)}
  .provider-card .cover-lg{width:67px;height:67px!important;min-height:67px!important}
  .provider-card .card-actions>.btn{font-size:10px;padding-inline:8px}
  .track-row .cover-sm{width:40px;height:40px}
  .mobile-nav{padding-inline:5px}
  .mobile-nav .mobile-link{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .mobile-nav,.player,.music-card,.btn,.icon-btn,.mini-action{transition:none!important}
  .vinyl,.boot-logo{animation:none!important}
}
