/* چی بخونم؟ — night library. One theme, tuned for reading at night. */

@font-face { font-family: 'Vazirmatn'; src: url('../assets/fonts/Vazirmatn-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Aref Ruqaa'; src: url('../assets/fonts/ArefRuqaa-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Aref Ruqaa'; src: url('../assets/fonts/ArefRuqaa-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink-950: #0a1020;
  --ink-900: #0d1426;
  --ink-850: #111a30;
  --ink-800: #152038;
  --ink-700: #1d2a47;
  --ink-600: #2a3a5c;
  --parchment: #f1e7d2;
  --parchment-2: #d8ccb2;
  --parchment-3: #a99d85;
  --line: rgb(216 204 178 / 0.16);
  --line-strong: rgb(216 204 178 / 0.32);
  --saffron: #eaa846;
  --saffron-hi: #f4bd66;
  --saffron-ink: #2a1a04;
  --vermilion: #e2735f;
  --jade: #7cc4b0;
  --moon: #f6dfae;

  --font: 'Vazirmatn', Tahoma, sans-serif;
  --display: 'Aref Ruqaa', 'Vazirmatn', serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --veil: 0;
  --drift: 0px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  font: 400 16px/1.75 var(--font);
  color: var(--parchment);
  background: var(--ink-900);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01';
}
::selection { background: var(--saffron); color: var(--saffron-ink); }
:focus-visible { outline: 2px solid var(--saffron-hi); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--saffron-hi); text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
a:hover { color: var(--moon); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
.muted { color: var(--parchment-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--saffron); color: var(--saffron-ink); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
* { scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 10px; border: 2px solid var(--ink-900); }

/* ---------- Backdrop painting ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--ink-950); }
.backdrop picture, .backdrop img { width: 100%; height: 100%; }
.backdrop img {
  object-fit: cover; object-position: 50% 30%;
  transform: translate3d(0, var(--drift), 0) scale(1.06);
  transform-origin: 50% 0;
  animation: settle 2.4s var(--ease) both;
}
.backdrop::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgb(10 16 32 / 0.25) 0%, rgb(10 16 32 / 0.55) 45%, rgb(10 16 32 / 0.92) 80%),
    rgb(10 16 32 / calc(0.25 + var(--veil) * 0.6));
}
@keyframes settle { from { transform: scale(1.12); filter: brightness(0.6); } to { transform: translate3d(0, var(--drift), 0) scale(1.06); filter: none; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter);
  background: rgb(10 16 32 / 0.78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(241 231 210 / 0.08);
}
.brand { display: flex; align-items: baseline; gap: 12px; color: var(--parchment); text-decoration: none; }
.brand__name { font-size: 1.75rem; line-height: 1; color: var(--moon); }
.brand__by { font-size: 0.85rem; color: var(--parchment-2); }
.brand__by span { color: var(--parchment); font-weight: 600; }
.topbar__shelf .count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--saffron); color: var(--saffron-ink); font-size: 0.8rem; font-weight: 700;
  display: inline-grid; place-items: center;
}

main { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 14vh, 140px) 0 24px; max-width: 760px; }
.hero__title {
  font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1.25; margin: 0 0 12px;
  color: var(--moon);
  text-shadow: 0 2px 24px rgb(10 16 32 / 0.8);
  text-wrap: balance;
}
.hero__lead { font-size: 1.08rem; color: var(--parchment); margin: 0 0 28px; max-width: 58ch; text-shadow: 0 1px 12px rgb(10 16 32 / 0.9); }

.ask-box {
  background: rgb(17 26 48 / 0.94);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 8px 16px;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.7);
}
.modes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 4px 12px; }
.modes__tab {
  background: none; border: 0; border-radius: var(--r-sm);
  padding: 8px 14px; min-height: 44px; color: var(--parchment-2); font-weight: 500;
}
.modes__tab[aria-selected='true'] { background: var(--ink-700); color: var(--parchment); }
.modes__tab:hover { color: var(--parchment); }
.modes__surprise {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 14px; min-height: 44px; color: var(--moon);
}
.modes__surprise:hover { border-style: solid; border-color: var(--moon); }

.composer { display: flex; gap: 8px; align-items: stretch; padding: 0 8px; }
.composer textarea {
  flex: 1; resize: none; min-height: 64px; max-height: 180px;
  background: var(--ink-950); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 14px 16px; font-size: 1.08rem; line-height: 1.7; color: var(--parchment);
  caret-color: var(--saffron);
  field-sizing: content;
}
.composer textarea::placeholder { color: var(--parchment-3); }
.composer textarea:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px rgb(234 168 70 / 0.18); }
.composer__go { align-self: stretch; min-width: 108px; font-size: 1.05rem; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 8px 0; }
.examples__lead { color: var(--parchment-3); font-size: 0.9rem; margin-inline-end: 4px; }
.example {
  background: none; border: 0; padding: 4px 0; color: var(--parchment-2); font-size: 0.92rem;
  border-bottom: 1px dotted var(--parchment-3); min-height: 32px;
}
.example:hover { color: var(--moon); border-bottom-color: var(--moon); }
.examples { column-gap: 16px; }

.like { position: relative; padding: 0 8px; }
.like input {
  width: 100%; background: var(--ink-950); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 14px 16px; font-size: 1.05rem; min-height: 56px;
}
.like input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px rgb(234 168 70 / 0.18); }
.like__options {
  position: absolute; inset-inline: 8px; top: 60px; z-index: 5; list-style: none; margin: 0; padding: 6px;
  background: var(--ink-800); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.7);
}
.like__options li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; }
.like__options li small { color: var(--parchment-3); }
.like__options li[aria-selected='true'], .like__options li:hover { background: var(--ink-700); }
.like__hint { color: var(--parchment-3); font-size: 0.88rem; margin: 10px 0 0; }
.like__chosen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; font-weight: 500; text-decoration: none; line-height: 1.3;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn--primary { background: var(--saffron); color: var(--saffron-ink); font-weight: 700; }
.btn--primary:hover { background: var(--saffron-hi); color: var(--saffron-ink); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--parchment); }
.btn--ghost:hover { border-color: var(--parchment-2); background: rgb(241 231 210 / 0.04); }
.btn--ghost.is-on { border-color: var(--jade); color: var(--jade); }
.btn--quiet { border-color: transparent; color: var(--parchment-3); }
.btn--quiet:hover { color: var(--vermilion); border-color: transparent; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--saffron-hi); text-decoration: underline; text-underline-offset: 0.3em; min-height: 32px; }
.link-btn:hover { color: var(--moon); }
.dialog-close {
  position: sticky; top: 0; float: left; margin: -4px -4px 0 0; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--ink-800); border: 1px solid var(--line); border-radius: 50%; color: var(--parchment);
}
.dialog-close:hover { border-color: var(--parchment-2); }

/* ---------- Understanding ---------- */
.understood { margin: 20px 0 0; min-height: 8px; }
.understood:empty { display: none; }
.understood__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 16px; background: rgb(17 26 48 / 0.9); border: 1px solid var(--line); border-radius: var(--r-md);
}
.understood__lead { color: var(--parchment-2); font-size: 0.92rem; margin-inline-end: 4px; }
.understood__miss { padding: 14px 16px; background: rgb(17 26 48 / 0.9); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--parchment-2); margin: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 4px 6px 4px 12px; padding-inline: 12px 6px;
  border-radius: 999px; background: var(--ink-700); border: 1px solid var(--line); font-size: 0.92rem;
}
.tag--avoid { color: var(--vermilion); border-color: rgb(226 115 95 / 0.4); background: rgb(226 115 95 / 0.08); }
.tag--state { padding-inline: 12px; background: rgb(124 196 176 / 0.1); border-color: rgb(124 196 176 / 0.35); color: var(--jade); }
.tag__x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: inherit; opacity: 0.75; }
.tag__x:hover { opacity: 1; background: rgb(241 231 210 / 0.08); }
.tag--link { padding-inline: 12px; color: var(--parchment-2); cursor: pointer; }
.tag--link:hover { color: var(--parchment); border-color: var(--line-strong); }
.ask {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px;
  padding: 12px 16px; border-radius: var(--r-md); border: 1px solid rgb(124 196 176 / 0.3); background: rgb(13 20 38 / 0.92);
}
.ask__opts { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Picker ---------- */
.picker { margin-top: 16px; background: rgb(17 26 48 / 0.92); border: 1px solid var(--line); border-radius: var(--r-md); }
.picker > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; min-height: 52px; font-weight: 600;
}
.picker > summary::-webkit-details-marker { display: none; }
.picker > summary::before {
  content: ''; width: 8px; height: 8px; border: solid var(--parchment-2); border-width: 0 0 2px 2px;
  transform: rotate(45deg); transition: transform 0.25s var(--ease); align-self: center; margin-inline-end: 4px;
}
.picker[open] > summary::before { transform: rotate(-45deg); }
.picker > summary small { font-weight: 400; color: var(--parchment-3); }
#picker-count { color: var(--saffron-hi); }
.picker__body { padding: 0 16px 20px; display: grid; gap: 20px; }
.pick-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.pick-group legend, .segment legend { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 6px; color: var(--parchment); }
.pick-hint { margin: -2px 0 10px; font-size: 0.85rem; color: var(--parchment-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--parchment-2);
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.chip:hover { color: var(--parchment); border-color: var(--parchment-2); }
.chip[data-state='want'] { background: var(--saffron); border-color: var(--saffron); color: var(--saffron-ink); font-weight: 600; }
.chip[data-state='avoid'] { border-color: rgb(226 115 95 / 0.55); color: var(--vermilion); background: rgb(226 115 95 / 0.08); }
.chip[data-state='avoid'] .chip__text { text-decoration: line-through; text-decoration-thickness: 1px; }
.chip__count { font-size: 0.78rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.chip--more { border-style: dashed; }
.chip--warn[data-state='avoid'] .chip__text { text-decoration: none; }
.segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; }
.segment { border: 0; padding: 0; margin: 0; min-width: 0; }
.segment__opts { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: var(--r-sm); background: var(--ink-950); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.segment__opt {
  background: none; border: 0; border-radius: 6px; padding: 6px 12px; min-height: 38px;
  color: var(--parchment-2); font-size: 0.92rem;
}
.segment__opt:hover { color: var(--parchment); }
.segment__opt[aria-checked='true'] { background: var(--ink-600); color: var(--parchment); font-weight: 600; }
.ask .segment__opt[aria-checked='true'] { background: var(--jade); color: #0b2a22; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--parchment-2); }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--ink-600); position: relative; flex: none; cursor: pointer; transition: background-color 0.2s; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--parchment-2); transition: inset-inline-start 0.2s var(--ease); }
.switch input:checked { background: var(--saffron); }
.switch input:checked::after { inset-inline-start: 21px; background: var(--saffron-ink); }

/* ---------- Results ---------- */
.results { margin: 40px 0 0; padding-bottom: 32px; }
.results__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.results__title { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0; line-height: 1.3; color: var(--moon); }
.results__sub { margin: 4px 0 0; color: var(--parchment-2); }
.results__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { padding: 12px 16px; border-radius: var(--r-md); background: rgb(234 168 70 / 0.08); border: 1px solid rgb(234 168 70 / 0.3); color: var(--parchment); margin: 0 0 20px; }

.fit { display: inline-block; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.fit--strong { color: var(--jade); }
.fit--good { color: var(--saffron-hi); }
.fit--loose { color: var(--parchment-3); }

.top {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: clamp(20px, 4vw, 48px);
  padding: clamp(20px, 3vw, 32px); margin-bottom: 24px;
  background: linear-gradient(135deg, rgb(29 42 71 / 0.96), rgb(17 26 48 / 0.96));
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
}
.top__cover, .card__cover, .blind__cover { border: 0; padding: 0; background: none; display: block; width: 100%; }
.top__title { font-size: clamp(2rem, 4vw, 2.9rem); margin: 0 0 4px; line-height: 1.35; color: var(--moon); text-wrap: balance; }
.top__body { min-width: 0; }
.top__summary { margin: 12px 0 0; color: var(--parchment-2); max-width: 64ch; }
.top__summary .summary { margin: 0; }
.top__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.quote {
  margin: 16px 0 0; padding: 0; font-family: var(--display); font-size: 1.3rem; line-height: 1.8;
  color: var(--parchment); max-width: 56ch;
}
.quote::before { content: '«'; color: var(--saffron); margin-inline-end: 2px; }
.quote::after { content: '»'; color: var(--saffron); margin-inline-start: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.card {
  display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 16px;
  background: rgb(17 26 48 / 0.94); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--line-strong); }
.card__body { min-width: 0; display: flex; flex-direction: column; }
.card__title { margin: 0; font-size: 1.12rem; line-height: 1.5; font-weight: 700; }
.card__title button { all: unset; cursor: pointer; }
.card__title button:hover { color: var(--moon); }
.card__title button:focus-visible { outline: 2px solid var(--saffron-hi); outline-offset: 2px; border-radius: 4px; }
.card__people { margin: 2px 0 0; color: var(--parchment-2); font-size: 0.92rem; }
.card__meta { margin: 2px 0 0; color: var(--parchment-3); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.why { margin: 8px 0 0; font-size: 0.88rem; display: grid; gap: 2px; }
.why__plus { color: var(--parchment); }
.why__minus { color: var(--parchment-3); }
.why__minus::before { content: 'ولی: '; }
.shelf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.shelf-actions--compact .btn { min-height: 38px; padding: 4px 10px; font-size: 0.86rem; gap: 6px; }
.more { display: flex; justify-content: center; margin-top: 24px; }

/* ---------- Covers ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; width: 100%; overflow: hidden; border-radius: 4px 8px 8px 4px;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset, -3px 0 0 rgb(0 0 0 / 0.25) inset, 0 10px 24px -10px rgb(0 0 0 / 0.75);
}
.cover__gen {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 14% 12%; text-align: center;
  background-image: linear-gradient(transparent 0 0), radial-gradient(circle at 50% 120%, rgb(246 223 174 / 0.22), transparent 60%);
}
.cover__gen::before { content: ''; position: absolute; inset: 6%; border: 1px solid rgb(246 223 174 / 0.28); border-radius: 2px; pointer-events: none; }
.cover__title { font-family: var(--display); font-weight: 700; color: var(--moon); font-size: clamp(0.95rem, 1.6vw, 1.35rem); line-height: 1.5; text-wrap: balance; }
.cover--sm .cover__title { font-size: 0.72rem; }
.cover--lg .cover__title { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.cover__author { font-size: 0.72rem; color: rgb(241 231 210 / 0.75); }
.cover--sm .cover__author { display: none; }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.cover__img.is-loaded { opacity: 1; }

/* ---------- Skeleton ---------- */
.skeleton { display: grid; gap: 10px; padding: 4px 0; }
.skeleton span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--ink-700), var(--ink-600), var(--ink-700)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton span:nth-child(2) { width: 92%; } .skeleton span:nth-child(3) { width: 78%; } .skeleton span:nth-child(4) { width: 60%; }
.skeleton--results span { height: 140px; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 48px 16px; background: rgb(17 26 48 / 0.94); border: 1px solid var(--line); border-radius: var(--r-lg); }
.empty h2 { font-size: 1.9rem; margin: 0 0 8px; color: var(--moon); }
.empty p { color: var(--parchment-2); margin: 0; }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }

/* ---------- Dialogs ---------- */
dialog { color: inherit; }
.sheet {
  width: min(100% - 24px, 980px); max-height: min(92vh, 980px); padding: 0; margin: auto;
  background: var(--ink-850); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: 0 40px 100px -20px rgb(0 0 0 / 0.8);
  overflow: hidden;
}
.sheet--narrow { width: min(100% - 24px, 640px); }
.sheet::backdrop { background: rgb(6 10 20 / 0.72); backdrop-filter: blur(3px); }
.sheet[open] { animation: rise 0.42s var(--ease); }
.sheet[open]::backdrop { animation: fade 0.3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }
.sheet__scroll { max-height: inherit; overflow: auto; padding: clamp(20px, 3vw, 36px); overscroll-behavior: contain; }
.sheet__heading { font-size: 2rem; margin: 0 0 8px; color: var(--moon); }
.sheet__grid { display: grid; grid-template-columns: 240px 1fr; gap: clamp(20px, 3vw, 40px); }
.sheet__side { display: grid; gap: 16px; align-content: start; }
.sheet__side .shelf-actions { padding-top: 0; }
.sheet__side .shelf-actions .btn { flex: 1 1 100%; justify-content: flex-start; }
.sheet__title { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; line-height: 1.35; color: var(--moon); padding-inline-end: 48px; text-wrap: balance; }
.sheet__en { margin: 0; color: var(--parchment-3); font-size: 0.92rem; text-align: right; }
.sheet__main { min-width: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 20px 0 0; padding: 16px 0; border-block: 1px solid var(--line); }
.facts dt { font-size: 0.82rem; color: var(--parchment-3); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.facts small { display: block; color: var(--parchment-3); font-size: 0.82rem; }
.why--sheet { margin-top: 16px; font-size: 0.95rem; }
.sheet__summary { margin-top: 20px; max-width: 68ch; }
.summary p { margin: 0 0 10px; }
.summary[dir='ltr'] { font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; line-height: 1.6; }
.summary__foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 0; font-size: 0.88rem; }
.tagline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sheet__line { margin: 16px 0 0; color: var(--parchment-2); font-size: 0.95rem; }
.sheet__line strong { color: var(--parchment); font-weight: 600; }
.warn { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 14px; }
.warn summary { cursor: pointer; padding: 10px 0; color: var(--parchment-2); display: flex; align-items: center; gap: 8px; min-height: 44px; }
.warn p { margin: 0 0 12px; }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.similar { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.similar h3 { margin: 0 0 16px; font-size: 1.1rem; }
.similar__row { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.mini { border: 0; background: none; padding: 0; text-align: start; display: grid; gap: 8px; font-size: 0.86rem; color: var(--parchment-2); }
.mini:hover { color: var(--parchment); }

/* Shelf */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--ink-950); border: 1px solid var(--line); border-radius: var(--r-sm); width: fit-content; margin: 16px 0; }
.tabs__tab { background: none; border: 0; padding: 8px 14px; border-radius: 6px; color: var(--parchment-2); min-height: 40px; }
.tabs__tab[aria-selected='true'] { background: var(--ink-600); color: var(--parchment); }
.shelf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shelf-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); }
.shelf-list__book { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: start; min-width: 0; }
.shelf-list__book .cover { width: 48px; flex: none; }
.shelf-list__book span { display: grid; min-width: 0; }
.shelf-list__book small { color: var(--parchment-3); }
.shelf-empty { padding: 16px 0; }
.shelf-settings { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.shelf-settings label { display: grid; gap: 6px; color: var(--parchment-2); font-size: 0.92rem; }
.shelf-settings select { background: var(--ink-950); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; color: var(--parchment); max-width: 320px; }
.shelf-io { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf-io label.btn { display: inline-flex; cursor: pointer; color: var(--parchment); }

/* Surprise */
.blind { display: grid; grid-template-columns: 160px 1fr; gap: 24px; margin-top: 16px; }
.blind__paper {
  aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; display: grid; place-items: center; color: var(--saffron-ink);
  background: linear-gradient(160deg, #d9b878, #a87d3e);
  box-shadow: -3px 0 0 rgb(0 0 0 / 0.2) inset, 0 10px 24px -10px rgb(0 0 0 / 0.75);
}
.blind.is-revealed .blind__wrap { animation: unwrap 0.6s var(--ease); }
@keyframes unwrap { from { transform: rotateY(80deg); opacity: 0; } }
.clues { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.clues li { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.clues span { color: var(--parchment-3); font-size: 0.88rem; }
.blind__title { font-size: 1.8rem; margin: 16px 0 0; color: var(--moon); }

/* Feed + footer */
.feed { margin: 24px 0 0; padding: 24px; background: rgb(17 26 48 / 0.94); border: 1px solid var(--line); border-radius: var(--r-lg); }
.feed h2 { margin: 0 0 12px; font-size: 1.6rem; color: var(--moon); }
.feed__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feed__list a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; color: var(--parchment); text-decoration: none; border-bottom: 1px solid var(--line); }
.feed__list a:hover span { color: var(--moon); text-decoration: underline; }
.feed__list small { color: var(--parchment-3); flex: none; }
.footer { width: min(100% - 2 * var(--gutter), var(--maxw)); margin: 48px auto 0; padding: 24px 0 40px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.footer p { margin: 0 0 6px; }
.footer .display { font-size: 1.15rem; color: var(--moon); }

.toast {
  position: fixed; bottom: 20px; inset-inline: 0; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px);
  z-index: 100; display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; border-radius: var(--r-md); background: var(--parchment); color: var(--ink-900);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.7); animation: rise 0.35s var(--ease);
}
.toast .link-btn { color: #8a4b00; font-weight: 700; }
.noscript { text-align: center; padding: 24px; }

body.is-loading .results { opacity: 0.6; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .brand__by { display: none; }
  .topbar__shelf span:not(.count) { display: none; }
  .hero { padding-top: 32px; }
  .composer { flex-direction: column; }
  .composer__go { min-height: 48px; }
  .modes__surprise { margin-inline-start: 0; }
  .top { grid-template-columns: 1fr; }
  .top__cover { max-width: 200px; }
  .sheet, .sheet--narrow { width: 100%; max-width: 100%; box-sizing: border-box; max-height: 94vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .sheet__grid { grid-template-columns: 1fr; }
  .sheet__side { grid-template-columns: 120px 1fr; align-items: start; }
  .sheet__side .shelf-actions .btn { flex: 1 1 auto; }
  .blind { grid-template-columns: 110px 1fr; gap: 16px; }
  .card { grid-template-columns: 92px 1fr; gap: 12px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
[hidden] { display: none !important; }
.sheet__note { font-size: .85rem; margin: -.25rem 0 .75rem; }
