.header .account-menu-slot[data-account-menu]{display:flex;gap:8px;width:96px;flex-basis:96px}
.header .account-menu-slot[data-account-menu][data-account-authenticated="1"]{width:148px;flex-basis:148px}
.account-upload-link,.account-upload-menu>summary{display:flex;align-items:center;justify-content:center;width:44px;height:44px;box-sizing:border-box;flex:0 0 44px;border:1px solid #ad6a22;border-radius:14px;background:#17130f;color:#ffb65b;cursor:pointer;list-style:none;box-shadow:0 0 12px #ff910016;touch-action:manipulation}
.account-upload-menu{flex:0 0 44px}.account-upload-menu>summary::-webkit-details-marker{display:none}.account-upload-menu>summary::marker{content:""}.account-upload-link>svg,.account-upload-menu>summary>svg{width:22px;height:22px}
.account-upload-link:hover,.account-upload-menu>summary:hover,.account-upload-menu[open]>summary{border-color:#ffad39;box-shadow:0 0 16px #ff99002a}.account-upload-link:focus-visible,.account-upload-menu>summary:focus-visible{outline:2px solid #ffb44f;outline-offset:2px}
@media(max-width:380px){.header .header-inner{column-gap:10px}.header-inner:has(>.account-menu-slot)>.brand{gap:7px}.header-inner:has(>.account-menu-slot)>.brand .brand-symbol{width:28px;height:28px;flex-basis:28px;border-radius:9px}.header-inner:has(>.account-menu-slot)>.brand .brand-name{font-size:18px;letter-spacing:-.5px}}

/* Keep every header control within the viewport, including the photo section. */
@media(min-width:901px){
 .header .header-inner{min-height:76px;padding:10px 24px;gap:12px}
 .header .top-nav{flex:0 0 auto;gap:6px;white-space:nowrap}
 .header .top-nav a{min-height:42px;padding-inline:10px;border-radius:13px;font-size:12px}
 .header .top-nav a.active::after{left:12px;right:12px;bottom:5px}
 .header .search{flex:1 1 0%;min-width:92px;max-width:365px;height:42px;padding-inline:10px;gap:7px;border-radius:13px}
 .header .search input{min-width:0}
 .header .search>.icon{flex-shrink:0;width:18px;height:18px}
 .header .search-submit{flex-shrink:0;padding:6px}
 .header .saved-nav{min-height:42px;padding-inline:10px;gap:6px;border-radius:13px;font-size:11px;flex-shrink:0}
 .cm-page.cm-public .header-inner,.header .header-inner.information-header{gap:12px}
}
@media(max-width:900px){
 .cm-page.cm-public .top-nav,.header .information-header .top-nav{gap:6px}
 .cm-page.cm-public .top-nav a,.header .information-header .top-nav a{padding-inline:9px}
}
@media(max-width:380px){
 .cm-page.cm-public .top-nav,.header .information-header .top-nav{gap:5px}
 .cm-page.cm-public .top-nav a,.header .information-header .top-nav a{font-size:11px;padding-inline:7px}
}

/* Mobile header: a single stable row for the brand and account controls. */
@media(max-width:680px){
 .header .header-inner:has(>.account-menu-slot){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 8px;padding:12px clamp(12px,3vw,20px);min-height:0}
 .header .header-inner:has(>.saved-nav){grid-template-columns:minmax(0,1fr) 44px 96px}
 .header .header-inner:has(>.saved-nav):has(>.account-menu-slot[data-account-authenticated="1"]){grid-template-columns:minmax(0,1fr) 148px}
 .header .header-inner:has(>.account-menu-slot)>.brand{grid-column:1;grid-row:1;justify-self:start;min-width:0;max-width:100%;gap:7px;font-size:clamp(18px,5.6vw,25px);letter-spacing:-.8px}
 .header .header-inner:has(>.account-menu-slot)>.brand .brand-name{font-size:inherit;letter-spacing:inherit}
 .header .header-inner:has(>.account-menu-slot)>.brand .brand-symbol{width:31px;height:31px;flex:0 0 31px;border-radius:10px}
 .header .header-inner:has(>.account-menu-slot)>.saved-nav{grid-column:2;grid-row:1;position:relative;justify-content:center;justify-self:end;width:44px;height:44px;min-height:44px;margin:0;padding:0;gap:0;box-sizing:border-box;border-radius:12px}
 .header .header-inner:has(>.account-menu-slot)>.saved-nav>span:not(.saved-count){display:none}
 .header .header-inner:has(>.account-menu-slot)>.saved-nav>.icon{width:18px;height:18px;flex:0 0 18px}
 .header .header-inner:has(>.account-menu-slot)>.saved-nav>.saved-count{position:absolute;top:-4px;right:-3px;min-width:16px;padding:2px 4px;font-size:9px;line-height:14px;border:1px solid #71511f;border-radius:8px}
 .header .header-inner:has(>.account-menu-slot)>.account-menu-slot{grid-column:-2/-1;grid-row:1;justify-self:end;margin:0}
 .header .header-inner:has(>.account-menu-slot)>.search{grid-column:1/-1;grid-row:2;order:initial;width:100%;min-width:0;max-width:none;margin:0}
 .header .header-inner:has(>.account-menu-slot)>.top-nav{grid-column:1/-1;grid-row:2;min-width:0;width:100%;margin:0}
 .header .header-inner:has(>.account-menu-slot):has(>.search)>.top-nav{grid-row:3}
}

/* Public pages share the catalog header, including Community and information. */
@media(min-width:681px){
 .header .header-inner.pf-public-header{display:flex;grid-template-columns:none;gap:12px;justify-content:initial}
 .header .pf-public-header>.brand,.header .pf-public-header>.search,.header .pf-public-header>.saved-nav,.header .pf-public-header>.account-menu-slot{grid-area:auto;order:initial}
 .header .pf-public-header>.top-nav{grid-area:auto;flex-wrap:nowrap;justify-content:initial;justify-self:auto}
 .header .pf-public-header>.account-menu-slot{margin-left:0}
}
@media(min-width:901px){
 .header .pf-public-header>.top-nav{order:initial}
}
@media(max-width:900px){
 .header .pf-public-header>.top-nav{display:flex;order:4;gap:8px;flex-wrap:nowrap;justify-content:initial}
 .header .pf-public-header>.top-nav a{min-height:40px;padding:10px 8px;font-size:12px}
}
@media(max-width:680px){
 .header .pf-public-header>.top-nav a{font-size:11px}
}

/* Header icons share the navigation's subtle mouse hover, without moving popups. */
.header .account-menu-slot :is(.account-upload-link,.account-guest-link,.account-upload-menu>summary,.account-user-menu>summary,.account-notifications>summary){
 transition:transform 180ms ease,border-color 180ms ease,box-shadow 180ms ease;
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .header .account-menu-slot :is(.account-upload-link,.account-guest-link,.account-upload-menu>summary,.account-user-menu>summary,.account-notifications>summary):hover{transform:translateY(-2px)}
}
@media(prefers-reduced-motion:reduce){
 .header .account-menu-slot :is(.account-upload-link,.account-guest-link,.account-upload-menu>summary,.account-user-menu>summary,.account-notifications>summary){transform:none;transition:none}
}

/* Keep the six main destinations on one row without shrinking brand or controls. */
@media(max-width:900px){
 .header .pf-public-header>.top-nav{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#875722 #171411;padding-block:2px 5px;scroll-padding-inline:2px}
 .header .pf-public-header>.top-nav>a{flex:0 0 auto;white-space:nowrap}
}
/* At narrow desktop widths the search gets its own row, keeping a useful width. */
@media(min-width:901px) and (max-width:1150px){
 .header .header-inner.pf-public-header{flex-wrap:wrap}
 .header .pf-public-header>.search{order:5;flex:1 0 100%;max-width:none}
 .header .pf-public-header>.top-nav{flex:1 1 auto}
}

/* Phones: all six destinations visible, compact two-row grid. Desktop unchanged. */
@media(max-width:680px){
 .header .header-inner.pf-public-header>.top-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:44px;gap:6px;overflow:visible;overscroll-behavior:auto;padding:0;scrollbar-width:auto;align-items:stretch;justify-content:stretch}
 .header .header-inner.pf-public-header>.top-nav>a{display:flex;align-items:center;justify-content:center;min-width:0;width:100%;height:44px;min-height:44px;padding:5px 4px;margin:0;font-size:12px;line-height:1.2;white-space:nowrap;text-align:center;border-radius:13px}
}

/* Smart header: translate only; the original box and all six links keep their space. */
@media(max-width:680px){
 .header.pf-smart-header{transition:transform 200ms ease}
 .header.pf-smart-header.pf-header-compact{transform:translateY(calc(-1 * var(--pf-header-fold,0px)))}
 .header.pf-smart-header:has(.search:focus-within,.account-menu-slot:focus-within,.brand:focus-visible,.saved-nav:focus-visible){transform:none;transition:none}
}
/* Only real toggle actions; never touch the existing reaction animator. */
:is([data-save],[data-performer-follow])[aria-pressed]{transition:color 180ms ease,background-color 180ms ease,border-color 180ms ease}
[data-save-label]{display:inline-block;min-inline-size:7ch;text-align:center}
button[data-performer-follow]{min-inline-size:10.8em}
[data-performer-follow][aria-pressed=true]{border-color:var(--accent,#f90);color:var(--accent,#f90)}
/* Existing contextual menus retain their anchors and handlers. */
body :is(.account-menu-popup,.account-notifications-popup,.pf-sort-panel){animation:pf-interface-panel-in 180ms ease-out}
@keyframes pf-interface-panel-in{from{opacity:0;transform:translateY(var(--pf-panel-offset,-5px))}to{opacity:1;transform:none}}
/* Only Share and Add-to-playlist; no login, CAPTCHA, reporting or critical dialogs. */
#share-dialog[open],#playlist-dialog[open]{animation:pf-interface-panel-in 180ms ease-out}
#share-dialog:not([open]),#playlist-dialog:not([open]){pointer-events:none}
#share-dialog::backdrop,#playlist-dialog::backdrop{backdrop-filter:none}
@media(max-width:680px){
 #share-dialog,#playlist-dialog{--pf-panel-offset:12px;position:fixed;inset:auto 0 calc(var(--pf-sheet-bottom,0px) + max(8px,env(safe-area-inset-bottom))) 0;margin:0 auto;width:min(440px,calc(100% - 20px));max-width:calc(100% - 20px);max-height:calc(var(--pf-sheet-height,100dvh) - 24px);border-radius:22px 22px 16px 16px;scroll-padding:16px}
}
/* Discrete transitions keep the native top layer during the short exit. */
@supports(transition-behavior:allow-discrete){
 #share-dialog,#playlist-dialog{opacity:0;transform:translateY(var(--pf-panel-offset,-5px));transition:opacity 180ms ease,transform 180ms ease,display 180ms allow-discrete,overlay 180ms allow-discrete}
 #share-dialog[open],#playlist-dialog[open]{opacity:1;transform:none;animation:none}
 @starting-style{#share-dialog[open],#playlist-dialog[open]{opacity:0;transform:translateY(var(--pf-panel-offset,-5px))}}
 #share-dialog::backdrop,#playlist-dialog::backdrop{opacity:0;transition:opacity 180ms ease,display 180ms allow-discrete,overlay 180ms allow-discrete}
 #share-dialog[open]::backdrop,#playlist-dialog[open]::backdrop{opacity:1}
 @starting-style{#share-dialog[open]::backdrop,#playlist-dialog[open]::backdrop{opacity:0}}
}
@media(prefers-reduced-motion:reduce){
 .header.pf-smart-header,:is([data-save],[data-performer-follow])[aria-pressed]{transition:none}
 body :is(.account-menu-popup,.account-notifications-popup,.pf-sort-panel),#share-dialog[open],#playlist-dialog[open]{animation:none}
 #share-dialog,#playlist-dialog,#share-dialog::backdrop,#playlist-dialog::backdrop{transition:none}
}

/* Shorts proposal: seven destinations, two rows, no horizontal scroll. */
@media(max-width:680px){
 .header .header-inner.pf-public-header>.top-nav:has(>a:nth-child(7):last-child){grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:44px;gap:6px}
 .header .header-inner.pf-public-header>.top-nav:has(>a:nth-child(7):last-child)>a{grid-column:span 3;padding-inline:3px;font-size:12px}
 .header .header-inner.pf-public-header>.top-nav:has(>a:nth-child(7):last-child)>a:nth-child(n+5){grid-column:span 4}
}
