@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400..700&family=IBM+Plex+Mono:wght@600&display=swap');
:root{
 --bg:#fff; --ink:#172033; --muted:#64708a; --line:#17203314; --soft:#f2f5fb;
 --brand:#2f5bd3; --brand-ink:#1d3f9e; --brand-soft:#e6edfc; --love:#c2416b; --love-soft:#fdebf1; --gold:#a1691d;
 --font:'Inter',system-ui,sans-serif; --mono:'IBM Plex Mono',ui-monospace,monospace;
 --bar:64px;
}
*{box-sizing:border-box}
/* Double-tap zoom off everywhere; pinch zoom stays available. */
html{-webkit-text-size-adjust:100%;touch-action:manipulation}
body{margin:0;background:var(--bg);color:var(--ink);font:400 16px/1.5 var(--font);-webkit-font-smoothing:antialiased;padding-bottom:calc(var(--bar) + env(safe-area-inset-bottom))}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:not-allowed;opacity:.4}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
[hidden]{display:none!important}
.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.wrap{width:min(960px,100% - 32px);margin-inline:auto}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Header: brand and, on wider screens, the primary nav. Phones get the bottom bar instead. */
.top{display:flex;align-items:center;gap:16px;height:56px}
.brand{display:flex;align-items:center;gap:10px;margin-right:auto;color:inherit;font-weight:600;font-size:17px;text-decoration:none}
.brand-mark{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--brand);color:#fff;font-size:17px}
.desk-nav{display:flex;gap:4px}
.nav-item{display:flex;align-items:center;gap:8px;height:36px;padding:0 12px;border:0;border-radius:8px;background:none;color:var(--muted);font-size:14px;font-weight:500}
.nav-item:hover{color:var(--ink)}
.nav-item[aria-current=page]{background:var(--soft);color:var(--ink)}
.pill-count{min-width:20px;padding:0 6px;border-radius:99px;background:var(--brand-soft);color:var(--brand-ink);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;text-align:center;line-height:20px}
.shuffle-desk{display:flex;align-items:center;gap:8px;height:36px;padding:0 14px 0 10px;border:0;border-radius:8px;background:var(--brand);color:#fff;font-size:14px;font-weight:600}
.shuffle-desk:not(:disabled):hover{background:var(--brand-ink)}

.intro{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0 4px}
.intro h1{margin:0;font-size:28px;font-weight:600;letter-spacing:-.02em;text-wrap:balance}
.intro p{margin:2px 0 0;color:var(--muted);font-size:15px}

/* Sticky finder: search plus one scrolling row of filters. */
.finder{position:sticky;top:0;z-index:10;padding:12px 0 0;background:color-mix(in srgb,#fff 92%,transparent);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.search{position:relative;display:flex;align-items:center}
.search .icon{position:absolute;left:14px;color:var(--muted);pointer-events:none}
.search input{width:100%;height:48px;padding:0 44px;border:0;border-radius:12px;background:var(--soft);font-size:16px;outline:none;-webkit-appearance:none}
.search input:focus{background:#fff;box-shadow:0 0 0 2px var(--brand) inset}
.search input::placeholder{color:var(--muted)}
.search input::-webkit-search-cancel-button{display:none}
.clear{position:absolute;right:6px;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:8px;background:none;color:var(--muted)}
.chips{display:flex;gap:8px;margin-inline:-16px;padding:12px 16px;overflow-x:auto;scrollbar-width:none;scroll-padding-inline:16px;mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 24px),transparent)}
.chips::-webkit-scrollbar{display:none}
.chip{display:flex;align-items:center;gap:6px;flex-shrink:0;height:36px;padding:0 14px;border:1px solid var(--line);border-radius:99px;background:#fff;font-size:14px;font-weight:500;white-space:nowrap}
.chip:hover{border-color:#17203333}
.chip[aria-pressed=true]{background:var(--brand-soft);border-color:transparent;color:var(--brand-ink)}
.chip .icon{width:16px;height:16px}
.chip.with-icon{padding-left:10px}
.chip.removable{padding-right:8px}
.chip-sep{flex-shrink:0;width:1px;margin:6px 2px;background:var(--line)}
.chip-count{color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.chip[aria-pressed=true] .chip-count{color:inherit;opacity:.7}

/* Results */
.results-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 4px}
.results-head h2{margin:0;color:var(--muted);font-size:15px;font-weight:500;font-variant-numeric:tabular-nums}
.sort{display:inline-grid;grid-template-columns:1fr 28px;align-items:center}
.sort select{grid-area:1/1/2/3;height:36px;padding:0 28px 0 10px;border:0;border-radius:8px;background:none;color:var(--ink);font-size:14px;font-weight:500;appearance:none}
.sort select:hover{background:var(--soft)}
.sort svg{grid-area:1/2;justify-self:center;pointer-events:none}
.list{margin:0;padding:0;list-style:none}
.row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:4px;border-bottom:1px solid var(--line)}
.row-main{min-width:0;padding:14px 0;border:0;background:none;text-align:left}
.row-title{display:block;overflow:hidden;font-weight:600;font-size:17px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
.row-meta{display:flex;align-items:center;gap:6px;margin-top:2px;overflow:hidden;color:var(--muted);font-size:15px;white-space:nowrap}
.row-meta span{overflow:hidden;text-overflow:ellipsis}
.rating{display:inline-flex;align-items:center;gap:2px;flex-shrink:0;color:var(--muted);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.rating.is-hit{color:var(--gold)}
.rating svg{width:13px;height:13px;fill:currentColor;stroke:none}
.code{padding:6px 10px;border:0;border-radius:8px;background:var(--soft);font:600 16px var(--mono);letter-spacing:.02em}
.code:hover{background:var(--brand-soft)}
.heart{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:10px;background:none;color:#17203366}
.heart:hover,.heart[aria-pressed=true]{color:var(--love)}
.heart[aria-pressed=true] svg{fill:currentColor}
.row.is-saved .row-title::after{content:'';display:inline-block;width:6px;height:6px;margin-left:8px;border-radius:50%;background:var(--love);vertical-align:middle}
.empty{padding:48px 0;color:var(--muted);text-align:center}
.empty h3{margin:0 0 6px;color:var(--ink);font-size:18px;font-weight:600}
.empty button{margin-top:12px}
.btn-soft{height:40px;padding:0 14px;border:0;border-radius:10px;background:var(--soft);font-size:15px;font-weight:500}
.btn-soft:hover{background:var(--brand-soft)}
.sentinel{height:1px}
.list-intro{margin:16px 0 0;color:var(--muted);font-size:15px}

/* Bottom bar (phones) */
.bottom-bar{position:fixed;inset:auto 0 0;z-index:20;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;height:calc(var(--bar) + env(safe-area-inset-bottom));padding:0 12px env(safe-area-inset-bottom);background:#fff;border-top:1px solid var(--line)}
.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:52px;border:0;background:none;color:var(--muted);font-size:12px;font-weight:500}
.tab[aria-current=page]{color:var(--brand-ink)}
.tab-icon{position:relative}
.tab-icon .pill-count{position:absolute;top:-6px;left:14px;min-width:18px;background:var(--love);color:#fff;font-size:11px;line-height:18px}
.shuffle-fab{display:flex;align-items:center;gap:8px;height:48px;padding:0 20px 0 16px;border:0;border-radius:99px;background:var(--brand);color:#fff;font-size:15px;font-weight:600;box-shadow:0 6px 20px #2f5bd340}

/* Song sheet */
dialog{width:min(420px,100%);max-height:90dvh;margin:auto;padding:0;border:0;border-radius:20px;color:var(--ink);box-shadow:0 24px 60px #17203340}
dialog::backdrop{background:#17203380}
body:has(dialog[open]){overflow:hidden}
.sheet{position:relative;padding:28px 24px 24px;text-align:center}
.sheet-kicker{margin:0 0 8px;color:var(--brand);font-size:14px;font-weight:600}
.sheet h2{margin:0;font-size:26px;font-weight:600;letter-spacing:-.02em;text-wrap:balance}
.sheet-artist{margin:4px 0 0;color:var(--muted)}
.sheet-rating{display:flex;flex-direction:column;align-items:center;gap:2px;margin-top:12px}
.sheet-rating small{color:var(--muted);font-size:13px}
.sheet-stars{display:flex;gap:2px}
.sheet-stars svg{width:20px;height:20px;fill:#1720331f;stroke:none}
.sheet-stars .on svg{fill:var(--gold)}
.sheet-code{margin:16px 0 6px;padding:18px;border-radius:14px;background:var(--soft)}
.sheet-code small{display:block;color:var(--muted);font-size:13px}
.sheet-code strong{display:block;font:600 48px/1.1 var(--mono);letter-spacing:.04em}
.sheet-hint{margin:0 0 18px;color:var(--muted);font-size:14px}
.sheet-actions{display:grid;gap:8px}
.sheet-actions button{display:flex;align-items:center;justify-content:center;gap:8px;height:44px;border:0;border-radius:12px;font-size:15px;font-weight:600}
.btn-love{background:var(--love-soft);color:var(--love)}
.btn-love[aria-pressed=true] svg{fill:currentColor}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:not(:disabled):hover{background:var(--brand-ink)}
.close{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:10px;background:none;color:var(--muted)}
.toast{position:fixed;left:50%;bottom:calc(var(--bar) + 16px + env(safe-area-inset-bottom));z-index:30;max-width:calc(100% - 32px);padding:10px 16px;border-radius:12px;background:var(--ink);color:#fff;font-size:15px;opacity:0;pointer-events:none;transform:translate(-50%,8px);transition:opacity .2s,transform .2s}
.toast.visible{opacity:1;transform:translate(-50%,0)}

@media (max-width:719px){
 .desk-nav,.shuffle-desk{display:none}
 .intro h1{font-size:24px}
 .chip{height:40px}
 .code{min-height:44px;padding-inline:12px}
 dialog{width:100%;max-width:none;margin:auto 0 0;padding-bottom:env(safe-area-inset-bottom);border-radius:20px 20px 0 0}
 /* Searching: everything above the results gets out of the way, so the keyboard leaves room for them. */
 body.is-searching .top,body.is-searching .intro,body.is-searching .results-head{display:none}
 body.is-searching .finder{padding-top:8px}
 body.is-searching .chips{padding-block:8px}
 body.is-searching .row-main{padding-block:9px}
 body.is-typing .bottom-bar{display:none}
 body.is-typing{padding-bottom:0}
}
@media (min-width:720px){
 .bottom-bar{display:none}
 body{padding-bottom:48px}
 .intro{margin:24px 0 8px}
 .row-title{font-size:16px}
 .row-meta{font-size:14px}
 .search input{font-size:15px}
 .toast{bottom:24px}
}
