/* Cohesive desktop panels and real, automatically loaded group artwork. */
.collection-cover,.library-art,.group-cover  {
  position:relative;
  overflow:hidden;
}

.group-art-image  {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:inherit;
  z-index:1;
}

.library-art  {
  display:block;
}

.group-cover  {
  width:100%;
  aspect-ratio:1.45;
  border-radius:12px;
  margin-bottom:18px;
  background:radial-gradient(ellipse at 65% 20%,#a74b2944,transparent 70%),linear-gradient(145deg,#39281d,#1c1b1a);
  display:grid;
  place-items:center;
  color:#ff650d;
  font-size:38px;
  border:1px solid #ffffff0a;
}

.group-cover.collection-color-1  {
  background:radial-gradient(ellipse at 65% 20%,#b58b3344,transparent 70%),#27241c;
}

.group-cover.collection-color-2  {
  background:radial-gradient(ellipse at 65% 20%,#448f8144,transparent 70%),#182724;
}

.group-cover>i  {
  opacity:.5;
}

.group-cover:after  {
  content:'';
  position:absolute;
  inset:0;
  border:1px solid #ffffff08;
  border-radius:inherit;
  z-index:2;
  pointer-events:none;
}

.track-preview-button  {
  width:36px;
  height:36px;
  min-width:36px;
  border:1px solid #ffffff1e;
  border-radius:50%;
  color:#ff9a60;
  background:#ff650d0c;
  display:grid;
  place-items:center;
  font-size:12px;
  flex-shrink:0;
}

.track-preview-button:hover  {
  background:var(--accent);
  border-color:var(--accent);
  color:#111;
}

.studio-search-result[data-mode="tracks"]  {
  grid-template-columns:40px minmax(0,1fr) 34px 100px 36px 62px;
  gap:10px;
}

.result-grid  {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.result-card  {
  padding:14px;
  border-radius:14px;
  background:#1d1c1b;
  border:1px solid #ffffff0c;
  gap:10px;
}

.result-info strong  {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}

.result-info small  {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
}

.btn-add,.btn-open  {
  min-height:36px;
  border-radius:999px;
  font-size:11px;
}

.track-preview-dialog  {
  position:fixed;
  width:540px;
  max-width:calc(100vw - 32px);
  margin:auto;
  padding:26px;
  color:#faf9f6;
  background:linear-gradient(145deg,#29201a,#191817 75%);
  border:1px solid #ff650d35;
  border-radius:24px;
  box-shadow:0 28px 100px #0008;
}

.track-preview-dialog::backdrop  {
  background:#0009;
  backdrop-filter:blur(8px);
}

.preview-dialog-header  {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
  gap:12px;
}

.preview-dialog-header>span  {
  font-size:10px;
  letter-spacing:2px;
  color:#ff9a60;
  font-weight:700;
}

.preview-dialog-header i  {
  margin-right:7px;
}

.preview-dialog-header .icon-button  {
  width:40px;
  height:40px;
  border-radius:50%;
  background:#ffffff06;
}

#track-preview-title  {
  font-size:26px;
  letter-spacing:-.8px;
  line-height:1.3;
  overflow-wrap:anywhere;
}

#track-preview-artist  {
  font-size:13px;
  color:#aaa39b;
  margin:7px 0 24px;
}

#track-preview-player  {
  border-radius:12px;
  overflow:hidden;
  min-height:166px;
  background:#23211e;
}

#track-preview-player iframe  {
  width:100%;
  height:166px;
  border:0;
  display:block;
}

#track-preview-feedback  {
  font-size:11px;
  color:#b7ada3;
  min-height:36px;
  line-height:1.6;
  margin:14px 0;
}

.preview-dialog-actions  {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
}

#track-preview-group  {
  min-width:0;
  width:100%;
  min-height:44px;
  border-radius:999px;
  padding:10px 16px;
  font-size:12px;
  background:#272320;
}

#track-preview-add  {
  min-height:44px;
  border-radius:999px;
  padding:10px 18px;
  font-size:12px;
}

.preview-dialog-note  {
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid #ffffff0b;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  font-size:10px;
  color:#968b80;
}

.preview-dialog-note a  {
  color:#c5b7aa;
}

.preview-dialog-note i  {
  margin-right:5px;
}

