/* Stacks: a discovery queue for books and films, dressed as a reading room.
   Walnut and leather surfaces under lamplight, parchment controls with ink text, brass accents. */

:root {
  --bg-0: #0f0a07;
  --bg-1: #17110c;
  --bg-2: #241a12;
  --panel: rgba(30, 22, 15, 0.82);
  --panel-solid: #221810;
  --panel-soft: rgba(236, 222, 190, 0.035);
  --line: rgba(222, 196, 146, 0.12);
  --line-strong: rgba(222, 196, 146, 0.24);
  --text: #e6dac2;
  --text-dim: #b3a386;
  --text-faint: #867760;
  --text-bright: #f8efdc;
  --accent: #d6b06a; /* brass */
  --accent-deep: #8f6e35;
  --accent-soft: rgba(214, 176, 106, 0.14);
  --green: #9fbd7c; /* sage */
  --green-deep: #3f5d38; /* library green */
  --gold: #deb660;
  --red: #d27a66; /* brick, for text on dark */
  --oxblood: #7c2b22;
  --plum: #c3aee6; /* AI picks */
  --tag-bg: rgba(236, 222, 190, 0.06);
  --tag-text: #dac9a5;

  /* Paper: buttons, bookplates, index cards, slips */
  --paper: #efe3c8;
  --paper-hi: #f7eedb;
  --paper-lo: #dccaa3;
  --paper-edge: #b59c6c;
  --ink: #2a1d12;
  --ink-dim: #5e4b35;
  --ink-faint: #8a7457;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");

  --font-ui: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-display: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-book: var(--font-display);

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-cover: 0 18px 40px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;

  /* Colour channels for translucent tints (rgb(var(--rgb-x) / alpha)); Flicks redefines them. */
  --rgb-tint: 236 222 190; /* parchment */
  --rgb-brass: 214 176 106;
  --rgb-line: 222 196 146;
  --rgb-sheet-ink: 42 29 18; /* ink tints on paper slips */
  --rgb-sheet-edge: 181 156 108;
  --rgb-rule: 166 52 38;
  --rgb-wood: 20 14 9;
  --rgb-wood-2: 15 10 7;
  --rgb-wood-3: 24 17 11;
  --rgb-wood-4: 40 29 20;
  --rgb-sage: 159 189 124;
  --rgb-oxblood: 124 43 34;
  --rgb-brick: 210 122 102;
  --rgb-bar: 22 16 11;

  /* Surfaces: primary buttons, paper slips (toasts, popovers, the "why" card) and the match badge.
     Stacks makes them all parchment; Flicks gives each its own treatment. */
  --btn-hi: var(--paper-hi);
  --btn-lo: var(--paper-lo);
  --btn-edge: var(--paper-edge);
  --btn-fg: var(--ink);
  --btn-dim: var(--ink-dim);
  --btn-hover-hi: #fcf6ea;
  --btn-hover-lo: #e7d7b4;
  --btn-gloss: rgba(255, 255, 255, 0.6);
  --btn-gloss-hover: rgba(255, 255, 255, 0.7);
  --btn-ribbon: var(--green-deep);
  --btn-icon: var(--green-deep);
  --sheet-hi: var(--paper-hi);
  --sheet-lo: var(--paper);
  --sheet-edge: var(--paper-edge);
  --sheet-fg: var(--ink);
  --sheet-dim: var(--ink-dim);
  --sheet-faint: var(--ink-faint);
  --sheet-warn: #7c2b22;
  --sheet-warn-icon: #9b3b2c;
  --sheet-ai: #6d4f9a;
  --sheet-match-bg: #e3e9cd;
  --sheet-match-fg: #34502a;
  --sheet-match-edge: #a7b98f;
  --badge-hi: var(--paper-hi);
  --badge-lo: var(--paper);
  --badge-edge: var(--paper-edge);
  --badge-fg: var(--ink);
  --badge-dim: var(--ink-dim);
  --badge-accent: #7a4f12;
  --want-hi: #e9efd6;
  --want-lo: #cad6ab;
  --want-edge: #8fa577;
  --want-fg: var(--ink);
  --stage-bg: #140e09;
  --cover-bg: #2a1f16;
  --match-fg: #d2e2b8;
  --warn-fg: #f0b9aa;
  --explore-fg: #b2c88f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background-color: var(--bg-1);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Lamplight and paper grain on fixed layers (cheaper than background-attachment: fixed when scrolling). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 72% -8%, rgba(214, 160, 84, 0.2) 0%, transparent 62%),
    radial-gradient(700px 500px at 4% 108%, rgba(124, 58, 30, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 420px, var(--bg-0) 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain); opacity: 0.35;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-bright); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
main { outline: none; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* Small-caps label voice, used for tabs, eyebrows and section heads. */
.eyebrow, .tabs a, .pcard h2, .why h3, .learning h3, .learned h3, .seg-label, .ai-profile h3,
.next-btn .lbl small, .match-badge small, .badge, .step-label {
  font-family: var(--font-display);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--gutter);
  height: 58px;
  background: rgb(var(--rgb-bar) / 0.9);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid rgb(var(--rgb-brass) / 0.22);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper-hi); font-weight: 600; letter-spacing: 0.02em; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark svg, .landing-mark svg { display: block; width: 100%; height: 100%; }
.brand-name { font-family: var(--font-display); font-size: 19px; text-transform: uppercase; letter-spacing: 0.2em; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%;
  color: var(--text-dim); font-size: 16px; font-weight: 500; letter-spacing: 0.07em; font-variant-caps: all-small-caps;
  border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.tabs a:hover { color: var(--text-bright); }
.tabs a.active { color: var(--paper-hi); border-bottom-color: var(--accent); }
.tabs .count:empty { display: none; }
.tabs .count {
  min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--green-deep); color: var(--paper-hi);
  font: 600 11px/18px var(--font-ui); text-align: center; letter-spacing: 0; font-variant-caps: normal;
}
.status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12.5px; font-style: italic; white-space: nowrap; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgb(var(--rgb-tint) / 0.15); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Books | Films: each mode is its own library, so this reads as a choice of shelf, not a filter. */
#mode-host { flex: none; }
.mode-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 4px; background: rgb(var(--rgb-tint) / 0.06); box-shadow: inset 0 0 0 1px var(--line); }
.mode-switch button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 0; border-radius: 3px; cursor: pointer;
  background: transparent; color: var(--text-dim); font: 500 15px/1.2 var(--font-display); letter-spacing: 0.07em; font-variant-caps: all-small-caps;
  transition: background 0.15s, color 0.15s;
}
.mode-switch button:hover { color: var(--text-bright); background: rgb(var(--rgb-tint) / 0.08); }
.mode-switch button.on { background: var(--paper); color: var(--ink); cursor: default; }
.landing-switch { margin-bottom: 28px; }
.landing-switch button { padding: 7px 16px; font-size: 17px; }

