@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600&family=DM+Sans:wght@400;450;500;550;600;650;700&family=Fraunces:ital,wght@0,400;0,450;0,500;0,600;1,400;1,500&display=swap');

/* Maple Lattes: load after styles.css. */
:root {
  --bg:#f8f3e9; --paper:#fffcf6; --ink:#3d2c23; --muted:#766658;
  --line:#ded2bf; --accent:#884a2e; --accent-light:#f0e0cf;
  --sage:#65725b; --sage-light:#e8ecdf; --serif:'Fraunces',Georgia,serif;
  --sans:'DM Sans',system-ui,sans-serif; --hand:'Caveat',cursive; --radius:13px;
  color:var(--ink); background:var(--bg); font-family:var(--sans);
}
body {
  background:radial-gradient(ellipse at 8% 8%,#fffaf280,transparent 52%),var(--bg);
  -webkit-font-smoothing:antialiased;
}
::selection { background:#e8c9a6; color:var(--ink); }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid var(--sage); outline-offset:4px;
}
.album-choice:has(input:focus-visible) { outline:3px solid var(--sage); outline-offset:3px; }
h1,h2,h3 { font-family:var(--serif); font-weight:400; }
h1 { font-size:clamp(2.6rem,4.8vw,4.25rem); line-height:1.08; letter-spacing:-.045em; }
h2 { font-size:1.8rem; line-height:1.18; letter-spacing:-.035em; }
h3 { font-size:1.3rem; letter-spacing:-.02em; }
p { line-height:1.65; }
button:disabled { opacity:.45; }
.site-header {
  min-height:100px; gap:34px; padding:21px max(4vw,calc((100vw - 1230px)/2));
  background:#fffcf6cc; border-bottom:1px solid var(--line);
}
.brand { gap:12px; font:500 1.95rem/.95 var(--serif); letter-spacing:-.065em; color:var(--ink); }
.brand-mark { width:50px; height:53px; padding:0; border-radius:0; background:transparent; letter-spacing:0; flex:none; }
.brand-mark img { display:block; width:100%; height:100%; object-fit:contain; }
.brand-caption { margin-top:10px; font:550 .6rem/1.2 var(--sans); letter-spacing:.15em; color:var(--muted); }
.site-header nav { align-self:center; gap:9px; }
.nav-link { min-height:44px; padding:11px 16px; font-size:.86rem; border-radius:7px; }
.nav-link:hover { background:#eee4d773; color:var(--ink); }
.nav-link.active { color:var(--accent); background:#eddfcd; font-weight:650; }
.nav-link.active:after { display:none; }
.local-label { border:0; padding:0 0 0 8px; font-size:.7rem; color:var(--sage); }
.account-bar {
  padding:5px max(4vw,calc((100vw - 1230px)/2)); gap:14px; min-height:45px;
  background:#eee6d7; border-bottom:1px solid #ded2bf99; font-size:.76rem;
}
.account-bar .text-button { color:var(--accent); font-size:.78rem; min-height:36px; }
main { max-width:1310px; padding:48px 40px 70px; min-width:0; }
.page-heading { gap:28px; margin-bottom:32px; }
.page-heading>div { min-width:0; }
.eyebrow { font-size:.68rem; font-weight:650; letter-spacing:.15em; line-height:1.5; margin-bottom:13px; color:var(--accent); }
.intro { max-width:650px; color:var(--muted); font-size:1rem; line-height:1.7; }
.edition { color:var(--sage); }
.setup-hero {
  display:grid; grid-template-columns:minmax(0,1fr) 235px; gap:65px; align-items:center;
  padding:13px 15px 49px 0; margin:0 0 20px;
}
.setup-hero h1 { max-width:740px; margin-bottom:22px; }
.setup-hero h1 em { color:var(--accent); font-weight:400; }
.setup-hero .intro { max-width:560px; }
.hero-links { display:flex; flex-wrap:wrap; gap:10px 24px; align-items:center; margin-top:21px; }
.hero-links .text-button { color:var(--accent); font-size:.84rem; min-height:40px; }
.hero-note { position:relative; text-align:center; transform:rotate(5deg); padding:8px 14px; }
.hero-note img { display:block; width:155px; max-width:90%; height:155px; object-fit:contain; margin:0 auto 5px; }
.hero-note p { font:500 1.75rem/1.12 var(--hand); color:var(--accent); margin:0; }
.hero-number13 { position:absolute; top:0; right:4px; font:400 1.4rem var(--hand); color:var(--sage); transform:rotate(-12deg); }
.panel { border:1px solid var(--line); background:var(--paper); border-radius:var(--radius); box-shadow:0 2px 3px #49301903; }
.setup-layout { grid-template-columns:minmax(0,1.95fr) minmax(270px,1fr); align-items:start; gap:34px; }
.setup-panel { padding:30px; overflow:visible; }
.section-heading { align-items:center; margin-bottom:25px; gap:16px; }
.section-heading h2 { font-size:1.75rem; }
.section-heading>.text-button { color:var(--accent); font-size:.8rem; line-height:1.45; min-height:44px; }
.notes-panel {
  position:relative; padding:40px 29px 29px; margin-top:13px; background:#eee4cf;
  border:1px solid #d9ccaf; border-radius:3px 5px 10px 4px; transform:rotate(.8deg);
  box-shadow:3px 7px 14px #6c533b0b; color:var(--ink);
}
.notes-panel:before {
  content:''; position:absolute; width:93px; height:27px; top:-13px; left:calc(50% - 46px);
  transform:rotate(-5deg); background:#c9c7a990; border-left:1px solid #bbb89d66;
  border-right:1px solid #bbb89d66; pointer-events:none;
}
.notes-panel h2 { font:400 2.1rem/1.13 var(--serif); letter-spacing:-.04em; }
.notes-panel p,.notes-panel p:not(.eyebrow) { color:#655644; font-size:.88rem; }
.notes-panel .eyebrow { color:var(--sage); font-size:.65rem; }
.notes-panel .rule { background:#d3c5aa; margin:23px 0; }
.notes-panel>.text-button { color:var(--accent); font-size:.8rem; }
.notes-panel .tiny { font-size:.73rem; }
.outcomes { margin:24px 0; }
.outcomes>div { gap:19px; border-bottom:1px solid #d4c6ae; padding:15px 0; }
.outcomes>div>span { font:400 3.2rem/1 var(--serif); color:var(--accent); width:63px; flex:none; letter-spacing:-.05em; }
.outcomes p { font-size:.86rem!important; }
.button { border-radius:8px; min-height:48px; padding:13px 19px; font-size:.9rem; font-weight:600; }
.primary,.accent { background:var(--accent); color:#fffcf6; border:1px solid var(--accent); }
.primary:hover:not(:disabled),.accent:hover:not(:disabled) { background:#703d26; border-color:#703d26; }
.secondary { background:var(--paper); border:1px solid #d3c3ad; color:var(--ink); }
.secondary:hover:not(:disabled) { background:#f1e7d8; }
.text-button { text-decoration-thickness:1px; text-underline-offset:4px; }
.icon-button:hover:not(:disabled) { background:#eee3d3; }
.album-grid { gap:11px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.album-choice { background:#fffdf8; padding:12px; gap:11px; border-radius:9px; border-color:#e1d6c5; min-height:81px; }
.album-choice:hover { background:#f7f0e3; }
.album-choice.selected { background:#f5eddf; border-color:#caba9f; }
.album-swatch { width:44px; height:44px; border-radius:5px; box-shadow:0 2px 4px #3d2c2312; }
.album-title { font-size:.86rem; line-height:1.35; font-weight:550; overflow-wrap:anywhere; }
.album-copy { gap:5px; }
.album-meta { font-size:.7rem; color:var(--muted); line-height:1.4; }
.checkbox-visual { width:20px; height:20px; border-radius:50%; border-color:#cabcaa; background:#fffdf8; color:var(--sage); }
.selected .checkbox-visual { border-color:var(--sage); background:var(--sage); color:#fffdf8; }
.checkbox-visual svg { width:14px; height:14px; }
.setup-bottom { position:sticky; bottom:0; z-index:5; background:var(--paper); margin-top:23px; padding:19px 0 6px; border-color:var(--line); }
.setup-bottom strong { font-size:.95rem; font-weight:600; }
.setup-bottom .small { font-size:.76rem; line-height:1.45; max-width:250px; }
.setup-recovery { margin-top:15px; }
.catalog-footnote { margin-top:12px; font-size:.73rem; }
.song-picker { padding-top:23px; margin-top:24px; }
.song-picker summary { min-height:44px; font-weight:550; }
.song-picker summary>span { font-weight:400; }
input[type=search],input[type=text],input[type=month],.field-label input,select,textarea {
  font-size:16px; border:1px solid #cdbfae; border-radius:8px; background:#fffef9; color:var(--ink); min-height:48px;
}
input::placeholder { color:#8b7c6a; opacity:1; }
#song-picker-list { max-height:370px; overscroll-behavior:contain; scrollbar-color:#c7b69c transparent; }
.picker-song { min-height:60px; border-color:#e9dfd0; padding:12px 5px; }
.picker-song span { font-size:.88rem; line-height:1.4; overflow-wrap:anywhere; }
.picker-song small { font-size:.76rem; }
.picker-song input { width:20px; height:20px; accent-color:var(--sage); }
.demo-banner { background:var(--sage-light); border-color:#cad2bd; color:#465440; padding:13px 18px; }
.demo-banner .text-button { min-height:40px; }
.ranking-layout { grid-template-columns:minmax(0,1fr) 270px; gap:30px; align-items:start; }
.ranking-workspace,.ranking-aside,.results-layout>*,.card-layout>* { min-width:0; }
.order-label { color:var(--muted); font-size:.68rem; letter-spacing:.08em; line-height:1.45; margin-bottom:13px; }
.order-label.bottom { margin-top:14px; }
.order-label.bottom>span:last-child { font-size:.73rem; }
.rank-list { gap:10px; }
.rank-list .song-row { padding:13px 11px; gap:11px; min-height:89px; background:var(--paper); border-radius:10px; border-color:var(--line); border-left:3px solid var(--era); }
.song-row:hover { background:#fffdf9; border-color:#c6b69f; border-left-color:var(--era); }
.song-row.drop-target { background:#f4e7d3; border-top:3px solid var(--accent); }
.song-row.dragging { opacity:.45; }
.drag-handle { color:#b8a68f; }
.song-row .rank-number { min-width:25px; font:400 1.55rem/1 var(--serif); color:#9a795b; letter-spacing:-.04em; }
.song-art { width:42px; height:42px; border-radius:5px; }
.song-text { gap:5px; min-width:0; }
.song-text strong,.song-row .song-text strong { font-size:.94rem; line-height:1.4; font-weight:550; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.song-text>span,.song-row .song-text>span { font-size:.74rem; line-height:1.45; color:var(--muted); }
.song-text small { font-size:.72rem; color:#82644b; }
.version-tag { color:var(--accent); border-color:#d8c7b0; font-size:.6rem!important; }
.song-controls { gap:5px; margin-left:0; }
.preview-button,.song-controls .preview-button,.least-panel .preview-button { width:40px; height:40px; border-color:#d7c6af; background:#fffcf6; color:var(--accent); }
.preview-button.playing,.song-controls .preview-button.playing { background:var(--accent); color:#fffcf6; border-color:var(--accent); }
.move-buttons { flex-direction:column; gap:0; }
.move-buttons .icon-button { width:32px; height:32px; border-radius:5px; color:#765c46; }
.unknown-button { padding:11px 8px; min-height:40px; font-size:.74rem; background:#efe7da; color:#6b5846; border-radius:6px; }
.unknown-button:hover { background:#e5d9c7; }
.song-link { color:var(--accent); min-width:26px; padding:8px 3px; }
.round-actions { gap:10px; margin-top:24px; }
.round-actions .button { min-height:48px; font-size:.84rem; padding:12px 14px; }
.saved-label { font-size:.72rem; color:var(--sage); }
.progress-panel { padding:25px 23px; }
.progress-panel h2 { color:var(--accent); font:400 2.9rem/1.1 var(--serif); }
.progress-panel h2 span { color:#aa957d; font:400 1.15rem var(--sans); }
.progress-panel .eyebrow { font-size:.66rem; }
.progress-track { background:#e9dfcd; height:5px; }
.progress-track span { background:var(--sage); }
.phase-steps>div { color:#8d7b65; }
.phase-steps>div>span { border-color:#d9cdb9; }
.phase-steps .current { color:var(--ink); }
.phase-steps .current>span { color:var(--accent); border-color:#cdb593; background:#eee0ca; }
.phase-steps .done>span { color:var(--sage); background:var(--sage-light); border-color:#cbd2bd; }
.phase-steps small,.resolved-counts>span { color:var(--muted); font-size:.73rem; }
.resolved-counts strong { font-size:.9rem; }
.listening-note { padding:26px 7px 13px; }
.listening-note h3 { font:400 1.35rem/1.25 var(--serif); }
.listening-note p { font-size:.81rem; }
.attribution { font-size:.72rem; color:var(--muted); }
.ranking-aside>.text-button { color:var(--muted); font-size:.78rem; }
.unfamiliar-tray { background:#eaece1; border:1px solid #d3d8c5; padding:15px; border-radius:9px; }
.unfamiliar-tray>span { color:#5f6a52; font-size:.78rem; }
.unfamiliar-tray button { min-height:44px; background:#fffdf6; border-color:#cdd2bf; color:#58634c; line-height:1.4; text-align:left; }
.provisional-banner { background:#f0e4d0; border-color:#dcc7a8; padding:20px 24px; gap:24px; }
.provisional-banner strong { font-weight:600; font-size:.93rem; }
.provisional-banner span { display:block; line-height:1.55; font-size:.83rem; }
.results-toolbar { margin:27px 0; gap:12px; }
.results-layout { grid-template-columns:minmax(0,1.65fr) minmax(285px,1fr); gap:29px; align-items:start; }
.results-panel { padding:29px 27px 9px; }
.results-panel .section-heading { gap:12px; }
.result-row { min-height:80px; padding:16px 0; gap:14px; border-color:#e2d7c6; }
.result-rank { width:34px; font:400 1.7rem/1 var(--serif); color:#a78c6e; letter-spacing:-.04em; }
.result-row:nth-child(-n+3) .result-rank { color:var(--accent); }
.result-row:nth-child(-n+3) .song-text strong { font-size:1rem; }
.result-row .song-text>span:before { opacity:.9; }
.count-badge { color:var(--sage); background:#f2f3e9; border-color:#d4d9c6; font-size:.6rem; letter-spacing:.08em; border-radius:4px; padding:7px 8px; flex:none; }
.least-panel { background:#eeeee3; border-color:#d7d8c9; }
.least-panel .result-rank { color:#7b8167!important; font-family:var(--serif); font-size:1.35rem; }
.least-panel .song-text strong { font-size:.87rem!important; }
.least-panel .result-row { border-color:#daddce; }
.result-date { color:var(--muted); font-size:.77rem; }
.result-notes { padding:23px 5px; line-height:1.55; }
.unknown-results { background:#f6f1e6; padding:25px; border-color:#ded2bf; }
.unknown-results summary { min-height:44px; padding-top:5px; }
.empty-panel { min-height:290px; padding:44px; background:var(--paper); }
.empty-monogram { color:#ae845e; }
.empty-monogram img { width:85px; height:85px; object-fit:contain; }
.card-layout { grid-template-columns:minmax(0,1.5fr) minmax(285px,1fr); gap:36px; }
.card-preview-wrap { padding:34px; background:#e5d8c3; border:1px solid #d9c6a8; border-radius:12px; }
.card-preview-wrap canvas { box-shadow:0 9px 28px #6a4b3221; }
.card-preview-wrap canvas[height="1920"] { width:auto; max-width:100%; max-height:690px; }
.card-preview-wrap p { color:#776048; }
.card-controls { padding:30px; }
.card-controls h2 { font:400 1.9rem/1.15 var(--serif); }
.field-label { font-weight:550; font-size:.86rem; }
.card-controls legend { font-size:.85rem; }
.theme-options { gap:12px; }
.theme-swatch { height:70px; border-radius:6px; outline-color:#d1bea4; box-shadow:inset 0 0 0 3px var(--paper); }
.theme-option.selected .theme-swatch { outline-color:var(--accent); }
.theme-option>span:last-child { font-size:.74rem; }
.segmented { background:#eee5d6; border-color:#d4c3aa; padding:4px; gap:5px; }
.segmented button { min-height:44px; font-size:.86rem; }
.segmented .selected { background:var(--paper); color:var(--accent); box-shadow:0 1px 3px #69472814; }
.notice { background:#f4e8d3; border-color:#dfc7a3; color:#735737; }
.card-controls>.tiny { font-size:.75rem; line-height:1.6; }
dialog { background:var(--paper); border:1px solid #d8c7ac; padding:38px; border-radius:16px; box-shadow:0 24px 100px #3d2c2338; max-height:calc(100dvh - 32px); overflow:auto; }
dialog::backdrop { background:#36261d66; backdrop-filter:blur(4px); }
dialog h2 { font-size:2.1rem; line-height:1.15; }
dialog p,dialog li { color:var(--muted); }
.dialog-close { width:44px; height:44px; right:9px; top:9px; color:var(--muted); }
.dialog-actions { gap:11px; }
#toast { background:var(--ink); border:1px solid #5f4733; color:var(--paper); border-radius:9px; box-shadow:0 8px 25px #3d2c2326; line-height:1.5; }
footer { max-width:none; padding:25px max(4vw,calc((100vw - 1230px)/2)); background:#f2eadc; border-color:var(--line); line-height:1.5; }
footer>span:first-child { font-size:.77rem; }
footer .text-button { min-height:44px; font-size:.78rem; }
.footer-dot { color:#a87850; }
.skip-link { background:var(--paper); color:var(--ink); border:1px solid var(--accent); }

/* Direct position selection is a full-width list, with room for context. */
.rank-position-button { display:grid; place-items:center; width:38px; min-height:44px; padding:4px; border:1px solid #dfcfb6; border-radius:7px; background:#f5ecde; color:var(--accent); font:400 1.45rem/1 var(--serif); flex:none; }
.rank-position-button:hover { background:#eddfc9; border-color:#bca17d; }
.position-options { display:grid; grid-template-columns:1fr; gap:8px; margin-top:23px; }
.position-option { display:grid; grid-template-columns:35px minmax(0,1fr); align-items:center; gap:13px; width:100%; min-height:60px; border:1px solid var(--line); border-radius:8px; padding:11px 15px; background:#fffef9; color:var(--ink); text-align:left; }
.position-option:hover { background:#f2e7d6; border-color:#c5ae8c; }
.position-option.current { background:var(--sage-light); border-color:#a7b292; }
.position-option-number { font:400 1.55rem/1 var(--serif); color:var(--accent); }
.position-option-context { min-width:0; font-size:.85rem; line-height:1.45; overflow-wrap:anywhere; white-space:normal; }
.position-option.current .position-option-number { color:var(--sage); }

@media (max-width:1100px) {
  main { padding:39px 4vw 60px; }
  .site-header { padding:20px 4vw; gap:20px; }
  .local-label { display:none; }
  .setup-hero { gap:32px; grid-template-columns:minmax(0,1fr) 195px; padding-bottom:38px; }
  .hero-note img { width:140px; height:140px; }
  .setup-layout { grid-template-columns:minmax(0,1.7fr) minmax(245px,1fr); gap:25px; }
  .setup-panel { padding:24px; }
  .notes-panel { padding:36px 24px 25px; }
  .notes-panel h2 { font-size:1.85rem; }
  .album-choice { gap:9px; padding:11px 9px; }
  .album-swatch { width:38px; height:38px; }
  .ranking-layout { grid-template-columns:minmax(0,1fr) 235px; gap:22px; }
  .rank-list .song-row { gap:8px; padding:12px 8px; }
  .song-row .song-link { display:none; }
  .song-controls { gap:4px; }
  .song-controls .preview-button { width:36px; height:36px; }
  .unknown-button { font-size:.7rem; padding:10px 6px; }
  .progress-panel { padding:23px 19px; }
  .results-layout { gap:22px; }
  .results-panel { padding:25px 21px 8px; }
  .card-layout { gap:25px; }
  .card-preview-wrap,.card-controls { padding:25px; }
}
@media (max-width:900px) {
  .setup-layout,.ranking-layout { grid-template-columns:minmax(0,1fr); }
  .notes-panel { display:block; transform:none; margin-top:12px; padding:29px; }
  .notes-panel h2 { font-size:2rem; }
  .notes-panel h2 br { display:none; }
  .notes-panel .outcomes { display:flex; gap:30px; margin:17px 0; }
  .outcomes>div { flex:1; gap:15px; }
  .notes-panel .wide { width:auto; }
  .notes-panel>.text-button { display:inline-block; width:auto; margin:0 0 0 18px; }
  .notes-panel .tiny { display:block; }
  .ranking-aside { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
  .rank-list .song-row { padding:13px; gap:13px; }
  .song-controls { gap:8px; }
  .song-controls .preview-button { width:44px; height:44px; }
  .unknown-button { min-height:44px; font-size:.77rem; padding:11px 10px; }
  .song-row .song-link { display:inline-flex; }
  .results-layout { grid-template-columns:minmax(0,1.3fr) minmax(255px,1fr); }
  .card-layout { grid-template-columns:minmax(0,1.1fr) minmax(255px,1fr); gap:20px; }
}
@media (max-width:680px) {
  .site-header { display:grid; grid-template-columns:minmax(0,1fr); gap:13px; min-height:0; padding:16px 20px 11px; }
  .brand { width:max-content; max-width:100%; gap:10px; font-size:1.8rem; }
  .brand-mark { width:42px; height:43px; }
  .brand-caption { font-size:.56rem; margin-top:8px; letter-spacing:.14em; }
  .site-header nav { order:initial; width:100%; height:auto; display:grid; grid-template-columns:1fr 1fr 1fr; gap:5px; margin:0; }
  .nav-link { min-height:42px; padding:10px 7px; border-radius:7px; font-size:.8rem; }
  .account-bar { min-height:44px; padding:4px 20px; justify-content:space-between; gap:12px; }
  .account-bar>span { max-width:165px; font-size:.7rem; line-height:1.4; }
  .account-bar .text-button { min-height:36px; flex:none; font-size:.73rem; }
  main { padding:30px 20px 44px; }
  h1 { font-size:clamp(2.2rem,8vw,3rem); letter-spacing:-.04em; }
  h2 { font-size:1.7rem; }
  .page-heading { display:block; margin-bottom:26px; }
  .intro { font-size:.92rem; line-height:1.65; }
  .intro br { display:none; }
  .eyebrow { font-size:.64rem; letter-spacing:.13em; margin-bottom:11px; }
  .setup-hero { grid-template-columns:minmax(0,1fr); padding:0 0 23px; gap:20px; margin-bottom:12px; }
  .setup-hero h1 { max-width:480px; margin-bottom:17px; }
  .hero-links { gap:6px 21px; margin-top:14px; }
  .hero-links .text-button { font-size:.8rem; }
  .hero-note { display:flex; align-items:center; gap:14px; justify-content:flex-start; padding:0 4px; transform:rotate(-2deg); }
  .hero-note img { width:68px; height:68px; margin:0; max-width:none; flex:none; }
  .hero-note p { font-size:1.55rem; line-height:1.1; max-width:210px; text-align:left; }
  .hero-number13 { top:3px; right:15px; font-size:1.1rem; }
  .setup-layout { gap:27px; }
  .setup-panel { padding:20px; border-radius:12px; }
  .section-heading { gap:12px; align-items:center; margin-bottom:20px; }
  .section-heading h2 { font-size:1.65rem; }
  .section-heading>.text-button { font-size:.75rem; max-width:95px; flex:none; }
  .album-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .album-choice { display:grid; grid-template-columns:42px minmax(0,1fr); align-items:start; padding:13px; gap:10px; min-height:132px; }
  .album-swatch { width:42px; height:42px; grid-column:1; }
  .album-copy { grid-column:1/-1; gap:4px; }
  .album-title { font-size:.86rem; line-height:1.32; overflow-wrap:anywhere; }
  .album-meta { font-size:.71rem; }
  .checkbox-visual { position:absolute; top:15px; right:13px; width:19px; height:19px; }
  .setup-bottom { flex-direction:row; align-items:center; gap:11px; padding:15px 0 calc(8px + env(safe-area-inset-bottom)); margin-top:21px; }
  .setup-bottom>div { min-width:0; gap:4px; }
  .setup-bottom strong { font-size:.87rem; }
  .setup-bottom .small { max-width:150px; font-size:.71rem; line-height:1.4; }
  .setup-bottom .button { padding:12px 14px; font-size:.84rem; white-space:nowrap; flex:none; }
  .song-picker { margin-top:20px; padding-top:19px; }
  .song-picker summary { font-size:.82rem; }
  summary>span { font-size:.7rem; }
  .notes-panel { padding:30px 23px 24px; }
  .notes-panel h2 { font-size:1.9rem; }
  .notes-panel .outcomes { gap:18px; }
  .outcomes>div { flex-direction:column; gap:9px; align-items:flex-start; }
  .outcomes>div>span { width:auto; font-size:2.9rem; }
  .outcomes p { font-size:.8rem!important; }
  .notes-panel .wide { width:100%; }
  .notes-panel>.text-button { display:block; width:100%; margin:11px 0 0; }
  .notes-panel .tiny { text-align:center; }
  .ranking-layout { gap:25px; }
  .rank-list { gap:11px; }
  .rank-list .song-row {
    display:grid; grid-template-columns:38px 42px minmax(0,1fr); grid-template-rows:auto auto;
    align-items:center; gap:12px 10px; min-height:0; padding:14px 12px 12px; border-radius:10px;
  }
  .song-row .drag-handle,.song-row .song-link,.song-controls .song-link { display:none; }
  .song-row .rank-number,.song-row .rank-position-button { grid-column:1; grid-row:1; min-width:0; width:38px; text-align:center; font-size:1.5rem; }
  .song-row .song-art { display:grid; grid-column:2; grid-row:1; width:42px; height:42px; }
  .song-row .song-text { grid-column:3; grid-row:1; min-width:0; }
  .song-row .song-text strong { font-size:.94rem; line-height:1.4; max-height:none; white-space:normal; overflow:visible; overflow-wrap:anywhere; }
  .song-row .song-text>span { font-size:.73rem; line-height:1.4; }
  .song-row .song-controls { grid-column:1/-1; grid-row:2; display:flex; align-items:center; gap:10px; margin:0; border-top:1px solid #e9ddcb; padding-top:10px; min-width:0; }
  .song-controls .preview-button { width:44px; height:44px; min-width:44px; border-radius:50%; }
  .song-controls .move-buttons { display:flex; flex-direction:row; gap:7px; }
  .song-controls .move-buttons .icon-button { width:44px; height:44px; min-width:44px; border:1px solid #dfd1bb; border-radius:7px; background:#faf4e9; }
  .song-controls .unknown-button { min-height:44px; padding:10px 13px; margin-left:auto; font-size:.78rem; white-space:nowrap; }
  .order-label { font-size:.64rem; letter-spacing:.07em; }
  .order-label.bottom>span:last-child { display:none; }
  .round-actions {
    position:sticky; bottom:0; z-index:10; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
    gap:8px 11px; margin:20px -20px 0; padding:12px 20px calc(10px + env(safe-area-inset-bottom));
    border-top:1px solid var(--line); background:#f8f3e9f7; box-shadow:0 -6px 20px #72553908;
    backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  }
  .round-actions .button { min-height:48px; padding:12px 9px; font-size:.82rem; }
  .round-actions>.button:first-child { grid-column:1; grid-row:1; }
  .round-actions>.button:last-child { grid-column:2; grid-row:1; }
  .round-actions .saved-label { grid-column:1/-1; grid-row:2; width:auto; order:initial; margin:0; font-size:.69rem; line-height:1.3; }
  .ranking-aside { display:grid; grid-template-columns:1fr; gap:18px; }
  .ranking-aside .progress-panel { grid-row:auto; }
  .progress-panel { padding:23px; }
  .progress-panel h2 { margin-top:13px; font-size:2.5rem; }
  .phase-steps { flex-direction:row; gap:23px; }
  .phase-steps>div { flex:1; font-size:.79rem; }
  .phase-steps small { font-size:.72rem; }
  .listening-note { padding:2px 6px 0; }
  .ranking-aside>.text-button { min-height:40px; margin:0 6px; text-align:left; }
  .demo-banner { align-items:flex-start; flex-direction:column; gap:2px; padding:12px 15px; font-size:.8rem; }
  .provisional-banner { flex-direction:column; align-items:stretch; gap:15px; padding:19px; }
  .provisional-banner .button { align-self:flex-start; }
  .results-toolbar { gap:10px; margin:23px 0; }
  .results-toolbar .button { flex:1 1 140px; min-height:48px; font-size:.8rem; padding:12px 10px; }
  .results-toolbar .text-button { margin-left:0; min-height:40px; font-size:.8rem; }
  .results-layout,.card-layout { grid-template-columns:minmax(0,1fr); gap:23px; }
  .results-panel { padding:24px 20px 7px; }
  .results-panel .eyebrow { font-size:.63rem; }
  .results-panel .section-heading h2 { font-size:1.75rem; }
  .count-badge { font-size:.57rem; padding:6px 7px; letter-spacing:.065em; }
  .result-row { min-height:82px; gap:10px; padding:16px 0; }
  .result-rank { width:30px; font-size:1.55rem; }
  .result-row .song-text strong { font-size:.94rem; }
  .result-row .song-text>span { font-size:.74rem; }
  .result-row .preview-button,.least-panel .preview-button { width:44px; height:44px; }
  .result-row .song-link { display:none; }
  .least-panel .result-row { gap:10px; min-height:80px; }
  .result-date { display:block; margin-top:13px; padding-top:0; font-size:.74rem; }
  .result-notes .text-button { min-height:40px; }
  .unknown-results { padding:22px; }
  .empty-panel { padding:30px 24px; }
  .empty-panel .dialog-actions { flex-direction:column; align-items:stretch; }
  .card-preview-wrap { padding:20px; max-width:540px; }
  .card-preview-wrap canvas[height="1920"] { width:auto; max-height:590px; max-width:100%; }
  .card-controls { padding:26px 23px; width:100%; max-width:540px; }
  .card-controls h2 { font-size:1.85rem; }
  .theme-swatch { height:64px; }
  .theme-option>span:last-child { font-size:.76rem; }
  dialog { padding:35px 24px 26px; width:calc(100% - 24px); max-height:calc(100dvh - 24px); border-radius:14px; }
  dialog h2 { font-size:1.9rem; }
  dialog p,dialog li { font-size:.9rem; }
  .dialog-actions .button { flex:1 1 auto; }
  .position-options { grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
  .position-option { display:flex; min-height:82px; padding:10px 3px; flex-direction:column; justify-content:center; gap:5px; text-align:center; }
  .position-option-context { font-size:.65rem; white-space:nowrap; }
  .position-options+.button { margin-top:16px; }
  #toast { bottom:calc(116px + env(safe-area-inset-bottom)); width:max-content; max-width:calc(100vw - 32px); padding:12px 15px; font-size:.84rem; }
  footer { display:flex; flex-wrap:wrap; gap:7px 17px; align-items:center; padding:20px; font-size:.72rem; }
  footer>span:first-child { width:100%; font-size:.76rem; }
  footer>span:last-child { width:auto; }
  footer .text-button { font-size:.74rem; }
}
@media (max-width:400px) {
  main { padding-right:16px; padding-left:16px; }
  .site-header { padding-right:16px; padding-left:16px; }
  .account-bar { padding-right:16px; padding-left:16px; }
  .account-bar>span { max-width:137px; font-size:.68rem; }
  .account-bar .text-button { font-size:.7rem; }
  .setup-panel { padding:16px; }
  .album-choice { padding:11px; }
  .album-title { font-size:.81rem; }
  .checkbox-visual { top:13px; right:11px; }
  .setup-bottom .small { max-width:130px; }
  .setup-bottom .button { padding:12px 10px; font-size:.8rem; }
  .song-row .song-controls { gap:7px; }
  .song-controls .move-buttons { gap:5px; }
  .song-controls .unknown-button { padding-right:10px; padding-left:10px; font-size:.75rem; }
  .round-actions { margin-right:-16px; margin-left:-16px; padding-right:16px; padding-left:16px; }
  .section-heading h2 { font-size:1.5rem; }
  .phase-steps { gap:14px; }
  .phase-steps>div { gap:8px; }
  .results-panel { padding-right:17px; padding-left:17px; }
  .result-row { gap:9px; }
  .result-rank { width:26px; }
  .count-badge { font-size:.55rem; padding:6px; }
}
@media (max-width:370px) {
  .album-grid { grid-template-columns:minmax(0,1fr); }
  .album-choice { display:flex; align-items:center; min-height:76px; gap:12px; padding:12px; }
  .album-copy { flex:1; padding-right:25px; }
  .album-title { font-size:.88rem; }
  .album-meta { font-size:.73rem; }
  .checkbox-visual { top:calc(50% - 10px); right:12px; }
  .setup-bottom { flex-direction:column; align-items:stretch; }
  .setup-bottom>div { flex-direction:row; flex-wrap:wrap; align-items:baseline; gap:5px 10px; }
  .setup-bottom .small { max-width:none; }
  .song-controls .unknown-button { padding-right:7px; padding-left:7px; font-size:.72rem; }
  .song-row .song-controls { gap:6px; }
  .hero-note p { font-size:1.45rem; max-width:190px; }
  .hero-number13 { right:2px; }
  .count-badge { white-space:normal; max-width:77px; text-align:center; }
}
@media (prefers-reduced-motion:reduce) {
  *,*:before,*:after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}
.notes-panel p.handwritten{font:500 1.6rem/1.2 var(--hand);color:var(--accent);margin-top:24px}
footer .footer-brand{font:italic 1.1rem var(--serif);color:var(--accent)}
@media(max-width:680px){.rank-list .song-row{grid-template-columns:44px 42px minmax(0,1fr)}.song-row .rank-position-button{width:44px;min-height:44px}.account-bar .text-button{min-height:44px}}

.button{text-decoration:none}.button[aria-disabled="true"]{opacity:.45;cursor:wait}.card-controls>a.button{display:flex;margin-top:28px}

/* One deliberate grip handles touch, pen, and mouse reordering. */
.song-row .drag-handle { display:flex; align-items:center; justify-content:center; width:44px; min-width:44px; height:44px; padding:0; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.song-row .drag-handle:hover { background:var(--accent-light); color:var(--accent); }
.song-row .drag-handle:active { cursor:grabbing; }
.pointer-drag-source { opacity:.25; }
.rank-drag-active { cursor:grabbing; user-select:none; -webkit-user-select:none; }
.rank-drag-ghost.song-row { position:fixed; top:0; left:0; z-index:1001; margin:0; pointer-events:none; opacity:.97; background:var(--paper); box-shadow:0 12px 28px #3d2c232e; border:1px solid var(--accent); border-left:3px solid var(--era); will-change:transform; }
.rank-drop-marker { position:fixed; z-index:1000; height:3px; border-radius:3px; background:var(--accent); pointer-events:none; }
.song-menu-actions { display:grid; gap:16px; margin-top:22px; text-align:center; }
.song-menu-actions a { display:flex; min-height:44px; align-items:center; justify-content:center; color:var(--accent); font-size:.875rem; }

@media(max-width:680px) {
  .is-ranking .site-header { display:flex; align-items:center; min-height:56px; padding:6px 12px; gap:8px; flex-wrap:nowrap; }
  .is-ranking .brand { font-size:1.18rem; gap:6px; }
  .is-ranking .brand-mark { width:28px; height:32px; }
  .is-ranking .brand-caption { display:none; }
  .is-ranking .site-header nav { width:auto; margin-left:auto; gap:2px; }
  .is-ranking .nav-link { font-size:.75rem; padding:8px; min-height:44px; white-space:nowrap; }
  .is-ranking .nav-link[data-view="rank"] { display:none; }
  .is-ranking .account-bar { min-height:44px; padding:0 12px; }
  .is-ranking .account-bar>span { font-size:.75rem; max-width:none; }
  .is-ranking .account-bar .text-button { font-size:.75rem; }
  .is-ranking main { padding:12px 12px 40px; }
  .is-ranking .page-heading { margin-bottom:12px; }
  .is-ranking .page-heading .eyebrow { margin-bottom:3px; font-size:.75rem; letter-spacing:.08em; }
  .is-ranking .page-heading h1 { font-size:1.4rem; line-height:1.2; margin-bottom:5px; }
  .is-ranking .page-heading .intro { font-size:.875rem; line-height:1.35; margin-bottom:0; }
  .is-ranking .demo-banner { flex-direction:row; align-items:center; padding:6px 10px; margin-bottom:10px; font-size:.75rem; gap:8px; }
  .is-ranking .demo-banner>span { flex:1; }
  .is-ranking .demo-banner .text-button { min-height:44px; }
  .rank-list { gap:5px; }
  .rank-list .song-row,.rank-drag-ghost.song-row {
    display:grid; grid-template-columns:44px minmax(0,1fr) 44px 44px; grid-template-rows:auto;
    gap:4px; min-height:56px; padding:5px 3px; border-radius:8px;
  }
  .song-row .rank-position-button { grid-column:1; grid-row:1; width:44px; min-height:44px; font-size:1.2rem; border:0; background:transparent; }
  .song-row .song-art { display:none; }
  .song-row .song-text { grid-column:2; grid-row:1; gap:2px; }
  .song-row .song-text strong { font-size:1rem; line-height:1.2; font-weight:550; }
  .song-row .song-text>span { font-size:.75rem; line-height:1.2; }
  .song-row .song-controls { display:contents; }
  .song-row .song-controls .preview-button { grid-column:3; grid-row:1; width:44px; height:44px; min-width:44px; border-color:transparent; background:transparent; }
  .song-row .song-controls .preview-button.playing { background:var(--accent); }
  .song-row .song-controls .move-buttons,.song-row .song-controls .unknown-button,.song-row .song-controls .song-link { display:none; }
  .song-row .drag-handle { grid-column:4; grid-row:1; display:flex; }
  .is-ranking .order-label { margin-bottom:7px; font-size:.75rem; letter-spacing:.02em; }
  .is-ranking .order-label.bottom { margin-top:7px; margin-bottom:0; }
  .is-ranking .round-actions { margin:8px -12px 0; padding:6px 12px calc(6px + env(safe-area-inset-bottom)); gap:4px 10px; }
  .is-ranking .round-actions .button { min-height:44px; padding:8px; }
  .is-ranking .round-actions .saved-label { font-size:.75rem; }
}
@media(max-width:370px) {
  .is-ranking .brand { font-size:1rem; }
  .is-ranking .nav-link { padding:8px 5px; }
  .is-ranking .account-bar>span { max-width:120px; }
}

.apple-unmatched { padding-left:1.8em; margin:14px 0; max-height:180px; overflow-y:auto; color:var(--ink); }
.apple-unmatched li { padding:5px 0 5px 4px; overflow-wrap:anywhere; }
#apple-message>p { margin:12px 0; }
#apple-export-alternative { min-height:44px; margin-top:10px; text-align:center; }