@media(min-width:1101px)  {
  .spotify-shell:not(.hidden)  {
    grid-template-columns:224px minmax(0,1fr) 300px;
    grid-template-rows:68px minmax(0,1fr) 88px;
    gap:10px;
    padding:0 10px;
  }
  .spotify-shell .topnav  {
    height:68px;
    padding:0 14px;
  }
  .spotify-library,.spotify-rail  {
    border-radius:16px;
    border:1px solid #ffffff06;
    background:#131313;
  }
  .spotify-shell .dashboard-main  {
    padding:26px;
    border-radius:16px;
    background:radial-gradient(ellipse at 95% 0,#71321a3b,transparent 50%),linear-gradient(180deg,#251a14,#151413 320px);
    border:1px solid #ffffff08;
  }
  .spotify-shell #view-player  {
    gap:24px;
  }
  .spotify-shell .studio-heading h1  {
    font-size:34px;
  }
  .spotify-shell .studio-heading .section-eyebrow  {
    font-size:9px;
    letter-spacing:1.6px;
  }
  .home-chips button  {
    font-size:11px;
    padding:8px 15px;
  }
  .spotify-shell .stream-link-card  {
    display:grid;
    grid-template-columns:minmax(130px,.6fr) minmax(0,1.5fr) auto;
    align-items:center;
    gap:14px;
    border-radius:14px;
    padding:16px;
    border-color:#ff650d20;
    background:linear-gradient(110deg,#39271955,#211d1955);
  }
  .stream-link-header  {
    grid-column:1;
    display:block;
  }
  .stream-link-header h2  {
    font-size:15px;
  }
  .stream-link-header p  {
    font-size:10px;
    line-height:1.6;
  }
  .stream-link-header .broadcast-state  {
    display:none;
  }
  .stream-copy-row  {
    grid-column:2;
  }
  .stream-link-card .preview-row  {
    grid-column:3;
  }
  .stream-link-url  {
    font-size:10px;
  }
  .copy-btn  {
    padding:10px 13px;
    font-size:10px;
    min-height:36px;
  }
  .panel-heading h2,.discovery-heading h2  {
    font-size:21px;
  }
  .collection-grid  {
    gap:14px;
  }
  .collection-card  {
    padding:6px;
    border-radius:14px;
    background:#ffffff02;
  }
  .collection-card:hover  {
    background:#ffffff09;
  }
  .collection-cover  {
    border-radius:12px;
    aspect-ratio:1.12;
  }
  .collection-info  {
    padding:13px 4px 4px;
  }
  .collection-info strong  {
    font-size:14px;
  }
  .collection-info small  {
    font-size:10px;
  }
  .collection-play  {
    width:44px;
    height:44px;
    bottom:70px;
    right:16px;
  }
  .collection-menu  {
    width:30px;
    height:30px;
  }
  .studio-collections>.text-button  {
    margin-top:12px;
  }
  .spotify-shell .studio-discovery  {
    border-top:1px solid #ffffff09;
    padding-top:24px;
  }
  .spotify-shell .discovery-heading  {
    gap:14px;
  }
  .studio-search-form .search-bar  {
    background:#ffffff07;
    border:1px solid #ffffff16;
  }
  .studio-search-result  {
    padding:10px 8px;
    border-color:#ffffff06;
  }
  .studio-row-target  {
    background:#ffffff04;
    border-color:#ffffff13;
  }
  .studio-result-action  {
    border-color:#ffffff24;
  }
  .spotify-rail  {
    padding:18px;
  }
  .rail-heading  {
    margin-bottom:18px;
  }
  .spotify-shell .track-title  {
    font-size:24px;
  }
  .spotify-shell .art-frame,.spotify-shell .art-disc-wrap  {
    border-radius:12px;
  }
  .spotify-shell .studio-bottom-bar  {
    padding:8px 14px 14px;
  }
  .spotify-shell .groups-grid  {
    grid-template-columns:repeat(auto-fit,minmax(min(235px,100%),1fr));
    gap:16px;
  }
  .group-card  {
    background:#1b1a18;
    border:1px solid #ffffff0a;
    border-radius:16px;
    padding:16px;
  }
  .group-icon  {
    display:none;
  }
  .group-name  {
    font-size:16px;
  }
  .group-card-header  {
    gap:14px;
  }
  .group-actions  {
    width:100%;
    gap:10px;
  }
  .group-play-btn  {
    min-height:36px;
    padding:9px 15px;
  }
  .group-btn-cluster  {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
  }
  .group-action-btn  {
    border-color:#ffffff08;
    background:#ffffff04;
  }
  .group-tracks-preview  {
    padding-top:14px;
  }
  .groups-controls-bar  {
    background:#ffffff03;
    border-color:#ffffff09;
    padding:14px 16px;
    border-radius:14px;
  }
  .gstat--hint  {
    display:none;
  }
}

@media(min-width:1700px)  {
  .spotify-shell:not(.hidden)  {
    grid-template-columns:252px minmax(0,1fr) 340px;
  }
  .spotify-shell .dashboard-main  {
    padding:30px;
  }
  .collection-grid  {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media(min-width:1101px) and (max-width:1200px)  {
  .spotify-shell:not(.hidden)  {
    grid-template-columns:220px minmax(0,1fr);
  }
}

@media(min-width:1201px)  {
  .spotify-shell.rail-collapsed:not(.hidden)  {
    grid-template-columns:224px minmax(0,1fr);
  }
}

@media(max-width:1000px)  {
  .result-grid  {
    grid-template-columns:1fr;
  }
}

@media(max-width:800px)  {
  .studio-search-result[data-mode="tracks"]  {
    grid-template-columns:34px minmax(0,1fr) 80px 34px 50px;
    gap:7px;
  }
}

@media(max-width:600px)  {
  .track-preview-button  {
    width:40px;
    height:40px;
    min-width:40px;
    font-size:13px;
  }
  .studio-search-result[data-mode="tracks"]  {
    grid-template-columns:34px minmax(0,1fr) 68px 40px 44px;
    gap:5px;
  }
  .studio-search-result[data-mode="tracks"] .studio-result-art  {
    width:34px;
    height:34px;
  }
  .studio-search-result[data-mode="tracks"] .studio-result-info strong  {
    font-size:11px;
  }
  .studio-search-result[data-mode="tracks"] .studio-row-target  {
    font-size:9px;
    padding:4px;
  }
  .studio-search-result[data-mode="tracks"] .studio-result-action  {
    font-size:9px;
  }
  .track-preview-dialog  {
    position:fixed;
    inset:auto 0 0;
    margin:0;
    max-width:100%;
    width:100%;
    max-height:calc(var(--app-height,100dvh) - 20px);
    overflow:auto;
    border-radius:24px 24px 0 0;
    padding:22px 20px calc(24px + env(safe-area-inset-bottom));
  }
  #track-preview-title  {
    font-size:23px;
  }
  #track-preview-group  {
    font-size:16px;
    padding:10px 12px;
  }
  #track-preview-add  {
    font-size:11px;
    padding:10px 13px;
  }
  .preview-dialog-header .icon-button  {
    width:44px;
    height:44px;
  }
  .result-card  {
    padding:12px;
    gap:9px;
  }
  .result-art  {
    width:44px;
    height:44px;
  }
  .result-info strong  {
    font-size:12px;
  }
  .btn-add  {
    min-height:40px;
    padding:8px 10px;
  }
  .group-cover  {
    aspect-ratio:2;
    margin-bottom:16px;
  }
}