/* ---------- shared bits ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 64px; }
.eyebrow { color: var(--accent); font-size: 15px; font-weight: 500; letter-spacing: 0.12em; font-variant-caps: all-small-caps; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--text-bright); margin: 0; line-height: 1.2; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* Buttons: borders are inset shadows so nothing changes size. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 0; border-radius: 3px; cursor: pointer;
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--text); background: rgb(var(--rgb-tint) / 0.06);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { background: rgb(var(--rgb-tint) / 0.13); color: var(--text-bright); box-shadow: inset 0 0 0 1px rgb(var(--rgb-line) / 0.42); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
/* Parchment: the main, beige library buttons. */
.btn-primary, .btn-green {
  color: var(--btn-fg);
  background: var(--grain), linear-gradient(180deg, var(--btn-hi) 0%, var(--btn-lo) 100%);
  box-shadow: inset 0 0 0 1px var(--btn-edge), inset 0 1px 0 var(--btn-gloss), 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.25);
}
.btn-primary:hover, .btn-green:hover {
  color: var(--btn-fg);
  background: var(--grain), linear-gradient(180deg, var(--btn-hover-hi) 0%, var(--btn-hover-lo) 100%);
  box-shadow: inset 0 0 0 1px var(--btn-edge), inset 0 1px 0 var(--btn-gloss-hover), 0 2px 0 rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.3);
}
/* "Want to Read" wears a green bookmark ribbon. */
.btn-green { box-shadow: inset 5px 0 0 var(--btn-ribbon), inset 0 0 0 1px var(--btn-edge), inset 0 1px 0 var(--btn-gloss), 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.25); }
.btn-green:hover { box-shadow: inset 5px 0 0 var(--btn-ribbon), inset 0 0 0 1px var(--btn-edge), inset 0 1px 0 var(--btn-gloss-hover), 0 2px 0 rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.3); }
.btn-green .icon { color: var(--btn-icon); }
.btn-ghost { background: transparent; color: var(--text-dim); box-shadow: none; }
.btn-ghost:hover { background: var(--panel-soft); color: var(--text-bright); box-shadow: none; }
.btn-danger:hover { background: rgb(var(--rgb-oxblood) / 0.4); color: #f6d9d2; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

/* Keys look like typewriter keys. */
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 3px;
  border: 1px solid var(--sheet-edge); border-bottom-width: 2px;
  background: var(--sheet-lo); color: var(--sheet-dim);
  font: 600 11px/16px var(--font-ui); text-align: center;
}

/* Tags: catalogue labels. */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 2px; border: 0; cursor: pointer;
  background: var(--tag-bg); color: var(--tag-text); font-size: 12.5px; line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgb(var(--rgb-line) / 0.16);
  transition: background 0.15s, color 0.15s;
}
.tag:hover { background: rgb(var(--rgb-tint) / 0.14); color: var(--text-bright); }
.tag.match { background: rgb(var(--rgb-sage) / 0.14); color: var(--match-fg); box-shadow: inset 0 0 0 1px rgb(var(--rgb-sage) / 0.45); }
.tag.warn { background: rgb(var(--rgb-oxblood) / 0.32); color: var(--warn-fg); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brick) / 0.35); }
.tag.more::after { content: "+"; font-weight: 700; }
.tag.less { text-decoration: line-through; opacity: 0.65; }
.tag.static { cursor: default; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-btn {
  padding: 6px 11px; border-radius: 16px; border: 1px solid var(--sheet-edge); background: transparent;
  color: var(--sheet-fg); font-size: 12.5px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.chip-btn:hover { background: rgb(var(--rgb-sheet-ink) / 0.09); border-color: var(--sheet-dim); color: var(--sheet-fg); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }

/* No cover scan: a clothbound spine-shaded binding with gold-foil lettering. */
.fallback-cover {
  --h: 210;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  aspect-ratio: 2 / 3; padding: 14% 11%; overflow: hidden;
  background: var(--grain), linear-gradient(160deg, hsl(var(--h) 30% 25%), hsl(calc(var(--h) + 25) 34% 13%));
  color: #e3c47e; font-family: var(--font-display);
  box-shadow: inset 7px 0 12px rgba(0, 0, 0, 0.3), inset 0 0 0 5px rgba(0, 0, 0, 0.12), inset 0 0 0 6px rgba(227, 196, 126, 0.42);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.fallback-cover .fc-title { font-size: clamp(12px, 1.6em, 26px); line-height: 1.15; font-weight: 600; overflow-wrap: anywhere; }
.fallback-cover .fc-author { font-size: 0.8em; opacity: 0.8; letter-spacing: 0.08em; font-variant-caps: all-small-caps; }

/* ---------- toasts: paper slips ---------- */
#toasts {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(560px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; width: 100%;
  padding: 12px 16px; border-radius: 4px;
  background: var(--grain), linear-gradient(180deg, var(--sheet-hi), var(--sheet-lo));
  border: 1px solid var(--sheet-edge); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  color: var(--sheet-fg); font-size: 14px;
  opacity: 0; transform: translateY(12px); transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast b { color: var(--sheet-fg); }
.toast .faint { color: var(--sheet-faint); }
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- landing ---------- */
.landing { max-width: 980px; margin: 0 auto; padding: clamp(40px, 9vh, 96px) var(--gutter) 64px; }
.landing-hero { display: grid; gap: 18px; margin-bottom: 36px; }
.landing-hero h1 { font-size: clamp(34px, 5.2vw, 56px); letter-spacing: -0.005em; max-width: 16ch; font-weight: 600; }
.landing-hero h1 em { font-style: italic; color: var(--accent); }
.landing-hero p { font-size: 17px; max-width: 60ch; margin: 0; color: var(--text-dim); }
.landing-mark { display: block; width: 54px; height: 54px; }
.drop {
  position: relative; display: grid; place-items: center; gap: 12px; text-align: center;
  padding: 44px 24px; border-radius: var(--radius-lg); cursor: pointer;
  border: 2px dashed rgb(var(--rgb-brass) / 0.4); background: rgb(var(--rgb-brass) / 0.05);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgb(var(--rgb-brass) / 0.1); }
.drop.over { transform: scale(1.01); }
.drop .icon { width: 36px; height: 36px; color: var(--accent); }
.drop strong { font-family: var(--font-display); color: var(--text-bright); font-size: 21px; font-weight: 600; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-error { color: var(--red); margin-top: 12px; }
.local-file { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; counter-reset: step; }
.howto li {
  list-style: none; padding: 18px; border-radius: var(--radius-lg); background: var(--panel-soft); border: 1px solid var(--line);
  counter-increment: step; font-size: 14px; color: var(--text-dim);
}
.howto li::before {
  content: counter(step, upper-roman); display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 10px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brass) / 0.4);
  font: 600 13px/1 var(--font-display);
}
.howto b { color: var(--text); }
.howto { padding: 0; }
.privacy { margin-top: 26px; font-size: 13px; color: var(--text-faint); display: flex; gap: 8px; align-items: flex-start; }

/* Films: the TMDB key comes before the export. */
.key-step { display: grid; gap: 12px; padding: 18px 20px; margin-bottom: 26px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
.key-head { display: flex; align-items: center; gap: 12px; }
.key-head b { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text-bright); }
.drop-head { margin-bottom: 12px; }
.step-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 600 15px/1 var(--font-display); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brass) / 0.4);
}
.key-step.saved .step-num { background: var(--green-deep); color: var(--paper-hi); box-shadow: none; }
.key-form { display: flex; flex-wrap: wrap; gap: 8px; }
.key-form input {
  flex: 1 1 260px; min-width: 0; padding: 10px 12px; border-radius: 3px; border: 1px solid var(--line-strong);
  background: rgb(var(--rgb-wood-2) / 0.5); color: var(--text-bright); font: inherit; font-size: 14px;
}
.key-help { margin: 0; font-size: 13px; }
.key-error { margin: 0; color: var(--red); font-size: 13.5px; }
.key-error:empty { display: none; }
.key-ok { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--green); }
.drop.waiting { opacity: 0.55; }
.attribution { margin: 14px 0 0; font-size: 12.5px; }

