@font-face{font-family:'Nunito Sans';src:url('./assets/nunito-sans.ttf') format('truetype');font-style:normal;font-weight:200 1000;font-display:swap}

:root{--nav-height:74px;--player-height:84px;--library-bg:#fffcf5;--library-muted:#776f63;--library-yellow:#ffcc20;--library-green:#209b73}

*{box-sizing:border-box}
html{scroll-padding-block:20px calc(var(--nav-height) + var(--player-height) + 30px + env(safe-area-inset-bottom))}
body{margin:0;background:var(--library-bg);color:var(--pb-text);font:400 16px/1.5 var(--pb-font);padding-bottom:calc(var(--nav-height) + var(--player-height) + 36px + env(safe-area-inset-bottom))}
[hidden]{display:none!important}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
button:disabled{opacity:.45;cursor:default}
button,a,input,select{-webkit-tap-highlight-color:transparent;outline-offset:4px}
:focus-visible{outline:3px solid var(--pb-focus)}
button{border:0}
a{color:inherit}
svg,img{display:block}
p,h1,h2,h3{margin:0}
.shell{width:min(100%,1000px);margin-inline:auto;padding-inline:24px}
.svg-defs,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.icon{width:24px;height:24px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.skip-link{position:fixed;top:-100px;left:16px;z-index:80;background:#fff;padding:16px;border-radius:8px}
.skip-link:focus{top:16px}

.app-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:max(28px,env(safe-area-inset-top));padding-bottom:22px}
.heading-brand{display:flex;align-items:center;gap:10px;min-width:0}
.heading-brand img{width:44px;height:44px;flex-shrink:0}
h1{font-size:34px;font-weight:950;letter-spacing:-1.1px;line-height:1.15}
.header-actions{display:flex;gap:8px}
.icon-button{display:inline-flex;justify-content:center;align-items:center;width:44px;height:44px;padding:10px;flex-shrink:0;background:transparent;border-radius:50%}
.header-actions .icon{width:28px;height:28px;stroke-width:1.7}
.header-actions #create-playlist .icon{width:30px;height:30px}
.icon-button[aria-pressed=true]{color:#685100;background:#fff1b0}
#favorite-current[aria-pressed=true] .icon,#menu-favorite[aria-pressed=true] .icon{fill:currentColor}

.filters{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 1px 3px}
.filters::-webkit-scrollbar{display:none}
.filter{white-space:nowrap;min-height:44px;border:1px solid #e6dfd2;border-radius:999px;padding:8px 24px;background:rgba(255,255,255,.45);font-size:16px;font-weight:650;flex:1}
.filter[aria-pressed=true]{background:#fff4bf;border-color:#e6cb63}
.search-panel{padding:2px 0 16px}
.search-box{display:flex;align-items:center;gap:12px;padding:0 16px;background:white;border:1px solid #e4ddcf;border-radius:16px}
.search-box input{background:transparent;border:0;min-height:48px;min-width:0;width:100%;outline:0}
.search-box:focus-within{outline:2px solid var(--pb-focus);outline-offset:2px}
.search-box .icon{color:var(--library-muted)}
.library-toolbar{display:flex;align-items:center;justify-content:space-between;padding-block:12px 10px}
#sort-dialog{max-width:none}
.sort-option .icon{margin-left:auto;visibility:hidden}
.sort-option[aria-pressed=true]{background:var(--pb-selected-bg);color:var(--pb-selected-fg);font-weight:800}
.sort-option[aria-pressed=true] .icon{visibility:visible}
.library-toolbar>.icon-button .icon{width:21px;height:21px}

.track-list,.playlist-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.track-row{display:flex;align-items:center;min-width:0;padding:8px;background:rgba(255,255,255,.92);border-radius:17px;border:1px solid transparent;gap:4px;transition:background 150ms}
.track-select{display:flex;align-items:center;gap:16px;min-width:0;flex:1;text-align:left;background:transparent;padding:0;border-radius:11px}
.cover{display:block;background-image:url('./assets/library-covers.webp');background-size:300% 200%;background-repeat:no-repeat;background-color:#fff0b0;flex-shrink:0;border-radius:11px;aspect-ratio:1}
.cover-0{background-position:0 0}
.cover-1{background-position:50% 0}
.cover-2{background-position:100% 0}
.cover-3{background-position:0 100%}
.cover-4{background-position:50% 100%}
.cover-5{background-position:100% 100%}
.track-art{width:76px;height:76px;position:relative}
.track-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.track-title{font-size:18px;font-weight:850;letter-spacing:-.4px;line-height:1.23;overflow-wrap:anywhere}
.track-caption{display:flex;align-items:center;gap:6px;color:var(--library-muted);font-size:15px;line-height:1.4}
.track-caption .icon{width:17px;height:17px}
.track-more{color:#8b8172}
.track-more .icon{width:19px;height:19px}
.track-play{display:none;position:absolute;inset:0;border-radius:inherit;align-items:center;justify-content:center;color:#fff;background:#17120f55}
.is-playing .track-play{display:flex}
.track-play .icon{width:25px;height:25px;filter:drop-shadow(0 1px 3px #30220d80)}
.is-playing .track-caption{color:#16815f}
.track-duration{display:none}
.track-row.is-current{border-color:transparent}
.track-list.is-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.is-grid .track-row{display:block;position:relative;padding:12px}
.is-grid .track-select{display:flex;flex-direction:column;gap:12px;align-items:stretch}
.is-grid .track-art{width:100%;height:auto}
.is-grid .track-copy{padding-right:24px;min-height:66px}
.is-grid .track-title{font-size:16px}
.is-grid .track-caption{font-size:13px}
.is-grid .track-more{position:absolute;bottom:15px;right:2px;width:36px}
.state-message,.empty-state{padding:40px 18px;text-align:center;color:var(--library-muted)}
.empty-state>.icon{width:36px;height:36px;margin:0 auto 16px}
.empty-state h3{color:var(--pb-text);font-size:20px}
.empty-state p{max-width:350px;margin:8px auto 20px}
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border-radius:999px;padding:10px 20px;font-weight:800;font-size:14px}
.primary{background:var(--library-yellow);border:1px solid #edba10}
.secondary{background:#fff9e9;border:1px solid #ded6c6}
.danger{background:#fff0eb;color:#943820}
.button .icon{width:19px;height:19px}

.player{position:fixed;bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 5px);left:50%;transform:translateX(-50%);width:min(calc(100% - 20px),960px);z-index:20;border-radius:20px;border:1px solid #eee7d9;background:rgba(255,255,255,.97);box-shadow:0 6px 28px #7463371a;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:10px 12px}
.mini-player{display:flex;align-items:center;gap:16px}
.now-playing{display:flex;align-items:center;gap:14px;background:transparent;padding:0;flex:1;min-width:0;text-align:left;border-radius:10px}
.now-art{width:60px;height:60px;border-radius:10px}
.now-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
#now-title{display:block;font-weight:850;font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.25px}
.now-caption{display:flex;align-items:center;gap:7px;min-width:0;color:#71685d;font-size:13px}
.now-caption .icon{width:17px;height:17px;color:var(--library-green)}
#now-subtitle{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-progress{height:5px;border-radius:10px;background:#e5e5e5;box-shadow:inset 0 0 0 1px #0000000c;margin-top:3px;overflow:hidden}
.mini-progress>span{display:block;height:100%;width:0;background:var(--library-green);border-radius:inherit}
.play-button{display:flex;align-items:center;justify-content:center;width:52px;height:52px;padding:12px;background:var(--library-yellow);border:1px solid #edb90a;border-radius:50%;flex-shrink:0;color:#211a12}
.play-button .icon{width:29px;height:29px}
.audio-error{font-size:13px;line-height:1.4;color:#893921;padding:2px 4px 12px}
.audio-error button{background:transparent;text-decoration:underline;font-weight:800;padding:5px}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:21;background:rgba(255,252,245,.97);border-top:1px solid #eee6d6;padding:6px 12px calc(6px + env(safe-area-inset-bottom));height:calc(var(--nav-height) + env(safe-area-inset-bottom));backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.nav-inner{display:flex;align-items:stretch;justify-content:space-between;gap:8px;max-width:960px;margin:auto;height:100%}
.nav-item{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:2px 8px;background:transparent;border-radius:999px;color:#665b4b;font-size:13px;white-space:nowrap}
.nav-item .icon{width:27px;height:27px}
.nav-item[aria-current=page]{background:#fff5d0;color:#1d1710}
.nav-item[aria-current=page] .icon{filter:drop-shadow(2px 1px 0 #ffd126);stroke-width:2.1}

.sheet{position:fixed;inset:0;width:min(calc(100% - 32px),460px);max-height:calc(100dvh - 40px);margin:auto;padding:24px;border:1px solid #e7dfce;border-radius:24px;color:var(--pb-text);background:var(--library-bg);box-shadow:0 20px 80px #261c1133;overflow:auto;overscroll-behavior:contain}
.sheet::backdrop{background:#28221766;backdrop-filter:blur(3px)}
body:has(dialog[open]){overflow:hidden}
.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.sheet-header>h2{font-size:21px;line-height:1.25;font-weight:850;overflow-wrap:anywhere}
.sheet-header>p{color:var(--library-muted);font-size:14px}
.sheet-header>.icon-button{margin-right:-8px}
.expanded-art{width:min(65vw,280px);margin:4px auto 24px;border-radius:20px}
.expanded-heading{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:18px}
.expanded-heading h2{font-size:23px;line-height:1.2;font-weight:850;letter-spacing:-.5px}
.expanded-heading p{font-size:14px;color:var(--library-muted);margin-top:6px}
.range{--progress:0%;display:block;appearance:none;-webkit-appearance:none;width:100%;height:24px;background:transparent;cursor:pointer;margin:0;accent-color:var(--library-green)}
.range::-webkit-slider-runnable-track{height:5px;border-radius:8px;background:linear-gradient(to right,var(--library-green) var(--progress),#e0ded7 var(--progress))}
.range::-moz-range-track{height:5px;border-radius:8px;background:#e0ded7}
.range::-moz-range-progress{background:var(--library-green);height:5px;border-radius:8px}
.range::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:15px;height:15px;border-radius:50%;background:var(--library-green);margin-top:-5px}
.range::-moz-range-thumb{width:15px;height:15px;border:0;border-radius:50%;background:var(--library-green)}
.time-labels{display:flex;justify-content:space-between;font-size:12px;color:var(--library-muted);font-variant-numeric:tabular-nums}
.playback-controls{display:flex;align-items:center;justify-content:space-between;margin-top:16px;gap:4px}
.playback-controls>.play-button{width:64px;height:64px}
.volume-control{display:flex;align-items:center;gap:8px;margin:16px auto 0;max-width:260px}
.volume-hint{color:var(--library-muted);text-align:center;font-size:11px;max-width:270px;margin:3px auto 0}
.muted{color:var(--library-muted);font-size:14px}
.menu-action{display:flex;align-items:center;gap:12px;text-align:left;width:100%;min-height:52px;background:transparent;padding:12px 8px;border-radius:12px;font-size:15px}
.menu-action:hover{background:#f6efdc}
.menu-action[aria-pressed=true]{color:#8a5d00}
.menu-sheet .sheet-header{margin-bottom:6px}
.menu-sheet .muted{margin:0 0 14px 8px}
.field-label{display:block;font-size:14px;font-weight:800;margin:16px 0 8px}
.text-input{width:100%;border:1px solid #dcd4c4;border-radius:12px;padding:12px;background:#fff;min-height:48px}
.playlist-picker{max-height:38dvh;overflow:auto;border-block:1px solid #ece3d4;padding:8px 0}
.picker-row{display:flex;align-items:center;gap:10px;padding:8px 4px;font-size:14px;cursor:pointer;min-height:56px}
.picker-row input{width:20px;height:20px;flex-shrink:0;accent-color:#dfa600}
.picker-row .cover{width:42px;height:42px;border-radius:7px}
.local-note{font-size:12px;color:var(--library-muted);margin-top:16px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:18px}
.playlist-list{margin-bottom:8px}
.playlist-card{display:flex;align-items:center;gap:14px;border:1px solid #eee4cf;border-radius:17px;padding:10px;background:#fff9e6}
.playlist-card>button{display:flex;align-items:center;gap:14px;flex:1;min-width:0;padding:0;text-align:left;background:transparent}
.playlist-cover{display:flex;align-items:center;justify-content:center;width:76px;height:76px;flex-shrink:0;border-radius:12px;background:#ffedab;color:#766017}
.playlist-cover>.icon{width:34px;height:34px}
.playlist-card strong{display:block;font-size:18px;font-weight:850;overflow-wrap:anywhere}
.playlist-card small{font-size:14px;color:var(--library-muted)}
.playlist-heading{display:flex;align-items:center;gap:8px;padding-top:16px}
.playlist-heading h2{font-size:24px;line-height:1.2;flex:1;overflow-wrap:anywhere}
.home-view{display:flex;justify-content:space-between;align-items:center;gap:24px;background:#fff1bc;border-radius:22px;padding:30px;margin-bottom:24px}
.home-view h2{font-size:36px;font-weight:900;line-height:1.12;letter-spacing:-1px}
.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:850;margin-bottom:12px}
.home-view #collection-meta{color:#746343;margin-top:12px;font-size:14px}
.home-cover{width:170px;transform:rotate(4deg);border-radius:24px}
.collection-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.toast{position:fixed;bottom:calc(var(--nav-height) + var(--player-height) + 22px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);background:#30291e;color:white;border-radius:14px;padding:12px 18px;font-size:14px;z-index:30;box-shadow:0 4px 20px #30291e22;text-align:center}

@media(hover:hover){.track-row:hover{background:#fff9e7}
.track-select:hover .track-play{display:flex}
.icon-button:hover{background:#eee6d75c}
.nav-item:hover{background:#fff3ce}
}

@media(min-width:1000px){.app-header{padding-top:40px;padding-bottom:28px}
.filters{max-width:660px}
.filter{flex:initial;min-width:140px}
.library-toolbar{padding-block:20px 14px}
.track-row{padding:10px 14px}
.track-art{width:80px;height:80px}
.track-copy{gap:6px}
.track-title{font-size:19px}
.track-duration{display:block;min-width:70px;font-size:14px;color:var(--library-muted);text-align:center}
.track-more{margin-inline:12px}
.is-grid .track-duration{display:none}
.player{padding:12px 20px}
.nav-inner{max-width:600px}
}

@media(max-width:600px){:root{--nav-height:64px;--player-height:78px}
.shell{padding-inline:15px}
.app-header{gap:4px;padding-top:max(22px,env(safe-area-inset-top));padding-bottom:18px}
.heading-brand{gap:8px}
.heading-brand img{width:36px;height:36px}
h1{font-size:26px;letter-spacing:-.9px}
.header-actions{gap:0}
.header-actions .icon-button{width:40px;height:44px;padding:7px}
.header-actions .icon{width:25px;height:25px}
.header-actions #create-playlist .icon{width:28px;height:28px}
.filters{gap:6px}
.filter{padding:7px 15px;font-size:15px;min-height:38px}
.library-toolbar{padding-block:10px 10px}
.track-row{padding:6px 6px 6px 7px;border-radius:16px;gap:0}
.track-select{gap:14px}
.track-art{width:74px;height:74px}
.track-title{font-size:16px;font-weight:850;letter-spacing:-.35px}
.track-caption{font-size:13px;gap:6px}
.track-caption .icon{width:15px;height:15px}
.track-more{width:32px;padding:7px;min-height:60px}
.track-more .icon{width:17px;height:19px}
.player{padding:8px 10px;border-radius:18px}
.mini-player{gap:14px}
.now-playing{gap:12px}
.now-art{width:58px;height:58px}
#now-title{font-size:14px}
.now-caption{font-size:12px;gap:6px}
.now-caption .icon{width:15px;height:15px}
.play-button{width:46px;height:46px;padding:10px}
.play-button .icon{width:27px;height:27px}
.mini-progress{height:4px}
.nav-item{font-size:12px;padding-inline:7px}
.nav-item .icon{width:25px;height:25px}
.bottom-nav{padding-top:5px;padding-inline:10px}
.sheet{inset:auto 0 0;width:100%;max-height:calc(100dvh - 18px);margin:0;border-radius:24px 24px 0 0;padding:20px 22px max(24px,env(safe-area-inset-bottom))}
.expanded-art{width:min(60vw,240px);margin-bottom:20px}
.expanded-heading h2{font-size:22px}
.home-view{padding:22px;gap:12px;position:relative;overflow:hidden}
.home-view h2{font-size:30px}
.home-cover{width:110px;position:absolute;right:-30px;top:22px;opacity:.5;pointer-events:none}
.home-view>div{position:relative;z-index:1}
.collection-actions{margin-top:18px}
.home-view .button{font-size:12px;padding:9px 13px}
.track-list.is-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.is-grid .track-row{padding:9px}
.is-grid .track-title{font-size:15px}
.is-grid .track-caption{font-size:12px;gap:3px}
.is-grid .track-caption .icon{display:none}
.is-grid .track-copy{min-height:75px;padding-right:16px}
.is-grid .track-more{width:28px;bottom:10px;right:0}
.playlist-card strong{font-size:16px}
.playlist-card small{font-size:13px}
.playlist-cover{width:74px;height:74px}
}

@media(max-width:360px){.shell{padding-inline:12px}
h1{font-size:22px;letter-spacing:-.7px}
.heading-brand img{width:30px;height:30px}
.heading-brand{gap:6px}
.header-actions .icon-button{width:35px}
.filter{padding-inline:13px;font-size:14px}
.track-art{width:60px;height:60px}
.track-select{gap:10px}
.track-title{font-size:15px}
.track-caption{font-size:12px}
.track-more{width:28px}
.now-art{width:48px;height:48px}
.now-playing{gap:9px}
.mini-player{gap:9px}
#now-title{font-size:13px}
.now-caption{font-size:11px}
.play-button{width:42px;height:42px}
.nav-item{font-size:11px}
.playback-controls .icon-button{width:40px}
.playlist-cover{width:60px;height:60px}
}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Preserve the brand palette and generous touch targets in the compact layout. */
:root{--library-bg:var(--pb-bg);--library-yellow:var(--pb-action)}

.heading-brand img{transform:scale(1.3)}

@media(max-width:600px){.header-actions .icon-button{width:44px}
.track-more{width:44px}
.filter{min-height:40px;padding-inline:13px}
.is-grid .track-more{width:36px;right:1px}
.is-grid .track-copy{padding-right:24px}
}

@media(max-width:360px){.header-actions .icon-button{width:40px}
.track-more{width:36px}
.filter{padding-inline:11px}
.heading-brand img{transform:scale(1.25)}
}