/* Keep playback hit areas steady under the pointer and during state updates. */
.ctrl--play,
.mini-controls .mini-play,
.collection-play,
.track-preview-button,
.track-mini-btn,
.group-play-btn {
  transform: none !important;
  filter: none !important;
  animation: none;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}

@media (hover: hover) {
  .ctrl--play:hover:not(:disabled),
  .mini-controls .mini-play:hover:not(:disabled),
  .collection-play:hover:not(:disabled),
  .track-preview-button:hover:not(:disabled),
  .track-mini-btn:hover:not(:disabled),
  .group-play-btn:hover:not(:disabled) {
    box-shadow: 0 0 0 3px #ff650d33;
  }
}

.ctrl--play > i,
.mini-play > i,
.collection-play > i,
.track-preview-button > i,
.track-mini-btn > i,
.group-play-btn > i {
  pointer-events: none;
  transition: none;
}

/* Keep artwork inside its cover layer, independent of the hover filter. */
.collection-card {
  isolation: isolate;
}

.collection-cover {
  isolation: isolate;
  z-index: 0;
}

.collection-play,
.collection-menu {
  z-index: 3;
}

.group-art-image {
  pointer-events: none;
}

/* Give the full account pill the same warm background as its avatar. */
.spotify-shell .user-chip {
  min-height: 42px;
  min-width: 0;
  max-width: 240px;
  padding: 4px 12px 4px 4px;
  gap: 9px;
  border: 1px solid #ff650d40;
  border-radius: 999px;
  background: linear-gradient(110deg, #ff650d30, #ff650d18);
  color: #ffe1c9;
  box-shadow: inset 0 0 0 1px #ffb07808;
}

.spotify-shell .user-chip:hover:not(:disabled) {
  background: linear-gradient(110deg, #ff650d48, #ff650d28);
  border-color: #ff650d75;
  filter: none;
}

.spotify-shell .user-chip-avatar {
  flex-shrink: 0;
  background: #ff650d26;
}

.spotify-shell .user-chip #display-user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-shell .user-chip > .fa-chevron-down {
  flex-shrink: 0;
  color: #ffc79f;
}

@media (max-width: 600px) {
  .spotify-shell .user-chip {
    width: 40px;
    min-height: 40px;
    padding: 4px;
    justify-content: center;
    gap: 0;
  }
}
