/* Must-Read 50: warm paper and ink, claret accent, brass for the top ranks. */
:root {
  color-scheme: light;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #f5efe4; --surface: #fffcf6; --surface-2: #faf5ec;
  --ink: #1f1a15; --ink-2: #463e36; --ink-3: #685e54; --muted: #857a6e; --faint: #b0a597;
  --line: #e6dccd; --line-2: #efe7da; --control-line: #d6c9b6;
  --accent: #8a2b35; --accent-ink: #8a2b35; --accent-soft: #f5e6e4; --on-accent: #fff8ef;
  --brass: #b8913f; --brass-ink: #8a6420; --brass-line: #e5d3a8;
  --on-bg: #1f1a15; --on-ink: #fff8ef;
  --star: #c98a1b; --link: #8a2b35;
  --top-bar: rgba(245,239,228,.9);
  --shadow: 0 1px 2px rgba(60,40,20,.06), 0 6px 18px rgba(60,40,20,.06);
  --chip-new: #e3edef; --chip-new-ink: #2b5b68; --chip-classic: #f2e7cf; --chip-classic-ink: #7a5815; --chip-modern: #e6eedf; --chip-modern-ink: #3d6132;
  --fit: #f5e6e4; --fit-ink: #8a2b35; --want: #fbecd9; --want-ink: #87480f;
  --pos: #2f6a3c; --neg: #a3313b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14110e; --surface: #1d1915; --surface-2: #191511;
    --ink: #f2eadc; --ink-2: #d8cebe; --ink-3: #b3a897; --muted: #908676; --faint: #6c6357;
    --line: #2f2922; --line-2: #27221c; --control-line: #3e362c;
    --accent: #b8424e; --accent-ink: #eb9097; --accent-soft: rgba(235,144,151,.13); --on-accent: #fff8ef;
    --brass: #d8b25e; --brass-ink: #e0bd6c; --brass-line: #4a3e25;
    --on-bg: #f2eadc; --on-ink: #17130f;
    --star: #e9b04a; --link: #eb9097;
    --top-bar: rgba(20,17,14,.9);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.25);
    --chip-new: rgba(110,180,200,.14); --chip-new-ink: #9fd0dc; --chip-classic: rgba(216,178,94,.15); --chip-classic-ink: #e5c47a;
    --chip-modern: rgba(130,180,110,.14); --chip-modern-ink: #a9d394;
    --fit: rgba(235,144,151,.13); --fit-ink: #eb9097; --want: rgba(233,160,80,.14); --want-ink: #efbb80;
    --pos: #8fd19e; --neg: #f0959b;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
button { font: inherit; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 22px; height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 20px 0; background: var(--top-bar); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--accent);
  color: var(--on-accent); font-family: var(--serif); font-size: 14px; font-weight: 700; font-style: italic; box-shadow: inset -3px 0 0 rgba(0,0,0,.18); }
.brand-name { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); white-space: nowrap; letter-spacing: -.2px; }
.brand-light { color: var(--accent-ink); font-style: italic; }
.nav { display: flex; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; color: var(--ink-3); text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 0 11px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.beta-pill { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--brass-ink);
  border: 1px solid var(--brass-line); border-radius: 20px; padding: 3px 8px; flex-shrink: 0; }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; height: auto; gap: 0; padding: env(safe-area-inset-top) 16px 0; }
  .brand { height: 50px; }
  .beta-pill { align-self: center; }
  .nav { order: 3; flex-basis: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; height: 42px; border-top: 1px solid var(--line-2); justify-content: space-between; }
  .nav a { padding: 0 6px; font-size: 13px; }
}
.nav .sm { display: none; }
@media (max-width: 520px) { .nav .lg { display: none; } .nav .sm { display: inline; } }