/* ---------- analyze ---------- */
.analyze { max-width: 880px; margin: 0 auto; padding: clamp(36px, 8vh, 80px) var(--gutter) 64px; }
.analyze h1 { font-size: clamp(28px, 4.2vw, 40px); margin: 8px 0 24px; }
.steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); transition: opacity 0.3s; }
.step.todo { opacity: 0.45; }
.step .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); }
.step.active .dot { border-color: transparent; }
.step.active .dot::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(var(--rgb-tint) / 0.15); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.step.done .dot { background: var(--green-deep); border-color: var(--green-deep); color: var(--paper-hi); }
.step.done .dot .icon { width: 14px; height: 14px; }
.step.error .dot { border-color: var(--red); }
.step-label { color: var(--text-bright); font-weight: 600; font-size: 16.5px; }
.step-detail { color: var(--text-dim); font-size: 13px; }
.step-count { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.mosaic .m { aspect-ratio: 2 / 3; border-radius: 3px; background: rgb(var(--rgb-tint) / 0.05); overflow: hidden; }
.mosaic .m > * { width: 100%; height: 100%; object-fit: cover; display: block; animation: pop 0.4s var(--ease) both; }
.mosaic .fallback-cover { font-size: 7px; padding: 10%; }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
.analyze-error { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: rgb(var(--rgb-oxblood) / 0.25); border: 1px solid rgb(var(--rgb-brick) / 0.4); }

/* ---------- calibrate ---------- */
.calib { max-width: 1040px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.calib-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.calib-head h1 { font-size: clamp(26px, 3.6vw, 36px); margin-top: 6px; }
.calib-head p { margin: 6px 0 0; max-width: 60ch; color: var(--text-dim); }
.calib-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.calib-stage { display: grid; }
.calib-stage > * { grid-area: 1 / 1; }
.calib-card { display: grid; grid-template-columns: 200px 1fr; gap: 28px; padding: 26px; transition: opacity 0.2s, transform 0.25s var(--ease); }
.calib-card.leaving { opacity: 0; transform: translateX(-24px); }
.calib-card.entering { opacity: 0; transform: translateX(24px); }
.calib-cover { width: 200px; }
.calib-cover > * { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: var(--shadow-cover); display: block; }
.calib-info h2 { font-family: var(--font-book); font-size: clamp(24px, 2.8vw, 32px); font-weight: 600; }
.calib-info .by { color: var(--text-dim); margin: 6px 0 18px; }
.rate-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.rate-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel-soft); cursor: pointer; text-align: left; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.rate-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text-bright); }
.rate-btn:active { transform: scale(0.98); }
.rate-btn.loved:hover { border-color: var(--green); background: rgb(var(--rgb-sage) / 0.13); }
.rate-btn.disliked:hover { border-color: var(--red); background: rgb(var(--rgb-oxblood) / 0.3); }
.rate-skip { margin-top: 10px; }
.progress { height: 4px; border-radius: 2px; background: rgb(var(--rgb-tint) / 0.1); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width 0.35s var(--ease); }
.learning { padding: 18px; }
.learning h3 { font-size: 16px; font-weight: 500; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--text-dim); margin-bottom: 12px; }
.learning .tags { min-height: 60px; }
.learning .tag { animation: pop 0.35s var(--ease) both; }

/* ---------- queue ---------- */
.queue { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gutter) 40px; }
.q-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.q-title h1 { font-size: clamp(24px, 2.8vw, 30px); font-weight: 600; letter-spacing: 0.005em; }
.q-title p { margin: 2px 0 0; color: var(--text-dim); font-size: 12.5px; font-style: italic; }
.q-progress { display: flex; align-items: center; gap: 12px; }
.q-dots { display: flex; gap: 4px; }
.q-dots i { width: 22px; height: 5px; border-radius: 2px; background: rgb(var(--rgb-tint) / 0.14); transition: background 0.25s; }
.q-dots i.done { background: rgb(var(--rgb-tint) / 0.38); }
.q-dots i.want { background: var(--green); }
.q-dots i.pass { background: #b0584a; }
.q-dots i.read { background: var(--gold); }
.q-dots i.cur { background: var(--paper-hi); }
.q-count { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; min-width: 52px; text-align: right; }

.stage {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--stage-bg); border: 1px solid var(--line); isolation: isolate;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgb(var(--rgb-tint) / 0.05);
}
.backdrop { position: absolute; inset: 0; z-index: -1; }
.backdrop .bd {
  position: absolute; inset: -60px; background-size: cover; background-position: center;
  filter: blur(46px) sepia(0.35) saturate(1.15) brightness(0.52); transform: scale(1.1);
  opacity: 0; transition: opacity 0.6s ease;
}
.backdrop .bd.on { opacity: 1; }
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(var(--rgb-wood) / 0.35) 0%, rgb(var(--rgb-wood) / 0.84) 45%, rgb(var(--rgb-wood) / 0.93) 100%);
}
.card-host { display: grid; min-height: min(540px, calc(100vh - 250px)); }
.card-host > .card { grid-area: 1 / 1; }
.card {
  /* Cover scales with viewport height so the whole card + action bar fit on a laptop screen. */
  display: grid; grid-template-columns: clamp(180px, calc((100vh - 330px) * 0.667), 330px) minmax(0, 1fr); gap: clamp(22px, 3.5vw, 44px);
  padding: clamp(20px, 3.2vw, 40px);
  transition: opacity 0.26s var(--ease), transform 0.3s var(--ease);
  touch-action: pan-y;
}
.card.enter-right { opacity: 0; transform: translateX(46px); }
.card.enter-left { opacity: 0; transform: translateX(-46px); }
.card.leave-left { opacity: 0; transform: translateX(-46px); pointer-events: none; }
.card.leave-right { opacity: 0; transform: translateX(46px); pointer-events: none; }
.card.dragging { transition: none; }

