/* JndalaPurple palettes adapted from Midnight and Daylight. Corners are 5px or square. */
:root,html[data-theme="midnight"]{
  color-scheme:dark;
  --bg:#160221;--surface:#1d0628;--surface-high:#270b33;--surface-selected:#32133e;
  --text:#f8edff;--muted:#e2cfe8;--border:#5d3767;--border-strong:#ab89b2;
  --primary:#c77ad0;--on-primary:#160221;--link:#e2b4e7;--header:#100117;
  --success:#8fcf9b;--success-bg:#243d2a;--warning:#e7c774;--warning-bg:#40331c;
  --danger:#ff8a8a;--danger-bg:#4b1b25;--shadow:#09000f66;
}
html[data-theme="daylight"]{
  color-scheme:light;
  --bg:#fff7fc;--surface:#fbf0f8;--surface-high:#f5e9f2;--surface-selected:#eee1eb;
  --text:#2d102f;--muted:#60445f;--border:#d2c0cf;--border-strong:#826b80;
  --primary:#9e47a9;--on-primary:#fff;--link:#7b2b86;--header:#f5e9f2;
  --success:#376f45;--success-bg:#d5eed9;--warning:#70570c;--warning-bg:#faedc3;
  --danger:#a01616;--danger-bg:#ffdad6;--shadow:#2d102f12;
}
*{box-sizing:border-box}
html{font-family:system-ui,sans-serif;background:var(--bg);color:var(--text)}
body{margin:0;min-width:280px}button,input,select,textarea{font:inherit}
a{color:var(--link)}a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--warning);outline-offset:2px}
.site-header{background:var(--header);border-bottom:1px solid var(--border)}
.header-inner{max-width:1152px;margin:auto;padding:.8rem 1rem;display:flex;align-items:center;gap:.8rem 1.2rem;flex-wrap:wrap}
.brand{font-size:1.2rem;white-space:nowrap}
.site-header nav{display:flex;align-items:center;gap:.2rem;flex:1;flex-wrap:wrap}
.site-header nav a{color:var(--muted);text-decoration:none;padding:.4rem .55rem;border-radius:5px;white-space:nowrap}
.site-header nav a:hover,.site-header nav a[aria-current="page"]{background:var(--surface-selected);color:var(--text)}
.site-header nav a[aria-current="page"]{box-shadow:inset 0 -2px var(--primary)}
.theme-toggle{white-space:nowrap;background:var(--surface-high);color:var(--text);border:1px solid var(--border-strong)}
main{max-width:1120px;margin:2rem auto;padding:0 1rem 3rem}
h1,h2,h3{line-height:1.2;overflow-wrap:anywhere}h1{margin-top:0}
.card{background:var(--surface);border:1px solid var(--border);border-radius:5px;padding:1.2rem;margin:1rem 0;box-shadow:0 2px 7px var(--shadow);min-width:0}
.card .card{background:var(--surface-high)}
.warn{border-left:5px solid var(--warning)}.ok{border-left:5px solid var(--success)}.muted{color:var(--muted)}
.pill{display:inline-block;background:var(--surface-selected);border-radius:5px;padding:.25rem .65rem;margin:.1rem .2rem .1rem 0}
.pill.warn{background:var(--warning-bg);color:var(--warning);border:0}.pill.ok{background:var(--success-bg);color:var(--success);border:0}
button,.button{display:inline-block;background:var(--primary);color:var(--on-primary);border:1px solid transparent;border-radius:5px;padding:.55rem .85rem;cursor:pointer;text-decoration:none}
button:hover,.button:hover{filter:brightness(1.12)}button:disabled{opacity:.55;cursor:not-allowed;filter:none}
button.danger{background:var(--danger-bg);color:var(--danger);border-color:var(--danger)}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea{max-width:100%;background:var(--surface-high);color:var(--text);border:1px solid var(--border-strong);border-radius:5px;padding:.55rem}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.8}
label{overflow-wrap:anywhere}form.inline{display:inline-block;margin:.3rem .3rem .3rem 0}details{margin:.7rem 0}summary{cursor:pointer;font-weight:600}
details summary:hover{color:var(--link)}details[open]>summary{margin-bottom:.4rem}
table{width:100%;border-collapse:collapse;display:block;overflow-x:auto}th,td{text-align:left;vertical-align:top;border-bottom:1px solid var(--border);padding:.45rem}
th{background:var(--surface-high)}tr:hover td{background:var(--surface-selected)}
code,pre{overflow-wrap:anywhere}pre{white-space:pre-wrap;max-width:100%;overflow-x:auto}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:.8rem}
.album-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1.25rem}.album-head-main{min-width:0;flex:1}
.album-title-row{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:.4rem 1rem}
.album-title-row h2{margin-bottom:.35rem}.quality-code{white-space:nowrap;color:var(--muted);background:var(--surface-high);border:1px solid var(--border);border-radius:5px;padding:.2rem .45rem;font-size:.88rem}
.track-player audio{display:block;width:min(100%,480px);margin:.6rem 0}.lyric-decision{margin:.6rem 0}.lyric-decision button{margin-right:.5rem}
.current-cover{width:190px;flex:0 0 190px;margin:0;text-align:center;color:var(--muted);font-size:.82rem}
.current-cover img{display:block;width:190px;height:190px;object-fit:contain;background:var(--surface-high);border:1px solid var(--border);border-radius:5px}
.current-cover .empty-cover{display:grid;place-items:center;width:190px;height:190px;background:var(--surface-high);border:1px dashed var(--border-strong);border-radius:5px}
.current-cover figcaption{margin-top:.35rem;overflow-wrap:anywhere}
.lookup-actions{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.6rem;margin:.9rem 0 1.1rem}
.lookup-actions form{margin:0}.lookup-actions .muted{font-size:.88rem}
.review-checklist{background:var(--surface-high);border:1px solid var(--border);border-radius:5px;padding:.75rem 1rem;margin:1rem 0}
.review-checklist ul{list-style:none;margin:.4rem 0 0;padding:0}.review-checklist li{padding:.2rem 0}.check-done{color:var(--success)}.check-pending{color:var(--warning)}
.art-candidate{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:1rem;align-items:start;min-height:210px;clear:both}
.art-candidate.selected{border-color:var(--success);background:var(--surface-selected)}
.art-candidate-info{min-width:0}.art-candidate-info form{margin-top:.8rem}
.art-candidate-preview{display:grid;place-items:center;width:180px;height:180px;background:var(--surface-high);border:1px solid var(--border);border-radius:5px;overflow:hidden;color:var(--muted);text-align:center;font-size:.85rem}
.art-candidate-preview img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.folder{display:flex;justify-content:space-between;align-items:center;gap:.6rem;border-bottom:1px solid var(--border);padding:.45rem 0}
.candidate-choice{display:inline-flex;align-items:flex-start;gap:.6rem;cursor:pointer}.candidate-choice input{width:1.2rem;height:1.2rem;accent-color:var(--primary);flex:none;margin-top:.2rem}
.download-bar{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;border-color:var(--primary);background:var(--surface-high)}.download-bar button{margin-left:auto}
section[id],div[id^="lyrics-"],div[id^="artwork-"]{scroll-margin-top:1rem}
@media(max-width:650px){main{margin:1rem auto}.card{padding:.9rem}.album-head{display:block}.current-cover{margin:.5rem 0 1rem;width:150px}.current-cover img,.current-cover .empty-cover{width:150px;height:150px}.art-candidate{grid-template-columns:minmax(0,1fr) 110px;min-height:0}.art-candidate-preview{width:110px;height:110px}.folder{align-items:flex-start;flex-wrap:wrap}}
