/* Visual polish pass, measured against the Apple Music reference captures. Loaded last. */

/* Collection header follows the playlist header: identity, definition, status, actions. */
.collection-header{display:flex;align-items:stretch;gap:28px;margin:4px 0 26px}
.collection-header-art{flex:none;width:200px;display:flex;align-items:flex-end}
.collection-header-art .glass-folder{margin:0}
.collection-header-info{min-width:0;flex:1;display:flex;flex-direction:column;justify-content:flex-end}
.collection-header-info h1{font-size:28px;font-weight:500;line-height:1.16;letter-spacing:-.02em;margin:0 0 6px;overflow-wrap:anywhere}
.collection-definition{font-size:15px;line-height:1.4;color:var(--muted);margin:0 0 8px;overflow-wrap:anywhere}
.collection-status{font-size:12px;color:var(--faint);margin:0}
.collection-note{font-size:13px;line-height:1.5;color:var(--muted);margin:10px 0 0;max-width:560px}
.collection-actions{display:flex;align-items:center;gap:10px;margin-top:18px;min-width:0}
.collection-actions .button{min-height:32px;padding:0 16px;border-radius:16px}
.collection-actions .button.secondary{background:var(--hover);border:0}
.collection-play svg{width:11px;height:11px;fill:currentColor;stroke:none}
.collection-more{width:32px;height:32px;border-radius:50%;background:var(--hover);flex:none}
.collection-sort{margin-left:auto;min-width:0}
.collection-sort .select-trigger{width:auto}