.cover-col { position: relative; align-self: start; }
.cover-wrap { position: relative; border-radius: 4px; transform-style: preserve-3d; transition: transform 0.4s var(--ease); }
.cover-wrap > img, .cover-wrap > .fallback-cover {
  display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 4px 4px 3px;
  box-shadow: var(--shadow-cover); background: var(--cover-bg);
}
.cover-wrap > .fallback-cover { font-size: 18px; }
.cover-wrap > .ph { position: absolute; inset: 0; height: 100%; }
.cover-wrap > img.real { position: relative; z-index: 1; opacity: 0; transition: opacity 0.35s ease; }
.cover-wrap > img.real.loaded { opacity: 1; }
/* Light across the jacket plus a spine crease on the left edge. */
.cover-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px 4px 4px 3px; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0%, rgba(255, 255, 255, 0.1) 2.2%, transparent 5%),
    linear-gradient(115deg, rgba(255, 248, 230, 0.14) 0%, transparent 32%, transparent 70%, rgba(0, 0, 0, 0.2) 100%);
}
/* Match score as a bookplate label. */
.match-badge {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px 5px; border-radius: 2px;
  background: var(--grain), linear-gradient(180deg, var(--badge-hi), var(--badge-lo));
  color: var(--badge-fg); font: 700 17px/1.1 var(--font-display);
  box-shadow: inset 0 0 0 1px var(--badge-edge), inset 0 0 0 3px var(--badge-hi), inset 0 0 0 4px rgba(90, 64, 38, 0.35), 0 4px 14px rgba(0, 0, 0, 0.45);
}
.match-badge small { color: var(--badge-dim); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; font-variant-caps: all-small-caps; }
.match-badge.explore { color: var(--badge-accent); }
.match-badge .icon { color: var(--badge-accent); }
.cover-links { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.cover-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 3px; font-size: 12.5px;
  background: rgb(var(--rgb-tint) / 0.07); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--line);
}
.cover-links a:hover { background: rgb(var(--rgb-tint) / 0.14); color: var(--text-bright); }

.info { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 600; font-style: italic; }
.kicker.explore { color: var(--explore-fg); }
.kicker.twin, .why li.twin-why > .icon { color: var(--green); }
.why li.twin-why { font-size: 14px; flex-wrap: nowrap; align-items: flex-start; }
.why li.twin-why > .icon { margin-top: 3px; }
.twin-stars { color: var(--gold); letter-spacing: 0.5px; }
.book-title { font-family: var(--font-book); font-size: clamp(30px, 3.8vw, 46px); font-weight: 600; line-height: 1.05; letter-spacing: -0.005em; overflow-wrap: anywhere; color: var(--paper-hi); }
.byline { color: var(--text-dim); font-size: 15px; }
.byline b { color: var(--text); font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--text-dim); }
.stars { color: var(--gold); letter-spacing: 1px; }
.stars .icon { width: 14px; height: 14px; }
.badge { padding: 1px 8px 2px; border-radius: 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; font-variant-caps: all-small-caps; background: rgba(222, 182, 96, 0.14); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(222, 182, 96, 0.3); }
.badge.gem { background: rgb(var(--rgb-sage) / 0.14); color: var(--green); box-shadow: inset 0 0 0 1px rgb(var(--rgb-sage) / 0.35); }
.desc { position: relative; color: var(--text); font-size: 15px; line-height: 1.65; max-width: 70ch; }
.desc p { margin: 0 0 0.8em; }
.desc.clamped { max-height: 9.8em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.desc.loading { color: var(--text-faint); }
.desc-toggle { align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 13px; font-style: italic; }
.skeleton { display: block; height: 0.9em; margin: 0.55em 0; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--rgb-tint) / 0.05), rgb(var(--rgb-tint) / 0.11), rgb(var(--rgb-tint) / 0.05)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* "Why it's in your queue" as a library index card. */
.why {
  padding: 14px 16px; border-radius: 3px; color: var(--sheet-fg);
  background: var(--grain), linear-gradient(180deg, var(--sheet-hi), var(--sheet-lo));
  box-shadow: inset 0 0 0 1px rgb(var(--rgb-sheet-edge) / 0.6), 0 12px 26px rgba(0, 0, 0, 0.4);
}
.why h3 { font-size: 15px; font-weight: 600; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--sheet-dim); margin-bottom: 10px; padding-bottom: 5px; border-bottom: 2px solid rgb(var(--rgb-rule) / 0.7); }
.why ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.why li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.why li > .icon { color: var(--sheet-dim); }
.why li.warn { color: var(--sheet-warn); }
.why li.warn > .icon { color: var(--sheet-warn-icon); }
.why b { color: var(--sheet-fg); }
.why .tag { background: rgb(var(--rgb-sheet-ink) / 0.06); color: var(--sheet-dim); box-shadow: inset 0 0 0 1px rgb(var(--rgb-sheet-edge) / 0.7); }
.why .tag.match { background: var(--sheet-match-bg); color: var(--sheet-match-fg); box-shadow: inset 0 0 0 1px var(--sheet-match-edge); }
.similar { display: inline-flex; align-items: center; gap: 8px; color: var(--sheet-fg); }
.similar img, .similar .fallback-cover { width: 26px; height: 39px; object-fit: cover; border-radius: 2px; font-size: 3px; padding: 2px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }

