.mobile-top-actions{display:none}
.auth-browse-link{display:inline-flex;margin-top:18px;padding:8px 4px;border:0;border-bottom:1px solid transparent;background:transparent;color:#b8c4f7;font-size:12px;font-weight:600;transition:border-color .18s ease,color .18s ease}
.auth-browse-link:hover{border-bottom-color:#91a5ff;color:#fff}
.auth-browse-link:focus-visible{outline:2px solid #a9b9ff;outline-offset:4px;border-radius:4px}

@media (max-width:720px){
  :root{--mobile-edge:8px}
  body{min-width:0;font-size:14px;background:radial-gradient(circle at 72% 8%,#27265d 0,transparent 38%),radial-gradient(circle at -18% 72%,#381934 0,transparent 34%),var(--bg)}
  main{width:calc(100% - (var(--mobile-edge) * 2));margin:8px auto 96px}
  .aurora{opacity:.16;filter:blur(72px)}

  /* The desktop navigation becomes a compact account button and menu. */
  .topbar{position:relative;z-index:41;height:64px;min-height:64px;padding:9px 10px;border-radius:17px}
  .logo{width:36px;height:36px;border-radius:11px;font-size:16px}
  .brand{gap:9px;min-width:0}.brand h1{font-size:14px;white-space:nowrap}.brand p{display:none}
  .mobile-top-actions{display:flex;align-items:center;gap:6px;margin-left:auto}
  #mobileAccountBtn,#mobileMenuBtn{height:36px;padding:0 11px;border:1px solid var(--line);border-radius:10px;background:rgba(9,11,27,.52);color:#e5e7f5;font-size:11px;font-weight:600}
  #mobileMenuBtn{display:grid;width:40px;padding:8px 10px;grid-template-rows:repeat(3,1fr);gap:3px;place-items:center}
  #mobileMenuBtn span{display:block;width:16px;height:1px;border-radius:1px;background:#cbd2ff;transition:.2s ease}
  #mobileMenuBtn i{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .mobile-menu-open #mobileMenuBtn span:nth-child(1){transform:translateY(4px) rotate(45deg)}
  .mobile-menu-open #mobileMenuBtn span:nth-child(2){opacity:0}
  .mobile-menu-open #mobileMenuBtn span:nth-child(3){transform:translateY(-4px) rotate(-45deg)}
  .topbar>.actions{position:absolute;top:calc(100% + 7px);right:0;left:0;display:none;padding:10px;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;border:1px solid var(--line);border-radius:16px;background:rgba(14,16,35,.97);box-shadow:0 22px 55px rgba(0,0,0,.48);backdrop-filter:blur(22px)}
  .mobile-menu-open .topbar>.actions{display:grid}
  .topbar>.actions .page-nav{display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr);margin:0}
  .topbar>.actions .page-nav a{padding:9px 5px;text-align:center}
  .topbar>.actions>.ghost,.topbar>.actions>.primary,.topbar>.actions>.icon-btn{display:block!important;width:100%;height:auto;min-height:38px;margin:0;padding:8px;border-radius:10px;font-size:11px}
  .topbar>.actions #logoutBtn{display:none!important}
  .topbar>.actions .header-stat{display:flex;padding:5px 9px;border:1px solid var(--line);border-radius:10px}
  .public-mode .topbar>.actions #settingsBtn,.public-mode .topbar>.actions #labelsBtn,.public-mode .topbar>.actions #downloadsBtn,.public-mode .topbar>.actions #adminBtn,.public-mode .topbar>.actions #scanBtn,.public-mode .topbar>.actions #clearBtn,.public-mode .topbar>.actions .header-stat{display:none!important}

  .hero{display:block;padding:32px 6px 24px}.eyebrow{font-size:9px;letter-spacing:.16em}.hero h2{margin-top:8px;font-size:clamp(34px,10.5vw,46px);line-height:.99;letter-spacing:-.055em;text-wrap:balance}.hero h2 br{display:none}.hero h2 span{display:block}
  .hero-cards,.latest-card{display:none!important}

  .search-panel{border-radius:18px;overflow:visible}
  .search-row{height:60px;padding:0 14px}.search-icon{margin-right:9px;font-size:22px}.search-row input{min-width:0;font-size:16px}.search-row kbd{display:none}
  .filters{display:grid;padding:10px;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;overflow:visible}
  .filters>.source-filter,.filters>select,.filters>.genre-button,.filters>.clear-filter-button{width:100%;min-width:0}
  .filters select,.genre-button,.clear-filter-button,#sourceButton{width:100%;height:37px!important;padding:7px 9px!important;overflow:hidden;text-overflow:ellipsis;font-size:11px!important;text-align:left}
  #genreButton{grid-column:1/-1}
  #dateButton{grid-column:1/-1}
  #clearFilters{grid-column:1/-1;text-align:center}
  .field-checks{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
  .field-checks label{justify-content:center;min-width:0;padding:7px 4px;font-size:10px}
  .view-switch,.album-group-switch{grid-column:1/-1;display:grid;padding:7px 0 0;border-top:1px solid var(--line);border-left:0;grid-template-columns:auto repeat(3,1fr);gap:3px}
  .album-group-switch{grid-template-columns:auto repeat(2,1fr)}
  .view-switch>span,.album-group-switch>span{align-self:center;margin-right:4px!important;font-size:8px!important}
  .view-switch button,.album-group-switch button{padding:7px 5px;text-align:center}
  #matchCount{grid-column:1/-1;margin:2px 0 0!important;padding-top:8px;border-top:1px solid var(--line);font-size:10px;text-align:right}
  .source-dialog-options{grid-template-columns:1fr;align-content:start;gap:8px;max-height:min(54dvh,430px);padding:3px 2px 10px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .source-dialog-options button{display:flex;min-height:44px;padding:10px 14px;align-items:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
  .source-dialog-options button.selected{background:linear-gradient(135deg,rgba(145,165,255,.5),rgba(145,102,238,.42));border-color:#b7c3ff;color:#fff;box-shadow:inset 0 1px rgba(255,255,255,.16),0 7px 18px rgba(71,60,160,.22)}

  /* A phone receives semantic result cards; desktop retains its data table. */
  .table-shell{margin-top:10px;border:0;border-radius:18px;background:transparent!important;box-shadow:none;overflow:visible}
  .table-scroll{min-height:0;overflow:visible}
  #libraryTable,#libraryTable>tbody{display:block;width:100%;table-layout:auto;background:transparent!important}
  #libraryTable>colgroup,#libraryTable>thead{display:none}
  #libraryTable>tbody{display:grid;gap:8px}
  #libraryTable>tbody>tr{width:100%}
  #libraryTable .album-row{display:grid;padding:13px;grid-template-columns:minmax(0,1fr) auto auto auto;gap:8px 10px;border:1px solid rgba(255,255,255,.1);border-radius:15px;background:linear-gradient(135deg,rgba(31,34,65,.9),rgba(17,19,40,.9));box-shadow:0 10px 28px rgba(3,5,15,.2)}
  #libraryTable .album-row.open{border-color:rgba(151,171,255,.38);border-radius:15px 15px 8px 8px;background:linear-gradient(135deg,rgba(48,53,93,.94),rgba(25,28,54,.94))}
  #libraryTable .album-row>td{display:block;width:auto!important;padding:0!important;border:0;background:transparent!important;color:#f1f2fb;text-align:left!important;white-space:normal}
  #libraryTable .album-row>td:first-child{display:flex;min-width:0;grid-column:1/-2;grid-row:1;gap:9px;align-items:flex-start}
  #libraryTable .album-row>td:nth-child(2){grid-column:1/-1;grid-row:2;min-width:0}
  #libraryTable .album-row>td:nth-child(3){grid-column:1;grid-row:3}
  #libraryTable .album-row>td:nth-child(4){grid-column:2;grid-row:3}
  #libraryTable .album-row>td:nth-child(5){grid-column:3;grid-row:3}
  #libraryTable .album-row>td:last-child{grid-column:4;grid-row:1;padding-left:4px!important;white-space:nowrap}
  #libraryTable .album-row>td:nth-child(3)::before{content:"Date · ";color:#7f88aa}
  #libraryTable .album-row>td:nth-child(4)::before{content:"Format · ";color:#7f88aa}
  #libraryTable .album-row>td:nth-child(5)::before{content:"Size · ";color:#7f88aa}
  #libraryTable .album-row>td:nth-child(n+3):nth-child(-n+5){color:#aeb4cf;font-size:10px;white-space:nowrap}
  .album-toggle{flex:0 0 34px;width:34px;height:34px}.album-name{min-width:0;font-size:14px;line-height:1.4;overflow-wrap:anywhere}.album-meta{margin-top:3px;font-size:11px;line-height:1.35}.album-genres{max-height:38px;overflow:hidden}.album-genres span,.track-genre{font-size:11px}
  .album-actions{gap:5px}.album-actions .album-play,.album-actions .album-download,#libraryTable .album-row>td:last-child .album-play,#libraryTable .album-row>td:last-child .album-download{width:36px!important;min-width:36px!important;height:36px!important;margin:0!important;font-size:14px!important}
  .public-mode #libraryTable .album-row{grid-template-columns:1fr auto auto}.public-mode #libraryTable .album-row>td:first-child{grid-column:1/-1}.public-mode #libraryTable .album-row>td:last-child{display:none!important}

  #libraryTable .track-row{display:block;margin-top:-8px;border:1px solid rgba(151,171,255,.2);border-top:0;border-radius:0 0 15px 15px;background:rgba(11,13,31,.9)}
  #libraryTable .track-row>td{display:block!important;width:100%!important;padding:0!important}
  .nested-table-wrap{padding:7px!important}
  .nested-track-table,.nested-track-table tbody{display:block;width:100%;table-layout:auto;border:0;background:transparent}
  .nested-track-table colgroup,.nested-track-table thead{display:none}
  .nested-track-table tbody{display:grid;gap:6px}
  .nested-track-table tbody tr{display:grid;padding:11px;grid-template-columns:minmax(0,1fr) max-content;gap:5px 10px;border:1px solid rgba(255,255,255,.075);border-radius:11px;background:rgba(255,255,255,.025)}
  .nested-track-table tbody td{display:block!important;width:auto!important;padding:0!important;border:0!important;text-align:left!important;white-space:normal}
  .nested-track-table tbody td:first-child{display:flex!important;grid-column:2;grid-row:1/3;align-self:center;align-items:center;justify-content:flex-end;gap:6px;text-align:right!important}
  .nested-track-table tbody td:first-child .track-add,.nested-track-table tbody td:first-child .preview-track{width:36px;height:36px;margin:0;font-size:14px}
  .nested-track-table tbody td:first-child .track-add{font-size:21px}
  .nested-track-table tbody td:first-child .track-check{width:18px;height:18px;margin:0}
  #libraryTable .nested-track-table tbody td:nth-child(2){grid-column:1;grid-row:1;color:#d0d4e6;font-size:13px!important;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
  #libraryTable .nested-track-table tbody td:nth-child(3){grid-column:1;grid-row:2;color:#f7f8ff;font-size:14px!important;line-height:1.4;overflow-wrap:anywhere}
  #libraryTable .nested-track-table tbody td:nth-child(3) small{margin-top:2px;font-size:11px!important;line-height:1.35;white-space:normal}
  #libraryTable .nested-track-table tbody td:nth-child(4){grid-column:1/-1;grid-row:3;font-size:11px!important}
  #libraryTable .nested-track-table tbody td:nth-child(5){grid-column:1;grid-row:4;color:#9da6c7;font-size:11px!important}
  #libraryTable .nested-track-table tbody td:nth-child(6){grid-column:2;grid-row:4;color:#9da6c7;font-size:11px!important;text-align:right!important}

  #libraryTable:not([data-view="album"])>tbody>tr{display:grid;padding:12px;grid-template-columns:minmax(0,1fr) auto auto;gap:6px 10px;border:1px solid rgba(255,255,255,.1);border-radius:14px;background:linear-gradient(135deg,rgba(31,34,65,.9),rgba(17,19,40,.9))}
  #libraryTable:not([data-view="album"])>tbody>tr>td{display:block!important;width:auto!important;padding:0!important;border:0!important;text-align:left!important;white-space:normal}
  #libraryTable:not([data-view="album"])>tbody>tr>td:first-child{display:flex!important;grid-column:2/4;grid-row:1/3;align-items:center;justify-content:flex-end;gap:6px;text-align:right!important}
  #libraryTable:not([data-view="album"])>tbody>tr>td:first-child .track-add,#libraryTable:not([data-view="album"])>tbody>tr>td:first-child .preview-track{width:36px;height:36px;margin:0;font-size:14px}
  #libraryTable:not([data-view="album"])>tbody>tr>td:first-child .track-add{font-size:21px}
  #libraryTable:not([data-view="album"])>tbody>tr>td:first-child .track-check{width:18px;height:18px;margin:0}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(2){grid-column:1;grid-row:1;color:#f7f8ff;font-size:15px;font-weight:750;line-height:1.38;overflow-wrap:anywhere}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(3){grid-column:1;grid-row:2;color:#d0d4e6;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
  #libraryTable[data-view="artist"]>tbody>tr>td:nth-child(2){font-size:15px;letter-spacing:-.01em}
  #libraryTable[data-view="artist"]>tbody>tr>td:nth-child(3){color:#aeb5ce;font-size:13px;line-height:1.4}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(4),#libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(5){grid-column:1/-1;color:#9da4c0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(6){grid-column:1;grid-row:5;color:#8f99ba;font-size:10.5px}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(7){grid-column:2;grid-row:5;color:#8f99ba;font-size:10.5px;text-align:right!important}
  #libraryTable:not([data-view="album"])>tbody>tr>td:nth-child(8){grid-column:3;grid-row:5;color:#8f99ba;font-size:10.5px;text-align:right!important}

  .table-footer{display:grid;min-height:0;margin-top:10px;padding:10px;grid-template-columns:1fr auto;gap:8px;border:1px solid var(--line);border-radius:14px;background:rgba(17,19,40,.82);font-size:10px}
  .table-footer>div{display:flex;align-items:center;gap:7px}.table-footer select{padding:6px 8px}.table-footer>span{margin:0;text-align:right}
  #pages,.jump{display:none}
  .bulk-bar{position:sticky;z-index:12;bottom:76px;flex-wrap:wrap;border-radius:13px;background:rgba(20,22,46,.96);backdrop-filter:blur(18px)}

  .modal,.member-settings-modal{width:calc(100% - 14px);max-height:calc(100dvh - 14px);border-radius:18px}
  .auth-gate{padding:8px}.auth-card{max-height:calc(100dvh - 16px);overflow-y:auto;padding:25px 18px;border-radius:19px}.auth-browse-link{min-height:40px;margin-top:14px;align-items:center;justify-content:center}
  .modal form{padding:17px}.member-settings-modal>form{height:calc(100dvh - 14px);min-height:0!important;padding:14px}
  .member-settings-nav{display:flex;overflow-x:auto;flex-direction:row;scroll-snap-type:x proximity}.member-settings-nav button{flex:0 0 auto;scroll-snap-align:start}
  .member-settings-layout{display:flex;overflow:hidden;flex-direction:column}.member-settings-content{overflow-y:auto}
  .preview-player{bottom:8px;left:8px;right:8px;padding:9px;border-radius:15px}.session-queue{right:8px;bottom:82px;width:calc(100% - 16px)}
}

@media (max-width:390px){
  .brand h1{font-size:12px}.hero h2{font-size:34px}.filters{grid-template-columns:1fr 1fr}
  #libraryTable .album-row{grid-template-columns:minmax(0,1fr) auto auto}
  #libraryTable .album-row>td:first-child{grid-column:1/-1;padding-right:86px!important}
  #libraryTable .album-row>td:last-child{position:absolute;top:13px;right:13px;display:flex!important;width:auto!important;gap:5px}.album-row{position:relative}
  #libraryTable .album-row>td:last-child .album-download{font-size:0!important}
  #libraryTable .album-row>td:last-child .album-download::before{content:"+";font-size:21px;line-height:1}
}

@media (max-width:720px){
  /* Keep collection track copy readable and reserve a real action column. */
  .collection-tracks{min-width:0;padding:13px 10px;overflow:hidden}
  .collection-tracks>header{gap:12px}.collection-tracks h4{font-size:17px;line-height:1.35;overflow-wrap:anywhere}.collection-tracks p{font-size:11px;line-height:1.4}
  .collection-tracks-close{flex:0 0 36px;width:36px;height:36px}
  .collection-track-list{min-width:0;width:100%;padding-right:2px;scrollbar-gutter:auto}
  .collection-track{display:grid;min-width:0;padding:11px 3px;grid-template-columns:26px minmax(0,1fr) 84px;gap:5px 9px;align-items:start}
  .collection-track>span:first-child{grid-column:1;grid-row:1/3;padding-top:2px;font-size:11px}
  .collection-track .collection-track-artist{grid-column:2;grid-row:1;color:#d8dbea;font-size:13px;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
  .collection-track .collection-track-title{grid-column:2;grid-row:2;color:#f7f8ff;font-size:14px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
  .collection-track .collection-track-format{grid-column:3;grid-row:1;justify-self:end;color:#aeb8e8;font-size:10.5px}
  .collection-track .collection-track-date{display:none}
  .collection-track-actions{display:flex;min-width:0;grid-column:3;grid-row:2;justify-content:flex-end;gap:6px}
  .collection-track-actions .track-add,.collection-track-actions .preview-track{display:grid;flex:0 0 36px;width:36px;height:36px;margin:0;place-items:center}
  .collection-track-actions .track-add{font-size:21px}.collection-track-actions .preview-track{font-size:13px}
}

@media (prefers-reduced-motion:reduce){
  #mobileMenuBtn span{transition:none}
}
