/* Supplemental mobile layout; desktop and existing playback remain intact. */
.private-mobile-only{display:none!important}
#manage-items>svg{display:none}
@media(max-width:700px), (max-width:900px) and (max-height:500px){
  body{--private-mobile-player-height:82px}
  main{padding-bottom:calc(var(--private-mobile-player-height) + env(safe-area-inset-bottom,0px) + 24px)!important}
  .private-sidebar{bottom:calc(var(--private-mobile-player-height) + env(safe-area-inset-bottom,0px) + 10px)!important}
  #workspace>.toolbar{display:flex;gap:12px;margin-bottom:10px;min-width:0}
  #workspace>.toolbar>.tabs{display:flex;flex-wrap:nowrap;width:100%;min-width:0;overflow-x:auto;gap:6px;scrollbar-width:none;padding:2px 0}
  #workspace>.toolbar>.tabs::-webkit-scrollbar{display:none}
  #workspace>.toolbar>.tabs button{flex:0 0 auto;white-space:nowrap;font-size:12px;padding:9px 13px;min-height:40px}
  #workspace>.toolbar>.actions{display:none}
  .private-mobile-only{display:inline-flex!important}
  .private-mobile-only[hidden]{display:none!important}
  .private-mobile-tools{display:flex!important;width:100%;min-width:0;justify-content:space-between;gap:4px}
  .private-mobile-tools>button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:40px;padding:0;margin:0!important;border-radius:14px;flex:0 0 44px;background:#21202a;border:1px solid #36323f;color:#e8e3f1}
  .private-mobile-tools>button.primary{background:linear-gradient(115deg,#853cff,#408ff4);border:0}
  .private-mobile-tools>button.is-filtered{color:#ceacff;border-color:#a97bff;background:#312140}
  .private-mobile-tools svg,#manage-items>svg{display:block;width:22px;height:22px;flex:none}
  .private-mobile-tools .private-control-label{display:none}
  .browse-tools>label{display:none}
  .browse-tools{gap:6px;margin-bottom:18px;justify-content:space-between}
  .browse-history{gap:0}
  .browse-history .icon-button{width:32px;height:40px;min-width:32px;padding:4px}
  .browse-tools .collection-actions{display:flex;flex-direction:row;gap:6px;margin-left:auto;align-items:center}
  .collection-actions #collection-play{width:40px;height:40px;padding:0;font-size:0;min-width:40px}
  .collection-actions #collection-play::before{content:'▶';font-size:18px}
  .collection-actions>div{font-size:10px}
  .collection-actions>div button{width:30px;height:40px}
  #album-back{font-size:12px;padding:8px}

  #private-player.player{display:grid;grid-template-columns:44px minmax(120px,1fr) 132px;grid-template-rows:20px 44px;align-items:center;min-height:0;height:calc(var(--private-mobile-player-height) + env(safe-area-inset-bottom,0px));gap:4px 2px;padding:4px max(6px,env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px));box-sizing:border-box}
  #private-player .now-playing{grid-column:1;grid-row:2;display:block;min-width:0;width:auto}
  #private-player #player-cover{display:grid;width:40px;height:40px;padding:0;margin:0;border-radius:9px}
  #private-player #player-art{width:40px;height:40px;border-radius:9px}
  #private-player .now-copy,#private-player #player-add,#private-player #player-shuffle,#private-player #player-repeat,#private-player #player-recent,#private-player #player-mute,#private-player #player-volume,#private-player #player-fullscreen{display:none!important}
  #private-player .player-center{display:contents}
  #private-player .transport{grid-column:2;grid-row:2;position:static;display:flex;gap:0;justify-content:center}
  #private-player .transport .icon-button{position:static;width:40px;min-width:40px;height:44px;padding:9px}
  #private-player .transport .icon-button svg{width:22px;height:22px}
  #private-player #player-toggle{width:44px;min-width:44px;height:44px;padding:10px}
  #private-player .player-timeline{grid-column:1/-1;grid-row:1;display:flex;width:100%;gap:8px;margin:0;min-height:20px;font-size:10px}
  #private-player #player-progress{height:4px;min-height:4px;touch-action:pan-y}
  #private-player .player-tools{grid-column:3;grid-row:2;display:flex;width:132px;gap:0;align-items:center;justify-content:flex-end}
  #private-player .player-tools .icon-button{width:44px;min-width:44px;height:44px;padding:10px;align-items:center;justify-content:center}
  #private-player .player-tools svg{width:22px;height:22px}
  #private-player #player-queue{order:0}
  #private-mobile-volume{order:1}
  #private-mobile-player-more{order:2}
  #private-player .private-queue-count{font-size:10px}

  body:has(dialog[open]){overflow:hidden}
  body dialog[open]{position:fixed;inset:0;width:100%!important;max-width:100%!important;height:100dvh!important;max-height:100dvh!important;margin:0;border:0;border-radius:0!important;box-sizing:border-box;padding:20px max(18px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(18px,env(safe-area-inset-left,0px));overflow:auto;overscroll-behavior:contain;background:#14121b}
  body dialog[open].itunes-mode{padding:0}
  body dialog[open].private-mobile-sheet{padding-top:0}
  .private-mobile-sheet>header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:calc(16px + env(safe-area-inset-top,0px)) 0 16px;margin:0;z-index:2;background:#14121b;border-bottom:1px solid #ffffff18}
  .private-mobile-sheet h2{font-size:23px;letter-spacing:-.5px;margin:0}
  .private-mobile-sheet header .icon-button{display:grid;width:44px;height:44px;padding:10px;flex:none}
  .private-mobile-sheet svg{width:24px;height:24px;flex:none}
  .private-mobile-sheet-body{padding:18px 0}
  .private-mobile-option{width:100%;display:flex;align-items:center;gap:16px;min-height:58px;padding:15px 14px;border:1px solid transparent;border-radius:14px;text-align:left;background:transparent;margin:0 0 5px;font-size:16px;line-height:1.4}
  .private-mobile-option[aria-pressed=true]{background:#30213f;border-color:#72509e;color:#e2c9ff}
  .private-mobile-option:hover{background:#24212f}
  .private-mobile-volume-controls{display:flex;gap:18px;align-items:center;padding:22px 0}
  .private-mobile-volume-controls #player-mute{display:grid;width:48px;height:48px;padding:12px;flex:none}
  .private-mobile-volume-controls #player-volume{width:100%;min-width:0;height:44px;padding:0;accent-color:#ae81ff}
  #private-mobile-queue #player-panel{position:static;width:100%;max-height:none;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
  #private-mobile-queue #player-panel>.section-title{display:none}
  .private-mobile-dialog-close{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;float:right;display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-bottom:8px;padding:10px;background:#25212f;border:1px solid #574761;border-radius:50%}
  .private-mobile-dialog-close svg{width:24px;height:24px}
  .itunes-mode>.private-mobile-dialog-close{margin:12px}
  #private-player:fullscreen{height:100dvh;align-content:end}
}
@media(max-width:350px){
  .private-mobile-tools>button{width:40px;flex-basis:40px}
  .browse-tools{column-gap:0}
  .browse-history .icon-button{width:28px;min-width:28px}
  .browse-tools .collection-actions{gap:0}
}

/* Mobile list rows are self-contained; keep heading controls on desktop. */
@media(max-width:700px), (max-width:900px) and (max-height:500px){
  #private-headings-toggle,#private-list-headings{display:none!important}
  #private-browse-layout.has-list-headings{grid-template-rows:minmax(0,1fr)!important}
  #private-browse-layout.has-list-headings>#cards{grid-row:1!important}
}

@media(max-width:700px), (max-width:900px) and (max-height:500px){
  /* Keep the 44px touch target while sizing the ring independently from other icons. */
  #private-player #player-queue{padding:7px;transform:none}
  #private-player #player-queue svg{width:30px;height:30px;transform:rotate(45deg);overflow:visible}
  #private-player #player-queue :is(.queue-ring,.queue-progress){stroke-width:4.75}
  #private-player #player-queue .queue-ring{opacity:1}
  #private-player #player-queue.has-queue-progress .queue-ring{opacity:.26}
  #private-player #player-queue .queue-progress{stroke-dashoffset:0;transition:stroke-dasharray .24s ease}
  #private-player #player-queue .private-queue-count{top:auto;right:3px;bottom:3px;min-width:16px;height:16px;padding:0 2px;box-sizing:border-box;transform:none;box-shadow:0 0 0 2px #08080a}
  #private-mobile-options.private-mobile-sheet{background:#050506}
  #private-mobile-options>header{background:#050506;border:0}
  #private-mobile-options .private-mobile-sheet-body{padding:8px 0}
  #private-mobile-options .private-mobile-option{min-height:72px;padding:20px;gap:18px;margin-bottom:10px;background:linear-gradient(135deg,#111114,#09090a);border:1px solid transparent;border-radius:18px;font-size:18px;font-weight:650;color:#d9d9df}
  #private-mobile-options .private-mobile-option svg{width:26px;height:26px}
  #private-mobile-options .private-mobile-option[aria-pressed=true]{background:#1d1d20;border-color:#ffffff24;color:#f3f3f7}
  #private-mobile-options .private-mobile-option:disabled{opacity:.4}
  #private-mobile-options .private-mobile-option:focus-visible{outline:2px solid #b99cf3;outline-offset:-3px}
  #private-mobile-options [data-player-source=player-queue] svg{transform:rotate(45deg)}
  #private-mobile-options [data-player-source=player-queue] .queue-ring{stroke-width:4.75}
  #private-mobile-options [data-player-source=player-queue] .queue-progress{display:none}
  .private-mobile-volume-controls{display:block;padding:16px 20px 14px;margin:0 0 10px;border-radius:18px;background:linear-gradient(135deg,#111114,#09090a)}
  .private-mobile-volume-heading{display:flex;align-items:center;gap:8px;margin:0 0 8px}
  .private-mobile-volume-heading label{font-size:18px;font-weight:650;color:#d9d9df;cursor:pointer}
  .private-mobile-volume-controls #player-mute{width:44px;height:44px;padding:8px;margin-left:-8px;background:none;border:0;min-width:44px}
  .private-mobile-volume-controls #player-mute svg{width:26px;height:26px}
  .private-mobile-volume-controls #player-volume{display:block;width:100%;height:44px;min-width:0;padding:0;margin:0;background:transparent!important;cursor:pointer;touch-action:none}
  .private-mobile-volume-controls #player-volume::-webkit-slider-runnable-track{height:8px;border-radius:8px;background:linear-gradient(to right,#f4f4f8 0 var(--volume-fill,100%),#343439 var(--volume-fill,100%) 100%)}
  .private-mobile-volume-controls #player-volume::-webkit-slider-thumb{width:24px;height:24px;margin-top:-8px;background:#f4f4f8;box-shadow:0 0 0 5px #ffffff1a;border:0;border-radius:50%}
  .private-mobile-volume-controls #player-volume::-moz-range-track{height:8px;border-radius:8px;background:linear-gradient(to right,#f4f4f8 0 var(--volume-fill,100%),#343439 var(--volume-fill,100%) 100%)}
  .private-mobile-volume-controls #player-volume::-moz-range-thumb{width:24px;height:24px;border:0;border-radius:50%;background:#f4f4f8;box-shadow:0 0 0 5px #ffffff1a}
  .private-mobile-volume-controls #player-volume:focus-visible{outline:2px solid #b99cf3;outline-offset:3px}
}
@media(prefers-reduced-motion:reduce){#private-player #player-queue .queue-progress{transition:none}}