.actions {
  position: sticky; bottom: 12px; z-index: 15;
  display: flex; align-items: stretch; gap: 10px; margin-top: 14px; padding: 10px;
  border-radius: var(--radius-lg); background: rgb(var(--rgb-wood-3) / 0.92); border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.actions .left { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.act { padding: 12px 16px; }
.act.on { box-shadow: inset 0 0 0 1px rgba(248, 239, 220, 0.6); }
.act-want.on {
  color: var(--want-fg);
  background: var(--grain), linear-gradient(180deg, var(--want-hi) 0%, var(--want-lo) 100%);
  box-shadow: inset 5px 0 0 var(--btn-ribbon), inset 0 0 0 1px var(--want-edge), 0 2px 0 rgba(0, 0, 0, 0.35);
}
.act-want.on .icon { animation: beat 0.45s var(--ease); }
@keyframes beat { 40% { transform: scale(1.35); } }
.act-pass.on { background: rgb(var(--rgb-oxblood) / 0.6); color: #f8e2dc; box-shadow: inset 0 0 0 1px rgb(var(--rgb-brick) / 0.6); }
.act-read.on { background: rgb(var(--rgb-brass) / 0.26); color: var(--text-bright); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brass) / 0.6); }
.next-btn {
  margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; min-width: 260px; max-width: 380px;
  border: 0; border-radius: 3px; cursor: pointer; text-align: left; color: var(--btn-fg);
  background: var(--grain), linear-gradient(180deg, var(--btn-hi) 0%, var(--btn-lo) 100%);
  box-shadow: inset 0 0 0 1px var(--btn-edge), inset 0 1px 0 var(--btn-gloss), 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.25);
  transition: filter 0.15s, transform 0.1s;
}
.next-btn:hover { filter: brightness(1.05); }
.next-btn:active { transform: translateY(1px); }
.next-btn .thumb { width: 28px; height: 42px; flex: none; border-radius: 1px 2px 2px 1px; overflow: hidden; background: rgb(var(--rgb-sheet-ink) / 0.2); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35); }
.next-btn .thumb > * { width: 100%; height: 100%; object-fit: cover; display: block; font-size: 4px; padding: 3px; }
.next-btn .lbl { display: grid; min-width: 0; flex: 1; }
.next-btn .lbl small { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; font-variant-caps: all-small-caps; color: var(--btn-dim); }
.next-btn .lbl span { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-btn > .icon { width: 22px; height: 22px; }
.back-btn { padding: 0 12px; }
.hints { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 12px; color: var(--text-faint); font-size: 12px; font-style: italic; }
.hints span { display: inline-flex; align-items: center; gap: 6px; }

/* Popovers are paper slips. */
.popover {
  position: absolute; z-index: 20; bottom: calc(100% + 10px); left: 0;
  width: 280px; padding: 12px; border-radius: 4px; color: var(--sheet-fg);
  background: var(--grain), linear-gradient(180deg, var(--sheet-hi), var(--sheet-lo));
  border: 1px solid var(--sheet-edge);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); animation: pop 0.18s var(--ease);
}
.popover h4 { margin: 0 0 8px; color: var(--sheet-fg); font: 600 16px/1.2 var(--font-display); }
.popover .opts { display: grid; gap: 4px; }
.popover .opts button {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 3px; border: 0;
  background: transparent; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--sheet-fg);
}
.popover .opts button:hover, .popover .opts button.sel { background: rgb(var(--rgb-sheet-ink) / 0.09); color: var(--sheet-fg); }
.popover a { color: var(--sheet-fg); text-decoration: underline; text-decoration-color: var(--sheet-edge); }
.popover .btn { color: var(--sheet-fg); background: rgb(var(--rgb-sheet-ink) / 0.06); box-shadow: inset 0 0 0 1px var(--sheet-edge); }
.popover .btn:hover { background: rgb(var(--rgb-sheet-ink) / 0.12); color: var(--sheet-fg); }
.tag-menu { position: fixed; bottom: auto; left: 0; top: 0; width: 230px; }

.customize { position: relative; }
.customize .popover { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; width: 320px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 4px; background: rgb(var(--rgb-sheet-ink) / 0.09); margin: 6px 0 14px; }
.seg button { padding: 7px 6px; border: 0; border-radius: 3px; background: transparent; color: var(--sheet-dim); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.seg button.sel { background: var(--sheet-fg); color: var(--sheet-hi); }
.seg-label { font-size: 15px; font-weight: 600; letter-spacing: 0.07em; font-variant-caps: all-small-caps; color: var(--sheet-dim); }
.seg-note { font-size: 12px; color: var(--sheet-faint); margin: -8px 0 12px; font-style: italic; }

.queue-loading { display: grid; place-items: center; gap: 14px; min-height: 480px; color: var(--text-dim); text-align: center; padding: 24px; font-style: italic; }
.queue-loading .spinner { width: 28px; height: 28px; border-width: 3px; }

/* end-of-queue summary */
.summary { padding: clamp(24px, 4vw, 48px); display: grid; gap: 22px; }
.summary h2 { font-size: clamp(28px, 3.4vw, 38px); }
.summary-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { padding: 12px 16px; border-radius: var(--radius); background: rgb(var(--rgb-wood) / 0.55); border: 1px solid var(--line); min-width: 130px; }
.stat b { display: block; color: var(--text-bright); font: 600 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-dim); font-size: 12.5px; }
.learned { display: grid; gap: 10px; }
.learned h3 { font-size: 16px; font-weight: 500; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--text-dim); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 2px; font-size: 12.5px; }
.delta.up { background: rgb(var(--rgb-sage) / 0.14); color: var(--match-fg); box-shadow: inset 0 0 0 1px rgb(var(--rgb-sage) / 0.35); }
.delta.down { background: rgb(var(--rgb-oxblood) / 0.32); color: var(--warn-fg); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brick) / 0.3); }
.summary-covers { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-covers > * { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 3px 3px 2px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); font-size: 6px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- wishlist ---------- */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.list-head h1 { font-size: clamp(28px, 3.4vw, 38px); margin-top: 6px; }
.list-head .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.wish {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s;
}
.wish:hover { border-color: var(--line-strong); background: rgb(var(--rgb-wood-4) / 0.9); }
.wish { position: relative; }
.wish h3 { padding-right: 28px; }
.wish-remove { position: absolute; top: 8px; right: 8px; padding: 6px; opacity: 0.55; }
.wish:hover .wish-remove, .wish-remove:focus-visible { opacity: 1; }
.wish .cv > * { width: 84px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 3px 3px 2px; display: block; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); font-size: 8px; }
.wish h3 { font-family: var(--font-book); font-size: 19px; font-weight: 600; line-height: 1.2; }
.wish .by { color: var(--text-dim); font-size: 13px; margin: 2px 0 8px; }
.wish .why-line { font-size: 12.5px; color: var(--text-faint); font-style: italic; }
.wish .row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty .icon { width: 40px; height: 40px; color: var(--text-faint); margin-bottom: 10px; }

