/* EbookBoy — design system (midnight ink, ember orange, paper) */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/figtree-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/figtree-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Gilda Display'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/gilda-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF; }
@font-face { font-family: 'Gilda Display'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/gilda-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #14122B; --ink-2: #221E45; --ink-3: #2F2A5C; --on-ink: #D8D4EE;
  --brand: #E8590C; --brand-deep: #C2470A; --brand-wash: #FFF1E8;
  --violet: #6D28D9; --violet-wash: #F2ECFB;
  --gold: #FFD814; --gold-deep: #F7CA00; --amber: #FFA41C; --amber-deep: #F39200;
  --paper: #F6F4FA; --card: #fff; --text: #1E1A2E; --muted: #6A6480; --line: #E6E2EF; --line-2: #D4CFE0;
  --ok: #0F7B4F; --ok-wash: #E7F6EF; --alert: #C9302C; --alert-wash: #FDECEC; --star: #F5A623;
  --display: 'Gilda Display', Didot, Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1280px; --r: 12px; --r-sm: 8px;
  --sh: 0 1px 2px rgba(20, 18, 43, .06), 0 4px 16px rgba(20, 18, 43, .05);
  --sh-lg: 0 10px 40px rgba(20, 18, 43, .14);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--brand-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ── buttons ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 1px solid transparent; border-radius: 999px; padding: .62em 1.25em; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.2; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); border-color: #FCD200; color: #0F1111; }
