/* GATE XE study books — shelf + reader. Tokens from tokens.css. */

/* ---------- shelf ---------- */
.fsd-books { padding-bottom: 48px; }
.fsd-books__hero { max-width: 760px; margin: 8px 0 24px; }
.fsd-books__hero .fsd-lede { color: var(--fsd-ink-soft, #4f5361); }
.fsd-books__facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.fsd-books__facts li { border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--fsd-ink-soft, #4f5361); }
.fsd-books__facts b { color: var(--fsd-brand, #831d32); }

.fsd-books__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.fsd-bookc { display: flex; flex-direction: column; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 12px; background: var(--fsd-surface, #fff); overflow: hidden; }
.fsd-bookc.is-owned { border-color: var(--fsd-brand, #831d32); }
.fsd-bookc__cover { position: relative; display: block; background: var(--fsd-brand, #831d32); aspect-ratio: 300 / 424; }
.fsd-bookc__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s ease; }
.fsd-bookc__cover:hover img { transform: scale(1.02); }
.fsd-bookc__badge { position: absolute; right: 10px; top: 10px; background: #fff; color: var(--fsd-brand, #831d32); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.fsd-bookc.is-owned .fsd-bookc__badge { background: var(--fsd-ok, #1f7a55); color: #fff; }
.fsd-bookc__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.fsd-bookc__code { font-size: 12px; color: var(--fsd-ink-faint, #6b7080); margin: 0 0 4px; }
.fsd-bookc__title { font-size: 18px; margin: 0 0 6px; }
/* Static topic pills and softly glowing book metrics. */
.fsd-bookc__meta, .fsd-bookc__topics { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; padding: 0; list-style: none; }
.fsd-bookc__meta { margin: 0 0 12px; }
.fsd-bookc__meta li { padding: 2px 8px; border-radius: 999px; background: #fff2e9; color: #831d32; font-size: 11px; font-weight: 600; line-height: 1.4; box-shadow: 0 1px 4px rgb(182 69 13 / 10%); }
.fsd-bookc__topics { margin: 6px 0 16px; }
.fsd-bookc__topics li { max-width: 100%; padding: 2px 8px; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 999px; background: var(--fsd-ground, #f5f6f8); color: var(--fsd-ink-soft, #4f5361); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; cursor: default; }
.fsd-bookc__body > .fsd-bookc__actions { margin-top: auto; }
.fsd-mybook__body .fsd-bookc__meta { margin-bottom: 4px; }
.fsd-bookc__actions { display: flex; align-items: center; gap: 10px; }
.fsd-bookc__actions .fsd-btn { flex: 1; }
.fsd-bookc__actions.is-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 8px; }
.fsd-bookc__actions.is-split .fsd-btn { min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 14px; white-space: nowrap; }
.fsd-bookc__price { font-weight: 800; color: var(--fsd-brand, #831d32); white-space: nowrap; }

.fsd-books__buy { margin-top: 32px; display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: 24px; align-items: start; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 12px; padding: 24px; background: var(--fsd-brand-bg, #f7eaed); scroll-margin-top: 80px; }
.fsd-books__buyhead p { color: var(--fsd-ink-soft, #4f5361); }
.fsd-books__picker { min-width: 0; background: #fff; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.fsd-books__pick { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--fsd-line, #dfe2e8); border-radius: 10px; cursor: pointer; }
.fsd-books__pick.is-on { border-color: var(--fsd-brand, #831d32); background: var(--fsd-brand-bg, #f7eaed); }
.fsd-books__pick.is-owned { opacity: .6; cursor: default; }
.fsd-books__pick input { width: 18px; height: 18px; accent-color: var(--fsd-brand, #831d32); }
.fsd-books__pickname { min-width: 0; overflow-wrap: anywhere; flex: 1; font-weight: 600; }
.fsd-books__pickname small { color: var(--fsd-ink-faint, #6b7080); font-weight: 500; margin-left: 4px; }
.fsd-books__pickprice { font-weight: 700; }
.fsd-books__all { border: 1.5px dashed var(--fsd-brand, #831d32); background: transparent; color: var(--fsd-brand, #831d32); font-weight: 700; border-radius: 10px; min-height: 44px; cursor: pointer; }
.fsd-books__all s { color: var(--fsd-ink-faint, #6b7080); font-weight: 500; margin-left: 4px; }
.fsd-books__total { display: flex; align-items: baseline; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--fsd-line, #dfe2e8); margin-top: 4px; }
.fsd-books__total strong { font-size: 26px; color: var(--fsd-ink, #20212a); }
.fsd-books__total em { font-style: normal; color: var(--fsd-ok, #1f7a55); font-weight: 700; font-size: 13px; }
.fsd-books__note { font-size: 12px; color: var(--fsd-ink-faint, #6b7080); margin: 0; }
.fsd-books__msg:not(:empty) { font-size: 13px; color: var(--fsd-bad, #b42318); }
.fsd-books__owned { margin-top: 24px; }
@media (max-width: 760px) {
	.fsd-books__buy { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}

/* ---------- reader ---------- */
body.fsd-reader-page { background: #e9e6e1; }
.fsd-reader { --zoom: 1; --ratio: 1.415; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fsd-reader__bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--fsd-surface, #fff); border-bottom: 1px solid var(--fsd-line, #dfe2e8); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.fsd-reader__back { font-size: 20px; text-decoration: none; color: var(--fsd-ink, #20212a); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
.fsd-reader__back:hover { background: var(--fsd-ground, #f5f6f8); }
.fsd-reader__name { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; min-width: 0; }
.fsd-reader__name strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsd-reader__name span { font-size: 12px; color: var(--fsd-ink-faint, #6b7080); }
.fsd-reader__btn { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--fsd-line, #dfe2e8); background: #fff; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--fsd-ink, #20212a); }
.fsd-reader__btn:hover { border-color: var(--fsd-brand, #831d32); color: var(--fsd-brand, #831d32); }
.fsd-reader__pager, .fsd-reader__zoom { display: flex; align-items: center; gap: 6px; }
.fsd-reader__pager label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--fsd-ink-soft, #4f5361); }
.fsd-reader__pager input { width: 58px; height: 36px; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 8px; text-align: center; font-weight: 700; }
.fsd-reader__toc { position: fixed; z-index: 40; top: 58px; left: 12px; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 80px); overflow: auto; background: #fff; border: 1px solid var(--fsd-line, #dfe2e8); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; }
.fsd-reader__toc ol { list-style: none; margin: 0; padding: 0; }
.fsd-reader__toc button { width: 100%; display: flex; gap: 10px; align-items: baseline; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; font: inherit; color: var(--fsd-ink, #20212a); }
.fsd-reader__toc button:hover { background: var(--fsd-brand-bg, #f7eaed); }
.fsd-reader__toc .n { color: var(--fsd-brand, #831d32); font-weight: 800; min-width: 22px; }
.fsd-reader__toc .t { flex: 1; font-size: 14px; }
.fsd-reader__toc .p { font-size: 12px; color: var(--fsd-ink-faint, #6b7080); white-space: nowrap; }
.fsd-reader__toc .is-locked .t { color: var(--fsd-ink-faint, #6b7080); }
.fsd-reader__pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 10px 60px; outline: none; }
.fsd-reader__page { position: relative; width: min(calc(100vw - 20px), calc(860px * var(--zoom))); aspect-ratio: 1 / var(--ratio); background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.12); scroll-margin-top: 64px; }
.fsd-reader__page canvas { display: block; width: 100%; height: 100%; }
.fsd-reader__pnum { position: absolute; inset: 0; display: grid; place-items: center; color: #c9ccd3; font-weight: 800; font-size: 28px; }
.fsd-reader__page.is-loaded .fsd-reader__pnum { display: none; }
.fsd-reader__page.is-error .fsd-reader__pnum::after { content: " — tap to retry"; font-size: 14px; }
.fsd-reader__lock { width: min(calc(100vw - 20px), 860px); background: #fff; border: 2px solid var(--fsd-brand, #831d32); border-radius: 14px; padding: 28px; text-align: left; }
.fsd-reader__lock h2 { margin: 4px 0 8px; }
.fsd-reader__lock ul { columns: 2; color: var(--fsd-ink-soft, #4f5361); font-size: 14px; }
.fsd-reader__lockcta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.fsd-reader__lockcta span { color: var(--fsd-ink-soft, #4f5361); font-size: 14px; }
@media (max-width: 640px) {
	.fsd-reader__zoom, .fsd-reader__name span { display: none; }
	.fsd-reader__unlock { display: none; }
	.fsd-reader__lock ul { columns: 1; }
}
/* No printing the book. */
@media print {
	.fsd-reader { display: none !important; }
	body.fsd-reader-page::after { content: "Printing is not available for study materials."; }
}

/* Focused reading: the reader is full-screen, its own toolbar has the way back. */
body.fsd-reader-page .fsd-topbar,
body.fsd-reader-page .fsd-foot,
body.fsd-reader-page .fsd-tabbar,
body.fsd-reader-page .fsd-feedback-leaf,
body.fsd-reader-page .fsd-social-float,
body.fsd-reader-page .fsd-skip { display: none !important; }
body.fsd-reader-page #fsd-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }

/* section-at-a-time reader */
.fsd-reader__seghead { width: min(calc(100vw - 20px), calc(860px * var(--zoom))); margin: 4px 0 0; font-weight: 800; color: var(--fsd-brand, #831d32); font-size: 14px; letter-spacing: .02em; }
.fsd-reader__segnav { width: min(calc(100vw - 20px), calc(860px * var(--zoom))); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 18px; border: 1.5px solid var(--fsd-line, #dfe2e8); background: #fff; border-radius: 12px; cursor: pointer; font: inherit; color: var(--fsd-ink, #20212a); }
.fsd-reader__segnav small { font-size: 12px; font-weight: 700; color: var(--fsd-ink-faint, #6b7080); text-transform: uppercase; letter-spacing: .08em; }
.fsd-reader__segnav span { font-weight: 700; }
.fsd-reader__segnav--next { align-items: flex-end; text-align: right; border-color: var(--fsd-brand, #831d32); }
.fsd-reader__segnav--next span::after { content: " →"; color: var(--fsd-brand, #831d32); }
.fsd-reader__segnav--prev span::before { content: "← "; color: var(--fsd-ink-faint, #6b7080); }
.fsd-reader__segnav:hover { background: var(--fsd-brand-bg, #f7eaed); }
.fsd-reader__toc .is-current button { background: var(--fsd-brand-bg, #f7eaed); }
.fsd-reader__pages { padding-bottom: 45vh; }
@media (max-width: 640px) {
	.fsd-reader__bar { padding: 6px 10px; gap: 6px; }
	.fsd-reader__btn { height: 32px; min-width: 32px; padding: 0 8px; font-size: 13px; }
	.fsd-reader__back { width: 32px; height: 32px; }
	.fsd-reader__pager input { height: 32px; width: 50px; }
	.fsd-reader__name strong { font-size: 14px; }
	.fsd-reader__pager { margin-left: auto; }
	.fsd-reader__name { flex: 1 1 50%; }
}

/* ---------- My study materials (dashboard) ---------- */
.fsd-mybooks .fsd-books__hero { margin-bottom: 12px; }
.fsd-mybooks section + section { margin-top: 32px; }
.fsd-mybooks__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fsd-mybook { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--fsd-brand, #831d32); border-radius: 12px; background: var(--fsd-surface, #fff); }
.fsd-mybook__cover img { width: 96px; height: auto; border-radius: 6px; display: block; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.fsd-mybook__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.fsd-mybook__title { margin: 0; font-size: 17px; }
.fsd-mybook__bar { height: 6px; border-radius: 999px; background: var(--fsd-line-soft, #eceef2); overflow: hidden; }
.fsd-mybook__bar i { display: block; height: 100%; background: var(--fsd-brand, #831d32); }
.fsd-mybook__where { margin: 0; font-size: 13px; color: var(--fsd-ink-faint, #6b7080); }
.fsd-mybook .fsd-btn { align-self: flex-start; margin-top: auto; }
.fsd-mybooks__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fsd-mybooks__head .fsd-h2 { margin: 0; }
a.fsd-bookc__price { text-decoration: none; }

/* Offer: listed price struck through before the sale price (owner, 2026-10-16). */
.fsd-was { font-weight: 400; opacity: .7; text-decoration: line-through; margin-right: .15em; }
.fsd-btn--buy .fsd-was { opacity: .8; }