/* ---------- profile ---------- */
.profile-head { display: grid; gap: 10px; margin-bottom: 26px; }
.profile-head h1 { font-size: clamp(30px, 3.8vw, 42px); }
.summary-text { font-family: var(--font-book); font-size: clamp(18px, 1.9vw, 21px); line-height: 1.55; color: var(--text); max-width: 72ch; margin: 0; }
.summary-text b { color: var(--text-bright); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.kpi { padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.kpi b { display: block; color: var(--text-bright); font: 600 28px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--text-dim); font-size: 12.5px; }
.pgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.pcard { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); min-width: 0; box-shadow: inset 0 1px 0 rgb(var(--rgb-tint) / 0.04); }
.pcard h2 { font-size: 17px; font-weight: 600; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--text-dim); margin-bottom: 4px; }
.pcard .sub { color: var(--text-faint); font-size: 12.5px; margin: 0 0 14px; font-style: italic; }
.span-12 { grid-column: span 12; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-8 { grid-column: span 8; }

.facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.facet { padding: 14px; border-radius: var(--radius); background: rgb(var(--rgb-wood-2) / 0.4); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.facet-covers { display: flex; }
.facet-covers > * { width: 38px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 1px 2px 2px 1px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55); margin-right: -10px; border: 1px solid rgba(0, 0, 0, 0.5); font-size: 4px; padding: 3px; }
.facet-name { color: var(--text-bright); font: 600 17px/1.25 var(--font-display); }
.facet-meta { color: var(--text-dim); font-size: 12.5px; }
.share { height: 4px; border-radius: 2px; background: rgb(var(--rgb-tint) / 0.08); overflow: hidden; }
.share > i { display: block; height: 100%; background: var(--accent); }

.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 36%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .lbl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { height: 8px; border-radius: 2px; background: rgb(var(--rgb-tint) / 0.06); position: relative; overflow: hidden; }
.bar-row .track > i { position: absolute; left: 0; top: 0; bottom: 0; }
.bar-row .ctl { display: flex; gap: 2px; opacity: 0.35; transition: opacity 0.15s; }
.bar-row:hover .ctl, .bar-row .ctl:focus-within { opacity: 1; }
.ctl button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; }
.ctl button:hover { background: var(--panel-soft); color: var(--text-bright); }
.ctl button.sel { background: rgb(var(--rgb-sage) / 0.16); color: var(--green); }
.ctl button.sel.neg { background: rgb(var(--rgb-oxblood) / 0.35); color: var(--red); }
.ctl .icon { width: 14px; height: 14px; }
.bar-row.pref-more .lbl { color: var(--match-fg); }
.bar-row.pref-less .lbl, .bar-row.pref-ban .lbl { color: var(--text-faint); text-decoration: line-through; }

.hist { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 6px; }
.hist .col { flex: 1; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; outline-offset: 1px; }
.hist .col i { width: 100%; min-height: 2px; opacity: 0.9; transition: opacity 0.15s; }
.hist .col:hover i { opacity: 1; }
.hist-axis { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 11.5px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.patterns { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; }
.patterns li { display: flex; gap: 10px; align-items: flex-start; }
.patterns li .icon { color: var(--accent); margin-top: 3px; }
.add-theme { display: flex; gap: 8px; margin-top: 14px; }
.add-theme input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 3px; border: 1px solid var(--line-strong); background: rgb(var(--rgb-wood-2) / 0.5);
  color: var(--text-bright); font: inherit; font-size: 14px;
}
.add-theme input:focus { outline: none; border-color: var(--accent); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- charts (profile) ---------- */
/* Validated with dataviz/validate_palette.js against the dark surface (#1c140e): all checks pass. */
:root { --chart-pos: #bb8b3a; --chart-neg: #a45a7c; }
.bar-row .track > i { background: var(--chart-pos); border-radius: 0 4px 4px 0; }
.bar-row .track > i.neg { background: var(--chart-neg); }
.bar-row .track:hover > i, .bar-row .track:focus-visible > i { filter: brightness(1.2); }
.hist .col i { background: var(--chart-pos); border-radius: 4px 4px 0 0; }
.hist .col:hover i, .hist .col:focus-visible i { filter: brightness(1.25); }
.chart-tip {
  position: fixed; z-index: 70; pointer-events: none; display: grid; gap: 1px;
  padding: 7px 10px; border-radius: 3px; background: var(--sheet-lo); border: 1px solid var(--sheet-edge);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55); font-size: 12px; color: var(--sheet-dim); white-space: nowrap;
}
.chart-tip b { color: var(--sheet-fg); font-size: 13px; }
.rate-btn.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--text-bright); }

/* ---------- AI assist ---------- */
.ai-card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-card h2 .icon, .kicker.ai, .ai-why > .icon { color: var(--plum); }
.why li.ai-why > .icon { color: var(--sheet-ai); }
.ai-card code { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-variant-caps: normal; color: var(--text); background: rgb(var(--rgb-tint) / 0.08); padding: 1px 6px; border-radius: 3px; }
.ai-pitch { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ai-pitch > div { flex: 1; min-width: 260px; }
.pill { font: 600 12px/1.4 var(--font-ui); letter-spacing: 0.04em; font-variant-caps: normal; padding: 1px 8px; border-radius: 10px; background: rgba(195, 174, 230, 0.14); color: #dccbf5; }
.ai-form { display: grid; gap: 14px; max-width: 720px; }
.ai-form label { display: grid; gap: 6px; font-size: 13px; color: var(--text-dim); }
.ai-form label > span:first-child { font-weight: 600; color: var(--text); }
.ai-form .row { display: flex; gap: 8px; }
.ai-form input[type="text"], .ai-form input:not([type]), .ai-form input[type="password"], .ai-form select {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 3px; border: 1px solid var(--line-strong);
  background: rgb(var(--rgb-wood-2) / 0.5); color: var(--text-bright); font: inherit; font-size: 14px;
}
.ai-form select { appearance: auto; }
.ai-form input:focus, .ai-form select:focus { outline: none; border-color: var(--accent); }
.ai-form label.check { display: flex; align-items: center; gap: 8px; }
.ai-form input[type="checkbox"] { accent-color: var(--accent); }
.ai-privacy { display: flex; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text-faint); font-style: italic; }
.ai-privacy .icon { flex: none; margin-top: 2px; }
.ai-error { margin: 0; color: var(--warn-fg); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ai-profile { margin: 4px 0 14px; display: grid; gap: 10px; }
.ai-profile h3 { font-size: 16px; font-weight: 500; letter-spacing: 0.08em; font-variant-caps: all-small-caps; color: var(--text-dim); }
.ai-profile .summary-text { font-size: 17px; }
.why li.ai-why { font-size: 14px; flex-wrap: nowrap; align-items: flex-start; }
.why li.ai-why > .icon { margin-top: 3px; }
.why li.ai-why b { color: var(--sheet-fg); font-weight: 700; }
.customize #ai-now { margin-top: -4px; }
.ai-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); font-size: 14px; color: var(--text-dim); }
.ai-nudge > .icon { color: var(--plum); }
.ai-nudge > div:first-of-type { flex: 1; min-width: 240px; }
.ai-nudge b { color: var(--text-bright); }