.btn--gold:hover { background: var(--gold-deep); color: #0F1111; }
.btn--amber { background: var(--amber); border-color: #FF8F00; color: #0F1111; }
.btn--amber:hover { background: var(--amber-deep); color: #0F1111; }
.btn--orange { background: var(--brand); color: #fff; }
.btn--orange:hover { background: var(--brand-deep); color: #fff; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-3); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: var(--paper); color: var(--text); }
.btn--block { width: 100%; }
.btn--lg { padding: .85em 1.6em; font-size: 1.05rem; }
.btn--sm { padding: .4em .9em; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--violet); cursor: pointer; font-weight: 600; }

/* ── header ───────────────────────────── */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; }
.top__bar { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; flex-shrink: 0; }
.logo:hover { color: #fff; }
.logo__mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #FF8A3D); color: #fff; font-size: 17px; box-shadow: 0 2px 10px rgba(232, 89, 12, .45); }
.logo__word { font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; }
.logo__word b { color: #FF8A3D; }
.search { flex: 1; display: flex; height: 44px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; min-width: 0; }
.search:focus-within { box-shadow: 0 0 0 3px var(--amber); }
.search__cat { border: 0; background: #EEEDF3; color: #333; padding: 0 8px; max-width: 130px; font-size: .85rem; border-right: 1px solid #D5D3DE; cursor: pointer; }
.search input { flex: 1; border: 0; padding: 0 14px; min-width: 0; color: #111; outline: none; }
.search button { border: 0; background: var(--amber); width: 52px; cursor: pointer; color: #111; font-size: 1.1rem; }
.search button:hover { background: var(--amber-deep); }
.top__acts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.act { color: #fff; display: flex; flex-direction: column; line-height: 1.15; padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; }
.act:hover { color: #fff; border-color: rgba(255, 255, 255, .35); }
.act small { font-size: .72rem; color: var(--on-ink); }
.act span { font-weight: 800; font-size: .9rem; }
.act--admin span { color: #FF8A3D; }
.act--cart { flex-direction: row; align-items: flex-end; gap: 6px; }
.cart-ico { position: relative; font-size: 1.6rem; line-height: 1; }
.cart-n { position: absolute; top: -8px; left: 50%; transform: translateX(-35%); color: #FF8A3D; font-size: .95rem; font-weight: 800; }
.top__nav { background: var(--ink-2); }
.top__navin { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; font-size: .9rem; }
.top__navin::-webkit-scrollbar { display: none; }
.top__navin > a, .allcats summary { color: #fff; padding: 8px 11px; border-radius: 6px; white-space: nowrap; border: 1px solid transparent; cursor: pointer; }
.top__navin > a:hover, .allcats summary:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.top__navin > a[aria-current] { background: rgba(255, 255, 255, .1); }
.top__navin .hot { color: #FFB27A; font-weight: 700; }
.allcats { position: static; }
.allcats summary { list-style: none; font-weight: 700; }
.allcats summary::-webkit-details-marker { display: none; }
.allcats__panel { position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: var(--sh-lg); padding: 18px max(20px, calc((100vw - var(--wrap)) / 2 + 20px)); display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 16px; z-index: 50; }
.allcats__panel a { color: var(--text); padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.allcats__panel a:hover { background: var(--paper); }
.allcats__panel i { width: 20px; color: var(--brand); text-align: center; }
.allcats__panel small { margin-left: auto; color: var(--muted); }

/* ── wish bar (every page) ───────────────────────────── */
.wishbar { background: linear-gradient(90deg, #2A1F5C, #3B1E5E 55%, #5A2149); color: #fff; }
.wishbar__in { padding-top: 12px; padding-bottom: 12px; }
.wishbar__q { display: block; font-weight: 800; margin-bottom: 7px; font-size: .98rem; }
.wishbar__q i { color: #FFB27A; }
.wishbar__q span { font-weight: 400; color: var(--on-ink); }
.wishbar__row { display: flex; gap: 8px; }
.wishbar textarea { flex: 1; min-height: 44px; border-radius: 10px; border: 0; padding: 11px 14px; resize: none; color: #111; transition: min-height .2s; }
.wishbar textarea:focus { min-height: 92px; }
.wishbar input[type=email] { width: 210px; border-radius: 10px; border: 0; padding: 0 12px; color: #111; height: 44px; }
.wishbar .btn { height: 44px; border-radius: 10px; }

.flash { padding: 12px 0; font-weight: 600; }
.flash--ok { background: var(--ok-wash); color: var(--ok); }
.flash--error { background: var(--alert-wash); color: var(--alert); }
.flash--info { background: var(--violet-wash); color: var(--violet); }

/* ── home hero ───────────────────────────── */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(232, 89, 12, .35), transparent 60%), radial-gradient(900px 500px at 0% 120%, rgba(109, 40, 217, .45), transparent 60%), var(--ink); color: #fff; padding: 56px 0 64px; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: .3em; }
.hero h1 em { font-style: normal; color: #FFB27A; }
.hero__lead { color: var(--on-ink); font-size: 1.15rem; max-width: 560px; }
.hero__form { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--sh-lg); color: var(--text); margin-top: 22px; }
.hero__form label { font-weight: 800; display: block; margin-bottom: 8px; }
.hero__form textarea { width: 100%; min-height: 110px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; resize: vertical; }
.hero__form textarea:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 40, 217, .18); }
.hero__formrow { display: flex; gap: 10px; margin-top: 10px; }
.hero__formrow input { flex: 1; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 16px; min-width: 0; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; font-size: .82rem; color: var(--muted); background: #fff; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.hero__stats { display: flex; gap: 28px; margin-top: 26px; color: var(--on-ink); font-size: .9rem; flex-wrap: wrap; }
.hero__stats b { display: block; color: #fff; font-size: 1.5rem; font-weight: 800; }
.hero__stack { position: relative; height: 420px; }
.hero__stack img { position: absolute; width: 210px; border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); transition: transform .3s; }
.hero__stack img:nth-child(1) { left: 6%; top: 50px; transform: rotate(-9deg); }
.hero__stack img:nth-child(2) { left: 34%; top: 0; z-index: 2; transform: rotate(2deg); }
.hero__stack img:nth-child(3) { left: 58%; top: 70px; transform: rotate(10deg); }
.hero__stack:hover img:nth-child(1) { transform: rotate(-12deg) translateX(-10px); }
.hero__stack:hover img:nth-child(3) { transform: rotate(13deg) translateX(10px); }

/* ── sections / shelves ───────────────────────────── */
.section { padding: 34px 0; }
.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shelf { background: #fff; border-radius: var(--r); padding: 18px 18px 8px; box-shadow: var(--sh); margin-bottom: 22px; }
.shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf__more { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.shelf__row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 18px; overflow-x: auto; padding: 8px 2px 16px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shelf__row > * { scroll-snap-align: start; }
.grid-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 20px; }
.bcard { display: flex; flex-direction: column; min-width: 0; }
.bcard__cover { display: block; aspect-ratio: 2/3; border-radius: 4px 8px 8px 4px; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 8px 20px rgba(20, 18, 43, .14); transition: transform .2s, box-shadow .2s; background: #ddd; }
.bcard__cover:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(0, 0, 0, .12), 0 16px 32px rgba(20, 18, 43, .2); }
.bcard__cover img { width: 100%; height: 100%; object-fit: cover; }
.bcard__body { padding-top: 10px; }
.bcard__title { color: var(--text); font-weight: 700; font-size: .92rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard__title:hover { color: var(--brand-deep); }
.bcard__rating { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--violet); margin-top: 3px; }
.bcard__rating--new { color: var(--ok); font-weight: 700; }
.bcard__price { font-weight: 800; font-size: 1.05rem; margin-top: 2px; }
.bcard__pages { font-weight: 400; font-size: .78rem; color: var(--muted); margin-left: 4px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--violet-wash); color: var(--violet); text-transform: uppercase; letter-spacing: .04em; }
.badge--orange { background: var(--brand-wash); color: var(--brand-deep); }
.badge--ok { background: var(--ok-wash); color: var(--ok); }
.badge--grey { background: #EEECF3; color: var(--muted); }

.stars { position: relative; display: inline-block; width: 5.2em; height: 1em; font-size: 15px; vertical-align: -2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.5l2.6 5.6 6.1.7-4.5 4.2 1.2 6L10 15l-5.4 3 1.2-6L1.3 7.8l6.1-.7z' fill='none' stroke='%23F5A623' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x left / 1.04em 1em; }
.stars__fill { position: absolute; inset: 0 auto 0 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.5l2.6 5.6 6.1.7-4.5 4.2 1.2 6L10 15l-5.4 3 1.2-6L1.3 7.8l6.1-.7z' fill='%23F5A623' stroke='%23F5A623' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x left / 1.04em 1em; }
.stars--sm { font-size: 12px; }
.stars--lg { font-size: 20px; }

.cattiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cattile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; gap: 12px; align-items: center; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.cattile:hover { border-color: var(--brand); box-shadow: var(--sh); color: var(--text); }
.cattile i { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand); flex-shrink: 0; }
.cattile b { display: block; line-height: 1.25; }
.cattile small { color: var(--muted); }

.howto { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.howto div { background: #fff; border-radius: var(--r); padding: 20px; box-shadow: var(--sh); position: relative; }
.howto div::before { counter-increment: s; content: counter(s); position: absolute; top: 16px; right: 18px; font-family: var(--display); font-size: 2.4rem; color: var(--line-2); line-height: 1; }
.howto i { font-size: 1.5rem; color: var(--brand); margin-bottom: 10px; }
.howto h3 { font-size: 1.05rem; }
.howto p { color: var(--muted); font-size: .92rem; margin: 0; }

.writing-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wn { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.wn b { display: block; line-height: 1.3; }
.progress { height: 8px; background: #ECE9F3; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #FF9A5A); border-radius: 99px; transition: width .6s; }

/* ── book page ───────────────────────────── */
.crumbs { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand-deep); }
.bookpage { display: grid; grid-template-columns: 300px 1fr 290px; gap: 36px; padding: 20px 0 30px; align-items: start; }
.bookpage__cover { position: sticky; top: 130px; }
.bookpage__cover img { border-radius: 4px 10px 10px 4px; box-shadow: 0 4px 8px rgba(0, 0, 0, .12), 0 24px 50px rgba(20, 18, 43, .25); width: 100%; }
.bookpage__cover .btn { margin-top: 14px; }
.bookpage h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: .2em; }
.bookpage__sub { font-size: 1.15rem; color: var(--muted); margin-bottom: .5em; }
.bookpage__by { font-size: .92rem; margin-bottom: 8px; }
.bookpage__rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .92rem; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin: 18px 0; }
.facts div { padding: 12px; text-align: center; border-right: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.facts div:last-child { border-right: 0; }
.facts i { display: block; font-size: 1.1rem; color: var(--text); margin-bottom: 4px; }
.facts b { display: block; color: var(--text); font-size: .92rem; }
.prose { font-size: 1.03rem; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.highlights { list-style: none; padding: 0; margin: 0 0 1em; }
.highlights li { padding: 6px 0 6px 30px; position: relative; }
.highlights li::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 4px; top: 7px; color: var(--ok); }
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.toc li { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
.toc li:last-child { border-bottom: 0; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2em; }
.toc .t { flex: 1; }
.toc .w { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.buybox { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px; position: sticky; top: 130px; }
.buybox__price { font-size: 2rem; font-weight: 800; line-height: 1; }
.buybox__price sup { font-size: .5em; vertical-align: .85em; }
.buybox ul { list-style: none; padding: 0; margin: 14px 0; font-size: .9rem; }
.buybox li { padding: 4px 0; display: flex; gap: 8px; }
.buybox li i { color: var(--ok); margin-top: 4px; width: 16px; }
.buybox .btn { margin-bottom: 8px; }
.buybox__secure { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 6px; }
.owned { background: var(--ok-wash); color: var(--ok); border-radius: var(--r-sm); padding: 10px 12px; font-weight: 700; margin-bottom: 10px; }

.reviews { display: grid; grid-template-columns: 300px 1fr; gap: 40px; }
.histo { margin: 12px 0 20px; }
.histo a, .histo div { display: grid; grid-template-columns: 52px 1fr 40px; gap: 10px; align-items: center; font-size: .88rem; padding: 3px 0; color: var(--violet); }
.histo .bar { height: 18px; background: #F0EEF4; border-radius: 4px; overflow: hidden; border: 1px solid #E3E0EA; }
.histo .bar span { display: block; height: 100%; background: var(--star); }
.review { padding: 18px 0; border-bottom: 1px solid var(--line); }
.review__who { display: flex; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-wash); color: var(--violet); font-weight: 800; }
.review__head { display: flex; gap: 10px; align-items: center; font-weight: 800; flex-wrap: wrap; }
.review__meta { font-size: .82rem; color: var(--muted); margin: 2px 0 8px; }
.review__meta .verified { color: var(--brand-deep); font-weight: 700; }
.rateinput { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rateinput input { position: absolute; opacity: 0; width: 1px; }
.rateinput label { font-size: 1.9rem; color: #D7D3E0; cursor: pointer; line-height: 1; }
.rateinput label:hover, .rateinput label:hover ~ label, .rateinput input:checked ~ label { color: var(--star); }
.rateinput input:focus-visible + label { outline: 2px solid var(--amber); }

.need__label { display: block; font-weight: 800; font-size: .92rem; line-height: 1.35; margin: 4px 0 6px; }
.need { width: 100%; min-height: 78px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; resize: vertical; margin-bottom: 10px; font-size: .92rem; }
.need:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 89, 12, .15); }
.need--ask { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 89, 12, .2); }
.need__hint { color: var(--brand-deep); font-weight: 700; font-size: .85rem; margin: -4px 0 10px; }
.myqs { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; font-size: .88rem; }
.myq { margin-top: 8px; }
.myq__q { margin: 0; font-style: italic; color: var(--muted); }
.myq__a { margin: 2px 0 0; }

/* ── downloads */
.dl { display: grid; gap: 6px; }
.dl__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); background: #fff; font-size: .9rem; line-height: 1.25; }
.dl__item:hover { border-color: var(--brand); color: var(--text); background: #FFFAF6; }
.dl__item i { width: 20px; text-align: center; color: var(--brand); font-size: 1.05rem; }
.dl__item small { display: block; color: var(--muted); font-size: .76rem; }
.dl__item--main { background: var(--amber); border-color: #FF8F00; }
.dl__item--main:hover { background: var(--amber-deep); }
.dl__item--main i { color: #111; }
.dl--compact { grid-template-columns: 1fr 1fr; gap: 4px; }
.dl--compact .dl__item { padding: 5px 7px; font-size: .8rem; gap: 6px; }
.dl--compact .dl__item--main { grid-column: 1 / -1; }
.dl__kindle { font-size: .78rem; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
.dlpop { position: relative; margin-top: 6px; }
.dlpop summary { list-style: none; cursor: pointer; }
.dlpop summary::-webkit-details-marker { display: none; }
.dlpop[open] > .dl { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; padding: 8px; border-radius: var(--r-sm); box-shadow: var(--sh-lg); min-width: 200px; }
.dlpop--right[open] > .dl { left: auto; right: 0; width: 240px; }

/* ── forms / cards ───────────────────────────── */
.card { background: #fff; border-radius: var(--r); box-shadow: var(--sh); padding: 24px; }
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 5px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select { width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.narrow { max-width: 460px; margin: 40px auto; }
.mid { max-width: 820px; margin: 0 auto; }
.split { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #FAF9FC; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }

/* ── cart / checkout ───────────────────────────── */
.cartline { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cartline img { border-radius: 3px 6px 6px 3px; box-shadow: var(--sh); }
.cartline__t { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.cartline__price { font-weight: 800; font-size: 1.1rem; }
.summary { position: sticky; top: 130px; }
.summary__row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary__total { font-size: 1.25rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.paymethods { display: grid; gap: 10px; }
.pm { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.pm:hover { border-color: var(--violet); }
.pm:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 89, 12, .15); background: #FFFCFA; }
.pm input { accent-color: var(--brand); width: 18px; height: 18px; }
.pm b { display: block; }
.pm small { color: var(--muted); }
.pm__ico { font-size: 1.6rem; color: var(--muted); display: flex; gap: 6px; }
.pm__other { display: none; grid-column: 1 / -1; }
.pm:has(input:checked) .pm__other { display: block; }
.pm__other textarea { width: 100%; min-height: 90px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 4px; }
.steps { display: flex; gap: 8px; font-size: .85rem; color: var(--muted); margin: 18px 0; flex-wrap: wrap; }
.steps span { display: flex; align-items: center; gap: 6px; }
.steps b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); font-size: .78rem; }
.steps .on b { background: var(--brand); color: #fff; }
.steps .on { color: var(--text); font-weight: 700; }

/* ── reader ───────────────────────────── */
.reader { background: #FBFAF6; }
.reader__top { position: sticky; top: 0; z-index: 30; background: rgba(251, 250, 246, .95); backdrop-filter: blur(6px); border-bottom: 1px solid #ECE8DC; }
.reader__topin { display: flex; align-items: center; gap: 14px; padding: 10px 20px; max-width: 980px; margin: 0 auto; font-size: .9rem; }
.reader__topin .t { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__bar { height: 3px; background: var(--brand); width: 0; position: absolute; bottom: -1px; left: 0; }
.reader__body { max-width: 700px; margin: 0 auto; padding: 40px 22px 80px; font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 1.16rem; line-height: 1.75; color: #24201A; }
.reader__body h1 { font-family: var(--display); text-align: center; margin: 1.6em 0 .3em; }
.reader__body .chnum { text-align: center; font-family: var(--body); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-deep); margin-top: 3em; }
.reader__body h2, .reader__body h3 { font-family: var(--body); margin-top: 1.8em; }
.reader__body blockquote { border-left: 3px solid var(--brand); margin: 1.2em 0; padding: .2em 1.2em; color: #4A4436; font-style: italic; }
.reader__body pre { background: #F1EEE4; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: .85em; }
.reader__body hr { border: 0; text-align: center; margin: 2em 0; }
.reader__body hr::after { content: "* * *"; letter-spacing: .5em; color: var(--muted); }
.reader__body.dark { background: #16141F; color: #DDD8E8; }
body.reader.dark { background: #16141F; }
body.reader.dark .reader__top { background: rgba(22, 20, 31, .95); border-color: #2A2738; color: #DDD8E8; }
body.reader.dark .reader__body { color: #DDD8E8; }
body.reader.dark .reader__body blockquote { color: #B9B2CC; }
body.reader.dark .reader__body pre { background: #22202E; }
.paywall { text-align: center; background: linear-gradient(180deg, rgba(251, 250, 246, 0), #FBFAF6 40%); margin-top: -120px; padding-top: 120px; position: relative; }
.paywall .card { display: inline-block; text-align: center; max-width: 480px; font-family: var(--body); }

/* ── feedback board ───────────────────────────── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--text); border-color: var(--brand); }
.fb { display: grid; grid-template-columns: 56px 1fr; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 0; }
.vote button { background: none; border: 1px solid transparent; border-radius: 8px; width: 38px; height: 30px; cursor: pointer; color: var(--muted); font-size: 1.05rem; }
.vote button:hover { background: var(--paper); color: var(--text); }
.vote button.on.up { color: var(--ok); background: var(--ok-wash); }
.vote button.on.down { color: var(--alert); background: var(--alert-wash); }
.vote b { font-size: 1.05rem; }
.fb h3 { font-size: 1.05rem; margin: 0 0 4px; }
.fb__meta { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.fb__reply { background: var(--violet-wash); border-radius: var(--r-sm); padding: 10px 12px; font-size: .92rem; margin-top: 8px; }

/* ── footer ───────────────────────────── */
.footwish { background: linear-gradient(90deg, #E8590C, #D9480F 50%, #B5307A); color: #fff; padding: 30px 0; margin-top: 40px; }
.footwish__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footwish h2 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; margin: 0 0 .2em; }
.footwish p { margin: 0; opacity: .92; max-width: 640px; }
.footwish .btn--orange { background: #fff; color: var(--brand-deep); }
.foot { background: var(--ink); color: var(--on-ink); padding: 40px 0 20px; font-size: .9rem; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.foot h3 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.foot a { display: block; color: var(--on-ink); padding: 3px 0; }
.foot a:hover { color: #fff; }
.foot .logo { display: inline-flex; margin-bottom: 10px; }
.foot__base { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 26px; padding-top: 16px; font-size: .82rem; flex-wrap: wrap; }
.foot__pay { font-size: 1.3rem; display: flex; gap: 12px; }

/* ── admin ───────────────────────────── */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .9rem; }
.admin-nav a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi b { display: block; font-size: 1.5rem; }
.inline { display: inline; }

@media (max-width: 1100px) {
  .bookpage { grid-template-columns: 240px 1fr; }
  .bookpage__buy { grid-column: 2; }
  .buybox { position: static; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__stack { display: none; }
  .howto { grid-template-columns: 1fr 1fr; }
  .split, .reviews { grid-template-columns: 1fr; }
  .summary { position: static; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .footwish__in { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .top__bar { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .search__cat { display: none; }
  .top__acts { margin-left: auto; }
  .act small { display: none; }
  .logo__word { font-size: 1.25rem; }
  .top { position: relative; }
  .wishbar__row { flex-wrap: wrap; }
  .wishbar textarea { flex-basis: 100%; }
  .wishbar input[type=email] { flex: 1; width: auto; }
  .wishbar__q span { display: block; }
  .bookpage { grid-template-columns: 1fr; gap: 20px; }
  .bookpage__cover { position: static; max-width: 230px; margin: 0 auto; }
  .bookpage__buy { grid-column: auto; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .shelf__row { grid-auto-columns: 132px; gap: 14px; }
  .grid-books { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .howto { grid-template-columns: 1fr; }
  .hero__formrow { flex-direction: column; }
  .hero__formrow input { height: 44px; }
  .foot__grid { grid-template-columns: 1fr; }
  .cartline { grid-template-columns: 70px 1fr; }
  .cartline > :last-child { grid-column: 2; }
  .reader__body { font-size: 1.08rem; }
  .cattiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cattile { padding: 10px; gap: 8px; font-size: .9rem; }
  .cattile i { width: 30px; height: 30px; font-size: .85rem; }
  .hero { padding: 32px 0 40px; }
}
@media print {
  .top, .wishbar, .footwish, .foot, .reader__top, .noprint { display: none !important; }
  body, .reader__body { background: #fff !important; color: #000 !important; }
  .reader__body { max-width: none; padding: 0; }
  .chapter { page-break-before: always; }
}