.page { max-width: 920px; margin: 0 auto; padding: 30px 20px 40px; }
.footer { max-width: 920px; margin: 0 auto; padding: 24px 20px calc(30px + env(safe-area-inset-bottom)); font-size: 11.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); }
.footer a { color: var(--ink-3); }
h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; letter-spacing: -.6px; line-height: 1.08; }
h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.3px; }
.sub { color: var(--ink-3); font-size: 15px; line-height: 1.6; margin-top: 8px; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px; margin-top: 18px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 24px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--control-line); }
.btn-ghost:hover { border-color: var(--ink-3); filter: none; }
.input { border: 1px solid var(--control-line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.error { color: var(--neg); font-size: 13px; margin-top: 10px; }

/* ---- landing ---- */
.hero { text-align: center; padding: 26px 0 6px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brass-ink); }
.hero h1 { font-size: 52px; font-weight: 600; letter-spacing: -1.2px; margin-top: 10px; }
.hero h1 em { color: var(--accent-ink); font-weight: 500; }
.hero .sub { max-width: 560px; margin: 14px auto 0; font-size: 16.5px; }
.cta-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.cta-row .btn { padding: 12px 22px; font-size: 15px; }
.perks { margin-top: 30px; text-align: center; }
.perk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; text-align: left; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 13px; color: var(--ink-3); line-height: 1.55; box-shadow: var(--shadow); }
.perk b { display: block; font-family: var(--serif); font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.25; margin-bottom: 6px; }
.perk-note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.make-yours { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  background: var(--accent-soft); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.make-yours b { color: var(--ink); }
#upload { scroll-margin-top: 110px; }
@media (max-width: 860px) { .perk-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .perk-grid { grid-template-columns: 1fr; } }
.collage { isolation: isolate; overflow: hidden; margin: 30px -20px 0; padding: 14px 0 22px; display: grid; gap: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.collage-row { display: flex; justify-content: center; gap: 16px; }
.collage-row:nth-child(2) { transform: translateX(48px); }
.collage .cover { width: 80px; height: 120px; transform: rotate(var(--r)); transition: transform .25s; }
.collage .cover:hover { transform: rotate(0) scale(1.06); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.step { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.step b { display: block; color: var(--ink); margin-bottom: 3px; font-weight: 600; }
.drop { display: block; margin-top: 18px; border: 1.5px dashed var(--brass-line); border-radius: 16px; padding: 32px 20px; text-align: center; background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.drop .muted { font-size: 13px; margin-top: 6px; }
.tabs { display: inline-flex; border: 1px solid var(--control-line); border-radius: 22px; padding: 3px; margin-top: 16px; }
.tabs button { border: 0; background: transparent; color: var(--ink-3); padding: 6px 14px; border-radius: 18px; cursor: pointer; font-size: 13.5px; }
.tabs button.on { background: var(--on-bg); color: var(--on-ink); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
.pillar { padding-top: 14px; border-top: 2px solid var(--ink); font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.pillar b { display: block; color: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 5px; }
.progress { margin-top: 22px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
@media (max-width: 700px) {
  .hero h1 { font-size: 36px; letter-spacing: -.8px; }
  .collage { margin: 22px -16px 0; gap: 10px; padding: 10px 0 16px; }
  .collage-row { gap: 10px; }
  .collage-row:nth-child(2) { transform: translateX(32px); }
  .collage .cover { width: 56px; height: 84px; }
  .steps, .pillars { grid-template-columns: 1fr; }
  .pillars { gap: 18px; }
}

/* ---- list ---- */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.controls { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.control { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.control input[type=range], .control input[type=checkbox] { accent-color: var(--accent); }
.control input[type=range] { width: 150px; }
.control label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.mixline { font-size: 12px; color: var(--muted); margin-top: 10px; }
.book { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-top: 12px; box-shadow: var(--shadow); }
.book.top { border-color: var(--brass-line); }
.rank { width: 44px; flex-shrink: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; font-style: italic; color: var(--faint); text-align: center; line-height: 1; }
.book.top .rank { color: var(--brass-ink); font-size: 40px; }
.cover { width: 68px; height: 102px; flex-shrink: 0; border-radius: 2px 4px 4px 2px; overflow: hidden; background: linear-gradient(150deg, #8a2b35, #4d1820); position: relative;
  box-shadow: 0 2px 4px rgba(30,20,10,.2), 0 8px 16px rgba(30,20,10,.18); display: flex; align-items: flex-end; padding: 6px; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.22) 0, rgba(255,255,255,.12) 3px, transparent 7px); pointer-events: none; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover span { font-family: var(--serif); color: #fff8ef; font-size: 9.5px; font-weight: 600; line-height: 1.15; }
.binfo { flex: 1; min-width: 0; }
.btitle { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -.2px; }
.bauthor { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.chip-n { background: var(--chip-new); color: var(--chip-new-ink); }
.chip-m { background: var(--chip-modern); color: var(--chip-modern-ink); }
.chip-c { background: var(--chip-classic); color: var(--chip-classic-ink); }
.chip-score { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); padding: 2px 8px; font-variant-numeric: tabular-nums; }
.chip-fit { background: var(--fit); color: var(--fit-ink); }
.chip-want { background: var(--want); color: var(--want-ink); }
.stars { font-size: 12px; color: var(--muted); }
.stars b { color: var(--star); }
.why { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin-top: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.badge { font-size: 10.5px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; }
.links a { color: var(--link); text-decoration: none; font-weight: 600; }
.links a:hover { text-decoration: underline; }
.book.compact { padding: 12px 16px; gap: 14px; }
.book.compact .rank { font-size: 21px; width: 32px; }
.book.compact .cover { width: 42px; height: 63px; }
.book.compact .btitle { font-size: 16px; }
@media (max-width: 700px) {
  h1 { font-size: 32px; }
  .book { gap: 12px; padding: 14px; }
  .rank { width: 28px; font-size: 24px; }
  .book.top .rank { font-size: 30px; }
  .cover { width: 54px; height: 81px; }
  .btitle { font-size: 17.5px; }
  .control input[type=range] { width: 120px; }
}

/* ---- taste / next / how ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.tile-value { font-family: var(--serif); font-size: 30px; font-weight: 600; margin-top: 2px; }
.tile-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.row:last-child { border-bottom: 0; }
.pos { color: var(--pos); font-weight: 700; } .neg { color: var(--neg); font-weight: 700; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chipbtn { border: 1px solid var(--control-line); background: var(--surface); color: var(--ink-3); border-radius: 18px; padding: 6px 13px; font-size: 13px; cursor: pointer; }
.chipbtn.on { background: var(--on-bg); color: var(--on-ink); border-color: var(--on-bg); }
.prose { font-size: 15px; line-height: 1.7; color: var(--ink-2); max-width: 680px; }
.prose h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); margin: 24px 0 6px; }
.prose ul { padding-left: 20px; } .prose li { margin: 5px 0; }
.prose table { border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 7px 14px 7px 0; text-align: left; }

/* ---- freshness + install ---- */
.btn-small { padding: 7px 14px; font-size: 13px; }
.updated { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.updated.stale span { color: var(--want-ink); }
.a2hs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--brass-line); background: var(--surface-2); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.a2hs b:first-child { display: block; color: var(--ink); font-family: var(--serif); font-size: 15.5px; font-weight: 600; }
.a2hs-actions { display: flex; gap: 8px; }

/* ---- slider feedback ---- */
.change-note { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); }
.chip-added { background: var(--accent); color: var(--on-accent); }
.book.just-added { border-color: var(--accent); }

/* ---- up next ---- */
.notice { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.holiday-notice { border-color: var(--brass-line); }
.picker { margin-top: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; }
.picker-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.picker-label { width: 46px; flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.chip-holiday { border-color: var(--brass-line); color: var(--brass-ink); font-weight: 600; }
.chip-holiday.on { background: var(--brass); border-color: var(--brass); color: #1a1407; }
.picks { display: grid; gap: 12px; margin-top: 16px; }
.pick { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.picks .pick:first-child { border-color: var(--brass-line); }
.pick .cover { width: 92px; height: 138px; }
.pick-label { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.pick-facts { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.pick-facts b { color: var(--fit-ink); }
.holiday-fits { font-size: 12.5px; color: var(--brass-ink); margin-top: 6px; font-weight: 600; }
.surprise { margin-top: 14px; }
#surprise-out .pick { margin-top: 12px; border-color: var(--accent); }
.section-label { margin-top: 26px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.also { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.also-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); font-size: 13.5px; }
.also-row:last-child { border-bottom: 0; }
.also-row:hover { background: var(--surface-2); }
.also-rank { width: 30px; flex-shrink: 0; font-family: var(--serif); font-style: italic; color: var(--faint); }
.also-title { font-weight: 600; }
.also-author { color: var(--ink-3); font-size: 12.5px; flex: 1; }
.also-main { flex: 1; min-width: 0; }
.also-fit { color: var(--fit-ink); font-weight: 700; font-size: 13px; }
.popular-why { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) {
  .pick { gap: 14px; padding: 14px; }
  .pick .cover { width: 66px; height: 99px; }
  .picker-label { width: 100%; }
  .also-row:not(.popular) { flex-wrap: wrap; }
  .also-row:not(.popular) .also-author { flex-basis: 100%; padding-left: 40px; order: 3; }
}

.howto { list-style: none; padding: 0 !important; display: grid; gap: 8px; margin-top: 8px; }
.howto li { margin: 0 !important; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.howto b { color: var(--ink); }
.prose h1 { color: var(--ink); }