/* ---------- taste twins (Flicks) ---------- */
.twins-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 28px; }
.twins-helper { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin: 0 0 12px; border-radius: var(--radius); background: rgb(var(--rgb-oxblood) / 0.25); border: 1px solid rgb(var(--rgb-brick) / 0.35); font-size: 13.5px; }
.twins-helper .icon { flex: none; margin-top: 2px; color: var(--red); }
.twin-favs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.twin-fav { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.twin-fav > img, .twin-fav > .fallback-cover { width: 28px; height: 42px; object-fit: cover; border-radius: 2px; font-size: 4px; padding: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.twin-searches { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.twin-searches li { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); }
.ts-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ts-films { flex: 1; min-width: 180px; font-size: 13.5px; color: var(--text); }
.ts-alt { font-size: 12px; }
.ts-add { display: flex; gap: 6px; }
.ts-add input { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 3px; border: 1px solid var(--line-strong); background: rgb(var(--rgb-wood-2) / 0.5); color: var(--text-bright); font: inherit; font-size: 13px; }
.ts-add input:focus { outline: none; border-color: var(--accent); }
#twin-add-any { margin-top: 12px; }
.twin-weight { display: block; width: 80px; height: 6px; margin-top: 7px; border-radius: 3px; background: rgb(var(--rgb-tint) / 0.08); overflow: hidden; }
.twin-weight > i { display: block; height: 100%; background: var(--accent); }
.twin-table a { color: var(--text-bright); }
@media (max-width: 860px) { .twins-grid { grid-template-columns: 1fr; } }

/* ---------- How it works ---------- */
.how-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.how-mark { display: block; flex: none; width: 52px; height: 52px; }
.how-mark svg { display: block; width: 100%; height: 100%; }
.how-head h1 { font-size: clamp(28px, 3.6vw, 40px); margin-top: 4px; }
.how-intro { margin: 0 0 24px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.how-steps li { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); }
.how-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 600 14px/1 var(--font-display); box-shadow: inset 0 0 0 1px rgb(var(--rgb-brass) / 0.4);
}
.how-steps h3 { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 3px 0 6px; }
.how-steps h3 .icon { color: var(--accent); }
.how-steps p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.55; }
.how-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 8px 24px; }
.how-cols p { margin: 0 0 10px; color: var(--text-dim); font-size: 14px; }
.how-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 14px; }
.how-status .icon, .how-connect .icon, .how-privacy .icon { color: var(--accent); }
.how-connect { display: grid; gap: 10px; padding: 14px 16px; margin-bottom: 8px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); }
.how-connect p { margin: 0; font-size: 14px; }
.how-h3 { font-size: 15px; margin: 22px 0 10px; }
.how-mini { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-dim); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.model-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.model-table th { text-align: left; font-weight: 600; color: var(--text-faint); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.model-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.model-table .num { text-align: right; white-space: nowrap; }
.model-table code { font-size: 12.5px; color: var(--text-bright); background: rgb(var(--rgb-tint) / 0.08); padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.model-table tr.current td { background: var(--accent-soft); }
.model-table .tier { font-weight: 600; color: var(--text); white-space: nowrap; }
.why-cell { margin-top: 5px; color: var(--text-dim); font-size: 12.5px; }
.spinner.inline { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
.how-privacy { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--text-dim); }
.how-privacy li { display: flex; gap: 8px; align-items: flex-start; }
.how-privacy .icon { margin-top: 3px; }

/* ---------- responsive ---------- */
/* Four tabs plus the Stacks | Flicks switch: drop the long words before they collide. */
@media (max-width: 1060px) {
  .tabs .long { display: none; }
}
@media (max-width: 1000px) {
  .span-7, .span-5, .span-6, .span-4, .span-8 { grid-column: span 12; }
  .calib-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .card { grid-template-columns: 1fr; }
  .cover-col { width: min(240px, 62vw); justify-self: center; }
  .backdrop::after { background: linear-gradient(180deg, rgb(var(--rgb-wood) / 0.35) 0%, rgb(var(--rgb-wood) / 0.86) 38%, rgb(var(--rgb-wood) / 0.94) 100%); }
  .card-host { min-height: 0; }
  .book-title { text-align: left; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { gap: 10px; height: 52px; }
  .topbar .mode-switch span { display: none; }
  .topbar .mode-switch button { padding: 6px 8px; }
  .brand-name { display: none; }
  .tabs a { padding: 0 9px; font-size: 15px; letter-spacing: 0.04em; }
  .status span { display: none; }
  .tabs .long { display: none; }
  .cover-col { width: min(180px, 48vw); }
  .cover-links { flex-wrap: nowrap; justify-content: center; margin-inline: -40px; }
  .cover-links a { padding: 5px 8px; font-size: 12px; }
  .card { gap: 18px; }
  .q-head { gap: 8px; margin-bottom: 12px; }
  .q-title p { display: none; }
  #customize { padding: 6px; font-size: 0; gap: 0; }
  #customize .icon { font-size: 15px; }
  .howto { grid-template-columns: 1fr; }
  .queue { padding-top: 14px; padding-bottom: 120px; }
  .q-dots i { width: 12px; }
  .actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0; border-radius: 0; flex-wrap: wrap;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgb(var(--rgb-wood-3) / 0.97);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-width: 1px 0 0;
  }
  .actions .left { flex: 1; flex-wrap: nowrap; }
  .actions .left .act { flex: 1; padding: 10px 8px; font-size: 13px; }
  .act .lbl-long { display: none; }
  .next-btn { min-width: 0; max-width: none; width: 100%; margin-left: 0; order: 3; }
  .back-btn { display: none; }
  .hints { display: none; }
  .calib-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 20px; }
  .calib-cover { width: 150px; }
  .rate-row { grid-template-columns: 1fr 1fr; width: 100%; }
  .rate-btn kbd { display: none; }
  #toasts { bottom: 150px; }
  .popover { width: min(280px, calc(100vw - 24px)); }
  .customize .popover { position: fixed; top: 60px; right: 12px; }
  .model-table.rec th:first-child, .model-table.rec td:first-child { display: none; }
  .how-head { align-items: flex-start; }
}
@media (hover: none) {
  .bar-row .ctl { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================================
   Flicks: the films mode, dressed as a screening room. Charcoal and velvet, a faint
   forest-green light from the projector, poster-serif titles and plain Inter labels.
   Everything above is shared; this block only redefines tokens and a few treatments.
   ===================================================================================== */
:root[data-mode="films"] {
  --bg-0: #070908;
  --bg-1: #0b0d0c;
  --bg-2: #111513;
  --panel: rgba(19, 24, 22, 0.86);
  --panel-solid: #131816;
  --panel-soft: rgba(239, 233, 220, 0.035);
  --line: rgba(239, 233, 220, 0.09);
  --line-strong: rgba(239, 233, 220, 0.18);
  --text: #efe9dc;
  --text-dim: #b4ad9f;
  --text-faint: #7f7a6f;
  --text-bright: #fbf7ee;
  --accent: #2e9e62; /* forest green */
  --accent-deep: #174f32;
  --accent-soft: rgba(46, 158, 98, 0.14);
  --green: #5fc48e;
  --green-deep: #1f6b44;
  --gold: #d6bd74;
  --red: #e0806f;
  --oxblood: #6b2620;
  --tag-bg: rgba(239, 233, 220, 0.05);
  --tag-text: #d7d0c1;

  --paper: #efe9dc; /* off-white: active switch, bright titles */
  --paper-hi: #f7f3ea;
  --paper-lo: #ddd5c4;
  --paper-edge: #a9a08e;
  --ink: #0f1311;
  --ink-dim: #3c4540;
  --ink-faint: #6a716c;
  /* Neutral film grain instead of warm paper fibre. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --font-book: var(--font-display);
  --shadow-cover: 0 18px 44px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);

  --rgb-tint: 239 233 220;
  --rgb-brass: 46 158 98;
  --rgb-line: 239 233 220;
  --rgb-sheet-ink: 239 233 220; /* slips are dark here, so their tints are light */
  --rgb-sheet-edge: 90 104 97;
  --rgb-rule: 46 158 98;
  --rgb-wood: 10 13 12;
  --rgb-wood-2: 7 9 8;
  --rgb-wood-3: 14 18 16;
  --rgb-wood-4: 26 33 30;
  --rgb-sage: 95 196 142;
  --rgb-oxblood: 110 40 34;
  --rgb-brick: 224 128 111;
  --rgb-bar: 10 13 12;

  /* Primary buttons: forest-green fill, off-white text. */
  --btn-hi: #33a76a;
  --btn-lo: #268753;
  --btn-edge: #174f32;
  --btn-fg: #f7f3ea;
  --btn-dim: rgba(247, 243, 234, 0.72);
  --btn-hover-hi: #3bb674;
  --btn-hover-lo: #2b955d;
  --btn-gloss: rgba(255, 255, 255, 0.16);
  --btn-gloss-hover: rgba(255, 255, 255, 0.22);
  --btn-ribbon: #0f3d26;
  --btn-icon: #f7f3ea;
  /* Slips (toasts, popovers, the "why" card): charcoal with off-white text. */
  --sheet-hi: #1d2521;
  --sheet-lo: #161c19;
  --sheet-edge: #2f3a34;
  --sheet-fg: #efe9dc;
  --sheet-dim: #b4ad9f;
  --sheet-faint: #827c71;
  --sheet-warn: #ef9d8f;
  --sheet-warn-icon: #e0806f;
  --sheet-ai: #c8b3ec;
  --sheet-match-bg: rgba(46, 158, 98, 0.18);
  --sheet-match-fg: #bfe6cf;
  --sheet-match-edge: rgba(46, 158, 98, 0.5);
  /* Match score: an off-white ticket stub. */
  --badge-hi: #f7f3ea;
  --badge-lo: #e8e1d1;
  --badge-edge: #b7ae9b;
  --badge-fg: #111513;
  --badge-dim: #4c5550;
  --badge-accent: #1f6b44;
  --want-hi: #2f9e63;
  --want-lo: #237f4e;
  --want-edge: #174f32;
  --want-fg: #f7f3ea;
  --stage-bg: #0a0d0c;
  --cover-bg: #151a18;
  --match-fg: #bfe6cf;
  --warn-fg: #f2b3a7;
  --explore-fg: #9fd3b6;
  --chart-pos: #46a874;
  --chart-neg: #b3627f;
}

/* Velvet vignette with the projector's green spill at the top. */
[data-mode="films"] body::before {
  background: radial-gradient(1000px 560px at 50% -14%, rgba(46, 158, 98, 0.14) 0%, transparent 62%),
    radial-gradient(140% 110% at 50% 35%, transparent 52%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 420px, var(--bg-0) 100%);
}
[data-mode="films"] body::after { opacity: 0.22; }

/* The poster serif has a single weight. */
[data-mode="films"] :is(h1, h2, h3, .book-title, .facet-name, .stat b, .kpi b, .next-btn .lbl span, .drop strong, .key-head b,
  .popover h4, .calib-info h2, .wish h3, .landing-hero h1, .q-title h1, .match-badge, .fallback-cover .fc-title) { font-weight: 400; }

/* Small-caps labels become tracked uppercase Inter. */
[data-mode="films"] :is(.eyebrow, .tabs a, .mode-switch button, .pcard h2, .why h3, .learning h3, .learned h3, .seg-label,
  .ai-profile h3, .next-btn .lbl small, .match-badge small, .badge, .fallback-cover .fc-author) {
  font-family: var(--font-ui); font-variant-caps: normal; text-transform: uppercase; font-weight: 600;
}
[data-mode="films"] .eyebrow { font-size: 11.5px; letter-spacing: 0.18em; }
[data-mode="films"] .tabs a { font-size: 12px; letter-spacing: 0.12em; }
[data-mode="films"] .mode-switch button { font-size: 11.5px; letter-spacing: 0.1em; }
[data-mode="films"] :is(.pcard h2, .why h3, .learning h3, .learned h3, .ai-profile h3) { font-size: 11.5px; letter-spacing: 0.14em; }
[data-mode="films"] .seg-label { font-size: 11px; letter-spacing: 0.12em; }
[data-mode="films"] :is(.next-btn .lbl small, .match-badge small, .badge) { font-size: 10.5px; letter-spacing: 0.12em; }
[data-mode="films"] .brand-name { letter-spacing: 0.24em; }
/* The display serif is for titles; running text stays in Inter. */
[data-mode="films"] .summary-text { font-family: var(--font-ui); font-size: clamp(16px, 1.5vw, 18px); line-height: 1.65; }
[data-mode="films"] .ai-profile .summary-text { font-size: 15.5px; }
[data-mode="films"] .why h3 { border-bottom-width: 1px; }

/* No poster: a one-sheet placeholder instead of a clothbound spine. */
[data-mode="films"] .fallback-cover {
  justify-content: flex-end; gap: 6px; padding: 12% 10%;
  background: var(--grain), radial-gradient(120% 80% at 50% 0%, rgba(46, 158, 98, 0.22), transparent 60%), linear-gradient(180deg, #1a211e 0%, #0c0f0e 100%);
  color: var(--text-bright); text-shadow: none; box-shadow: inset 0 0 0 1px rgba(239, 233, 220, 0.08);
}
[data-mode="films"] .fallback-cover .fc-author { font-size: 0.62em; letter-spacing: 0.14em; opacity: 0.7; }

/* Posters have no spine: just a soft sheen. */
[data-mode="films"] .cover-wrap > img, [data-mode="films"] .cover-wrap > .fallback-cover { border-radius: 4px; }
[data-mode="films"] .cover-wrap::after {
  border-radius: 4px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.07) 0%, transparent 34%, transparent 72%, rgba(0, 0, 0, 0.22) 100%);
}
[data-mode="films"] .backdrop .bd { filter: blur(46px) saturate(1.05) brightness(0.42); }

/* Phones: Flicks' uppercase tabs run wider than Stacks' small caps, so tighten them. */
@media (max-width: 720px) {
  [data-mode="films"] .tabs a { padding: 0 7px; font-size: 11px; letter-spacing: 0.05em; }
}
@media (max-width: 400px) {
  .tabs a { padding: 0 6px; }
  .topbar .mode-switch button { padding: 5px 6px; }
}