/* Rows stay two lines; status sits beside the title. */
.song-title-line{display:flex;align-items:center;gap:6px;min-width:0}
.song-title-line .track-name{display:block;flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.title-badge{flex:none;display:inline-flex;align-items:center;height:17px;padding:0 7px;border-radius:9px;background:#ffffff10;color:var(--muted);font-size:11px;line-height:1;white-space:nowrap}
button.title-badge{cursor:pointer}
button.title-badge:hover{background:#ffffff1c;color:var(--text);text-decoration:none}
.new-dot{display:inline-block;width:6px;height:6px;margin-right:7px;border-radius:50%;background:var(--text);vertical-align:2px}
.release-title .new-dot{vertical-align:1px}
.song-table .label-cell small,.label-cell small{font-size:11px}
.song-table .label-cell button,.label-cell button{font-size:12px}

/* Browse: one row of capsules; each opens its panel directly below the row, which stays visible. */
.inline-filter-strip{gap:8px;row-gap:8px;align-items:center}
.filter-capsule{display:inline-flex;align-items:center;max-width:100%;min-height:32px;border-radius:16px;box-shadow:inset 0 0 0 1px #ffffff1f}
.filter-capsule.active{background:var(--text);box-shadow:none}
.filter-capsule.active .filter-capsule-open,.filter-capsule.active .filter-capsule-open>svg{color:var(--panel)}
.filter-capsule.open{background:#ffffff1f;box-shadow:inset 0 0 0 1px #ffffff47}
.filter-capsule.active.open{background:var(--text);box-shadow:inset 0 0 0 2px #ffffff47}
.filter-capsule-open{display:inline-flex;align-items:center;gap:6px;min-width:0;min-height:32px;padding:0 12px;border-radius:16px;font-size:12px;color:var(--text)}
.filter-capsule-title{white-space:nowrap}
.filter-capsule-open>svg{width:10px;height:10px;flex:none;rotate:90deg;color:var(--muted);transition:rotate .15s}
.filter-capsule.open .filter-capsule-open>svg{rotate:-90deg}
@media(hover:hover) and (pointer:fine){.filter-capsule:not(.open):not(.active):hover{background:#ffffff0d}}
.inline-reset[data-idle]{visibility:hidden}
@media(prefers-reduced-motion:reduce){.filter-capsule-open>svg,.genre-expand svg{transition:none}}
.inline-reset{padding:0 4px}
.filter-strip-end{display:flex;align-items:center;gap:14px;margin-left:auto;min-width:0}
.matching-count{font-size:12px;color:var(--faint);white-space:nowrap;font-variant-numeric:tabular-nums}
.browse-result-note{font-size:11px;color:var(--faint)}
.filter-strip-end .select-control{width:auto;margin:0}
.filter-strip-end .select-trigger{width:auto;min-height:30px;font-size:12px}
.inline-refine{margin-bottom:12px}
#browse-lookup-slot{position:relative;height:0;margin:0;z-index:30}
#browse-lookup-slot>.search-surface.inline-lookup{display:block;position:absolute;top:0;left:0;width:min(100%,440px);max-height:560px;overflow:auto;overscroll-behavior:contain;margin:0;padding:8px 14px 12px;border-radius:12px;background:var(--panel);box-shadow:inset 0 0 0 1px #ffffff14,0 14px 40px #00000073}
#browse-lookup-slot .picker-list{max-height:300px}
.filter-chip{display:inline-flex;align-items:center;gap:2px;min-height:28px;padding:0 4px 0 11px;border-radius:14px;background:#ffffff14;font-size:12px;color:var(--text)}
.filter-chip-clear{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;color:var(--muted)}
.filter-chip-clear svg{width:10px;height:10px}
.filter-chip-clear:hover{background:#ffffff14;color:var(--text)}

/* Released and More panels: short choice lists that apply immediately. */
.filter-panel-heading{display:flex;align-items:center;justify-content:space-between;min-height:34px}
.filter-panel-heading h3{font-size:13px;font-weight:500}
.filter-choice{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:start;gap:10px;padding:9px 0;border-top:1px solid var(--line)}
.filter-choice-title{padding-top:6px;font-size:12px;color:var(--muted)}
.filter-choice-options{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.filter-choice-options>button{min-height:28px;padding:0 11px;border-radius:14px;font-size:12px;color:var(--text);box-shadow:inset 0 0 0 1px #ffffff1f}
.filter-choice-options>button:hover{background:#ffffff0d}
.filter-choice-options>button[aria-pressed=true]{background:var(--text);color:var(--panel);box-shadow:none}
.filter-panel-actions{display:flex;align-items:center;gap:16px}
.filter-panel-actions .text-button{min-height:34px;padding:0;font-size:12px}
.filter-choice.untitled{grid-template-columns:minmax(0,1fr)}
.filter-choice-options>button[data-filter-toggle]{display:inline-flex;align-items:center;gap:5px}
.filter-choice-options>button svg{width:11px;height:11px}
.filter-panel .bpm-range{margin:0;padding:10px 0;border-top:1px solid var(--line);max-width:none}
.key-grid{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:8px 10px;padding:10px 0;border-top:1px solid var(--line)}
.key-grid .filter-choice-title{padding:0}
.key-row{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.key-row button{min-height:28px;border-radius:14px;font-size:12px;font-variant-numeric:tabular-nums;color:var(--text);box-shadow:inset 0 0 0 1px #ffffff1f}
.key-row button:hover{background:#ffffff0d}
.key-row button[aria-pressed=true]{background:var(--text);color:var(--panel);box-shadow:none}
.filter-panel .custom-dates{margin:0 0 6px 86px}
.filter-note{margin:8px 0 0;font-size:11px;line-height:1.5;color:var(--faint)}
.filter-note .text-button{display:inline;padding:0;font-size:11px;text-decoration:underline}

/* Follow sets, genre families and chosen references inside the search panels. */
.picker-quick:empty,.reference-selected:empty{display:none}
.picker-quick{display:grid;gap:2px;padding:6px 0;margin-bottom:2px;border-bottom:1px solid var(--line)}
.picker-quick-icon{width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:50%;background:#ffffff10;color:var(--text)}
.picker-quick-icon svg{width:14px;height:14px}
.genre-mode{display:inline-flex;gap:2px;padding:2px;border-radius:9px;background:#ffffff0d;justify-self:start}
.genre-mode button{min-height:26px;padding:0 14px;border-radius:7px;font-size:12px;color:var(--muted)}
.genre-mode button[aria-pressed=true]{background:#ffffff1f;color:var(--text)}
.genre-family{display:flex;align-items:center;gap:2px}
.genre-family .picker-item{flex:1;min-width:0}
.genre-expand{width:30px;height:30px;flex:none;border-radius:50%}
.genre-expand svg{width:11px;height:11px;transition:rotate .15s}
.genre-expand[aria-expanded=true] svg{rotate:90deg}
.genre-members{padding-left:22px}
.picker-item[aria-pressed=mixed] .picker-check{color:var(--text)}
.reference-selected{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0 4px}
.reference-selected-song{display:inline-flex;align-items:center;gap:6px;max-width:240px;min-height:28px;padding:0 9px 0 3px;border-radius:14px;background:#ffffff14;font-size:12px;color:var(--text)}
.reference-selected-song img{width:22px;height:22px;border-radius:50%}
.reference-selected-song span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reference-selected-song svg{width:9px;height:9px;flex:none;color:var(--muted)}

/* Home: Best New Songs proportions, dated release captions. */
.home-updates-shelf.home-song-grid{grid-template-rows:repeat(4,56px);row-gap:0}
.home-updates-shelf.home-song-grid>.home-song,.discovery-song-shelf .home-song{height:56px;border-bottom:1px solid var(--line)}
.home-updates-shelf>.home-song:nth-child(4n),.discovery-song-shelf>.home-song:nth-child(4n){border-bottom:0}
.home-updates-shelf>.home-song:nth-child(3n+1){scroll-snap-align:none}
.home-updates-shelf>.home-song:nth-child(4n+1){scroll-snap-align:start}
.home-updates-shelf .home-song-art img,.discovery-song-shelf .home-song-art img{width:48px;height:48px}
.discovery-song-shelf.music-shelf{grid-template-rows:repeat(4,56px)}
.music-art-shelf.music-shelf,.profile-release-shelf.music-shelf{grid-auto-columns:clamp(160px,calc((var(--closed-content-width,1000px) - 80px)/5.1),210px)}
.music-art-shelf .release-year,.home-release-grid .release-year{display:block}
.release-facts{display:block;font-size:11px;line-height:1.4;color:var(--faint);margin-top:2px}

/* Nothing that carries state is smaller than 11px. */
.source-card small,.music-source-shelf .source-card small,#home-source-cards .source-card small{font-size:11px}
.collection-caption,.release-year,.list-footer{font-size:11px}
@media(prefers-contrast:more){.collection-status,.matching-count,.release-facts,.title-badge,.source-card small{color:#cccccc}}

/* Undo needs to be clickable inside the toast. */
#toast:has(.toast-action){pointer-events:auto;display:flex;align-items:center;gap:14px}
.toast-action{padding:0;font-size:inherit;font-weight:600;color:inherit;text-decoration:underline}

@media(max-width:700px){
  .collection-header{flex-direction:column;align-items:center;gap:16px;text-align:center}
  .collection-header-art{width:168px;justify-content:center}
  .collection-header-art .glass-folder{--folder-size:168px!important;--scale:1.05!important}
  .collection-header-info h1{font-size:24px}
  .collection-actions{justify-content:center;flex-wrap:wrap}
  .collection-sort{margin-left:0}
  .home-updates-shelf.home-song-grid{grid-template-rows:repeat(4,64px)}
  .home-updates-shelf.home-song-grid>.home-song{height:64px}
  .source-card small{font-size:11px}
  .source-card-name{font-size:11px}
  .collection-caption{font-size:11px}
  .filter-strip-end{width:100%;margin-left:0}
  .filter-strip-end .matching-count{margin-right:auto}
  .filter-choice{grid-template-columns:1fr;gap:6px}
  .filter-choice-title{padding-top:0}
  .filter-panel .custom-dates{margin-left:0}
}
/* Search results keep their counts hidden; follow sets and genre families need their one-line explanation. */
#source-picker .picker-quick-item small,#source-picker .genre-family-item small{display:block}
.reference-suggestions:empty{display:none}
.reference-suggestions{padding:8px 0 2px}
.reference-suggestion-list{display:flex;flex-wrap:wrap;gap:6px;max-height:104px;margin-top:6px;overflow:auto}
.reference-suggestion{background:transparent;box-shadow:inset 0 0 0 1px #ffffff1f}
.reference-suggestion:hover{background:#ffffff0d}
/* Genres page: Apple Browse Categories tiles, one colour per family with an artist from it. */
.genre-list{list-style:none;margin:0;padding:0;columns:2;column-gap:40px;max-width:900px}
.genre-list li{break-inside:avoid;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line)}
.genre-link{flex:1;min-width:0;padding:15px 0;text-align:left;font-size:15px;color:var(--text)}
.genre-link:hover{color:#fff}
.genre-follow{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;color:var(--muted);box-shadow:inset 0 0 0 1px #ffffff1f}
.genre-follow svg{width:13px;height:13px}
.genre-follow:hover{color:#fff;background:#ffffff0d}
.genre-follow[aria-pressed=true]{color:var(--text);background:#ffffff14;box-shadow:none}
.discovery-actions{display:flex;align-items:center;gap:22px}
.genre-subgenres{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 22px}
.genre-subgenres button{min-height:28px;padding:0 11px;border-radius:14px;font-size:12px;color:var(--text);box-shadow:inset 0 0 0 1px #ffffff1f}
.genre-subgenres button:hover{background:#ffffff0d}
/* Home collections are one shelf like every other Home row; the Collections page keeps the full grid. */
@media(max-width:700px){.collection-shelf .glass-folder{--folder-size:120px!important;--scale:.75!important}}
.profile-stats{margin:4px 0 0;font-size:12px;color:var(--faint)}
@media(max-width:700px){.genre-list{columns:1}.genre-link{padding:13px 0;font-size:14px}.discovery-actions{gap:16px}}

/* Curation channel signal */
.home-song-aside{flex:none;font-size:11px;color:var(--faint);font-variant-numeric:tabular-nums;margin-left:4px}
.page-note{margin:-6px 0 18px;font-size:12px;color:var(--faint);max-width:620px}
.detail-channel{text-decoration:none;color:inherit}
.detail-channel span{display:flex;justify-content:space-between;gap:12px;flex:1;min-width:0}
.detail-channel small{color:var(--faint);font-size:11px}
.detail-section+.detail-section{margin-top:22px}
.playlist-context.playlist-new{color:var(--text)}
.playlist-cover{width:148px;height:148px;flex:none;border-radius:5px;object-fit:cover;box-shadow:0 4px 15px #00000022}
.tracked-playlist-page .profile-actions{display:flex;align-items:center;gap:16px;margin-top:14px}
.tracked-playlist-page .profile-follow{display:flex;align-items:center;gap:6px;min-height:32px;padding:6px 12px;border-radius:18px;background:#ffffff0c;color:var(--text);font-size:12px}
.tracked-playlist-page .profile-follow:hover{background:#ffffff14}
.tracked-playlist-page .profile-actions .text-button{margin-top:0}
@media(max-width:700px){.playlist-cover{width:112px;height:112px}}
/* One notification bubble, styled like the folder's count: dark, a thin light edge, top-right of the artwork. Hovering the bubble swaps the count for ×, which marks it seen. */
.notice-bubble{position:absolute;top:0;right:0;transform:translate(35%,-35%);z-index:6;width:28px;height:28px;padding:0;pointer-events:auto;display:grid;place-items:center;border-radius:999px;font-size:13px;font-weight:400;line-height:normal;font-variant-numeric:tabular-nums;color:var(--text);background:linear-gradient(145deg,#3e3e3ee8,#191919f5);border:1px solid #f4f4f442;box-shadow:0 2px 5px #00000044,inset 0 1px #ffffff08;cursor:pointer;transition:background .15s,border-color .15s}
.notice-bubble>*{grid-area:1/1;transition:opacity .12s}
.notice-count{position:static;display:block;margin:0;padding:0;line-height:normal;letter-spacing:0;text-align:center}
.notice-bubble>svg{width:12px;height:12px;stroke-width:2;opacity:0}
.notice-bubble[data-digits="2"]>.notice-count{font-size:13px;letter-spacing:-.1px}
.notice-bubble[data-digits="3"]>.notice-count{font-size:11px;letter-spacing:-.25px}
.notice-bubble:is(:hover,:focus-visible){background:linear-gradient(145deg,#4a4a4a,#262626);border-color:#f4f4f466}
.notice-bubble:is(:hover,:focus-visible)>.notice-count{opacity:0}
.notice-bubble:is(:hover,:focus-visible)>svg{opacity:1}
.notice-bubble:focus-visible{outline:2px solid var(--text);outline-offset:3px}
/* Clear controls are siblings of the opening buttons, outside decorative glass. */
.source-portrait-wrapper{position:relative;display:block;width:max-content;margin:0 auto 12px}
.source-portrait-wrapper .source-portrait{margin:0}
.source-portrait-wrapper .notice-bubble{top:2px;right:2px}
.source-card-wrap .source-card-name{display:block;padding:0;text-align:center}
.collection-card{--collection-art-size:150px}
.collection-notice{left:calc(50% + var(--collection-art-size)*.43);right:auto;top:calc(2px + var(--collection-art-size)*.2441688312);transform:translate(-50%,-50%)}
.collection-link-wrapper{position:relative;min-width:0}
.collection-link-wrapper:has(.sidebar-notice) .collection-link{padding-right:48px}
.notice-bubble.sidebar-notice{top:50%;right:8px;transform:translateY(-50%)}
@media(min-width:600px) and (max-width:700px){.collection-link-wrapper:has(.sidebar-notice) .collection-link{padding-right:7px}.notice-bubble.sidebar-notice{top:-3px;right:-2px;transform:none}}
@media(max-width:700px){.collection-card{--collection-art-size:116px}.collection-shelf .collection-card{--collection-art-size:120px}.source-portrait-wrapper{margin-bottom:10px}}
.row-art:disabled{cursor:default}.row-art:disabled>span{display:none}
@media(prefers-reduced-motion:reduce){.notice-bubble,.notice-bubble>*{transition:none}}
/* Following: portraits, covers and pills like the rest of the app, each with a corner follow control. */
.following-title{flex-wrap:wrap;margin-bottom:24px}
.following-search{flex:0 1 360px;min-width:220px}
.follow-section{margin-bottom:34px}
.follow-section h2{font-size:17px;font-weight:500;margin:0 0 14px}
.follow-section h2 span{font-size:13px;font-weight:400;color:var(--faint);margin-left:4px}
.follow-tiles{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:22px 18px}
.follow-tiles.covers{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.follow-tile{min-width:0;text-align:center}
.follow-tiles.covers .follow-tile{text-align:left}
.follow-art{position:relative;display:block;width:88px;margin:0 auto 9px}
.follow-tiles.covers .follow-art{width:100%;margin:0 0 9px}
.follow-art-open{display:block;width:100%;aspect-ratio:1;padding:0;border-radius:8px;overflow:hidden;background:#ffffff0a}
.follow-tile.round .follow-art-open{border-radius:50%}
.follow-art-open img{width:100%;height:100%;object-fit:cover}
.follow-monogram{display:grid;place-items:center;width:100%;height:100%;font-size:22px;color:var(--muted)}
.follow-tile.unfollowed .follow-art-open{opacity:.45}
.follow-name{display:block;max-width:100%;margin:0 auto;padding:0;font-size:13px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.follow-tiles.covers .follow-name{margin:0}
.follow-tile small{display:block;margin-top:3px;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.follow-corner{position:absolute;top:0;right:0;transform:translate(25%,-25%);width:26px;height:26px;display:grid;place-items:center;border-radius:999px;color:var(--text);background:linear-gradient(145deg,#3e3e3ee8,#191919f5);border:1px solid #f4f4f442;box-shadow:0 2px 5px #00000044,inset 0 1px #ffffff08}
.follow-tile.round .follow-corner{transform:translate(0,0)}
.follow-corner>svg{grid-area:1/1;width:12px;height:12px;stroke-width:2}
.follow-corner[aria-pressed=true]>svg:last-child{opacity:0}
.follow-corner[aria-pressed=true]:hover>svg:first-child{opacity:0}
.follow-corner[aria-pressed=true]:hover>svg:last-child{opacity:1}
.follow-corner:hover{background:linear-gradient(145deg,#4a4a4a,#262626);border-color:#f4f4f466}
.follow-pills{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.follow-pill{display:flex;align-items:center;border-radius:18px;background:#ffffff0c;box-shadow:inset 0 0 0 1px #ffffff14}
.follow-pill>button:first-child{padding:8px 4px 8px 14px;font-size:13px;color:var(--text)}
.follow-pill-toggle{display:grid;place-items:center;width:30px;height:30px;margin-right:2px;border-radius:50%;color:var(--muted)}
.follow-pill-toggle svg{width:12px;height:12px}
.follow-pill-toggle:hover{color:var(--text);background:#ffffff12}
.follow-pill.unfollowed{background:none}
.follow-pill.unfollowed>button:first-child{color:var(--muted)}
.follow-empty{font-size:13px;color:var(--muted);padding:6px 0 0}
@media(max-width:700px){.following-search{flex:1 1 100%}.follow-tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 12px}.follow-tiles.covers{grid-template-columns:repeat(2,minmax(0,1fr))}.follow-art{width:76px}.follow-corner{width:30px;height:30px}}
/* Room above artwork shelves so a corner bubble isn't clipped by the horizontal scroller. */
.home-playlist-shelf .music-art-shelf{padding-top:12px;margin-top:-10px}
/* Start from a brief: each card names the intent, says what it brings in, and shows what it would bring in now. */
.intent-strip{margin:0 0 22px}
.intent-strip h2{font-size:13px;font-weight:500;color:var(--muted);margin:0 0 10px}
.intent-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.intent-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto auto;column-gap:12px;row-gap:3px;align-items:start;padding:12px;border-radius:10px;background:#ffffff08;box-shadow:inset 0 0 0 1px #ffffff12;text-align:left;color:var(--text)}
.intent-card:hover{background:#ffffff0f}
.intent-art{grid-row:1/4;display:grid;grid-template-columns:repeat(2,26px);grid-auto-rows:26px;gap:2px;width:54px}
.intent-art img{width:26px;height:26px;border-radius:3px;object-fit:cover}
.intent-art img:first-child{grid-column:1/3;grid-row:1;width:54px;height:26px}
.intent-card strong{font-size:13px;font-weight:500}
.intent-card>span:not(.intent-art){font-size:12px;line-height:1.4;color:var(--muted)}
.intent-card small{font-size:11px;color:var(--faint);font-variant-numeric:tabular-nums}
@media(max-width:700px){.intent-grid{grid-template-columns:1fr}}
