/* Book pages: catalog (/books), detail (/books/{slug}), reader and the book card used on /wiki
   category pages. Colours come from the site's theme tokens, so dark mode and campaign themes apply.
   Book covers are always contained, never cropped: a cover keeps its own aspect ratio. */

.nv-books, .nv-book, .nv-book-reader { --nv-book-cover-bg: var(--nv-surface-alt); --nv-book-hero-bg: color-mix(in srgb, var(--nv-accent-soft, #f5efe6) 55%, var(--nv-surface)); padding-bottom: 4rem; }
.nv-books .nv-breadcrumb, .nv-book .nv-breadcrumb { text-transform: none; letter-spacing: 0; }

/* ---- Card ---------------------------------------------------------------------------------- */
.nv-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem 1.25rem; }
.nv-book-card { position: relative; display: flex; flex-direction: column; gap: .65rem; min-width: 0; }
.nv-book-card__cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; padding: .75rem; border-radius: var(--nv-radius-sm, 6px); background: var(--nv-book-cover-bg, var(--nv-surface-alt)); overflow: hidden; }
.nv-book-card__cover img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .18)); transition: transform .2s ease; }
.nv-book-card:hover .nv-book-card__cover img { transform: translateY(-3px); }
.nv-book-card__placeholder { display: grid; place-items: center; width: 100%; height: 100%; padding: 1rem; border: 1px solid var(--nv-border); color: var(--nv-text-secondary); font-family: var(--nv-font-display); text-align: center; background: var(--nv-surface); }
.nv-book-card__shelf { position: absolute; top: .5rem; right: .5rem; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--nv-text); background: color-mix(in srgb, var(--nv-surface) 85%, transparent); cursor: pointer; }
.nv-book-card__shelf.is-on svg, .nv-book__want.is-on svg { fill: currentColor; }
.nv-book-card__shelf:focus-visible { outline: 2px solid var(--nv-primary); outline-offset: 2px; }
.nv-book-card__title { margin: 0; font-size: 1rem; line-height: 1.35; font-weight: 600; }
.nv-book-card__title a { color: var(--nv-text); text-decoration: none; }
.nv-book-card__title a:hover { text-decoration: underline; }
.nv-book-card__author, .nv-book-card__summary { margin: 0; color: var(--nv-text-secondary); font-size: .875rem; }
.nv-book-card__summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nv-book-card__meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; font-size: .875rem; }
.nv-book-card__rating { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; }
.nv-book-badge { padding: .1rem .55rem; border: 1px solid var(--nv-border); border-radius: 6px; color: var(--nv-text-secondary); font-size: .75rem; }
.nv-content-type { display: inline-block; width: fit-content; padding: .05rem .5rem; border-radius: 999px; color: var(--nv-primary-text, var(--nv-text)); background: var(--nv-primary-soft, var(--nv-surface-alt)); font-size: .7rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }

.nv-book-grid--list { grid-template-columns: 1fr; }
.nv-book-grid--list .nv-book-card { display: grid; grid-template-columns: 110px 1fr; gap: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--nv-border); }
.nv-book-grid--list .nv-book-card__shelf { left: 72px; right: auto; }
.nv-book-grid--list .nv-book-card__body { display: flex; flex-direction: column; gap: .4rem; }

/* ---- Catalog ------------------------------------------------------------------------------- */
.nv-books { --nv-books-serif: 'Times New Roman', 'Noto Serif', Georgia, serif; --nv-books-panel: var(--nv-surface-alt); }
.nv-books .nv-breadcrumb { margin-top: 1.25rem; font-size: .85rem; }
.nv-books__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 1.75rem; }
.nv-books__title, .nv-book__title { margin: 0; font-family: var(--nv-font-display); font-size: clamp(1rem, 4vw, 2rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom:15px; }
.nv-books .nv-books__title { margin: 0; font-family: var(--nv-books-serif); font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.01em; }
.nv-books__intro { margin: .4rem 0 0; color: var(--nv-text-secondary); font-size: 1.05rem; }
.nv-books__shelf-link { display: inline-flex; flex: none; align-items: center; gap: .5rem; height: 44px; padding: 0 1.1rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: var(--nv-surface); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.nv-books__shelf-link:hover { border-color: var(--nv-text-secondary); }
.nv-book__read, .nv-books__apply { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 48px; padding: 0 1.4rem; border: 0; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }

.nv-books__shelf { margin: 0 0 2rem; padding: 1.25rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius, 10px); background: var(--nv-surface); box-shadow: 0 8px 28px rgba(0, 0, 0, .08); }
.nv-books__shelf-head { display: flex; align-items: center; justify-content: space-between; }
.nv-books .nv-books__shelf-head h2 { margin: 0; font-family: var(--nv-books-serif); font-size: 1.3rem; }
.nv-books__shelf-head button { border: 0; background: none; color: var(--nv-text-secondary); font-size: 1.5rem; cursor: pointer; }
.nv-books__shelf-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.nv-books__shelf-tabs button { padding: .35rem .9rem; border: 1px solid transparent; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: none; font: inherit; font-size: .85rem; cursor: pointer; }
.nv-books__shelf-tabs [aria-selected="true"] { color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); }
.nv-books__shelf-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; color: var(--nv-text-secondary); }
.nv-shelf-item { display: flex; gap: .75rem; align-items: center; padding: .5rem; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); text-decoration: none; }
.nv-shelf-item:hover { background: var(--nv-surface-alt); }
.nv-shelf-item img { width: 48px; height: 72px; object-fit: contain; }
.nv-shelf-item span { display: flex; flex-direction: column; font-size: .875rem; color: var(--nv-text-secondary); }
.nv-shelf-item strong { color: var(--nv-text); }

/* Featured: one book per slide, cover beside its copy, arrows bottom-right. */
.nv-books-featured { position: relative; margin: 0 0 2rem; padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.25rem, 5vw, 5rem); border-radius: var(--nv-radius, 10px); background: var(--nv-books-panel); }
.nv-books-featured__slide { display: none; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.nv-books-featured__slide.is-active { display: grid; }
.nv-books-featured__cover { display: block; aspect-ratio: 2 / 3; }
.nv-books-featured__cover img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .25)); }
.nv-books-featured__copy { padding-bottom: 2rem; }
.nv-books-featured__eyebrow { display: inline-block; padding: .2rem .55rem; border-radius: 4px; color: var(--nv-text-secondary); background: color-mix(in srgb, var(--nv-text) 8%, transparent); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.nv-books .nv-books-featured__title { margin: .9rem 0 .4rem; font-family: var(--nv-books-serif); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.15; }
.nv-books-featured__author { margin: 0 0 1rem; color: var(--nv-text-secondary); }
.nv-books-featured__summary { margin: 0 0 1.5rem; max-width: 52ch; color: var(--nv-text-secondary); font-size: 1rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nv-books .nv-books-featured__link { display: inline-flex; align-items: center; gap: .6rem; height: 44px; padding: 0 1.3rem; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); font-size: .9rem; font-weight: 600; text-decoration: none; }
.nv-books-featured__dots { position: absolute; left: 50%; bottom: 1.5rem; display: flex; gap: .4rem; }
.nv-books-featured__dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: var(--nv-border); cursor: pointer; transition: width .2s ease; }
.nv-books-featured__dots [aria-selected="true"] { width: 18px; background: var(--nv-text); }
.nv-books-featured__arrows { position: absolute; right: 1.5rem; bottom: 1.25rem; display: flex; gap: .6rem; }
.nv-books-featured__arrows button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--nv-border); border-radius: 50%; color: var(--nv-text); background: var(--nv-surface); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

/* Controls: search, category, sort and the advanced-filter dialog in one GET form. */
.nv-books__controls { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .65rem; margin-bottom: 1rem; }
.nv-books__search { position: relative; display: flex; align-items: center; min-width: 0; }
.nv-books__search svg { position: absolute; left: .9rem; color: var(--nv-text-muted); pointer-events: none; }
.nv-books__search input, .nv-books__select, .nv-books__filters input[type="search"] { width: 100%; min-width: 0; height: 44px; padding: 0 .9rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: var(--nv-surface); font: inherit; font-size: .9rem; }
.nv-books__search input { padding-left: 2.6rem; }
.nv-books__advanced-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 44px; padding: 0 1.1rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: var(--nv-surface); font: inherit; font-size: .9rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.nv-books__advanced-toggle strong { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 999px; color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); font-size: .75rem; }

.nv-books__filters { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.5rem; border: 0; border-radius: var(--nv-radius-lg, 16px); color: var(--nv-text); background: var(--nv-surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.nv-books__filters::backdrop { background: rgba(0, 0, 0, .4); }
.nv-books__filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.nv-books .nv-books__filters-head h2 { margin: 0; font-family: var(--nv-books-serif); font-size: 1.3rem; }
.nv-books__filters-head button { border: 0; background: none; color: var(--nv-text-secondary); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.nv-books__filters-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.nv-books__filters-col + .nv-books__filters-col { padding-left: 1.5rem; border-left: 1px solid var(--nv-border); }
.nv-books__filters fieldset { display: flex; flex-direction: column; gap: .55rem; margin: 0 0 1.25rem; padding: 0; border: 0; }
.nv-books__filters legend { margin-bottom: .55rem; padding: 0; font-size: .85rem; font-weight: 600; }
.nv-books__filters label { display: flex; align-items: center; gap: .55rem; color: var(--nv-text-secondary); font-size: .875rem; cursor: pointer; }
.nv-books__filters legend label { color: var(--nv-text); font-size: inherit; }
.nv-books__filters input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--nv-dark, #1d1d1f); }
.nv-books__filters-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .5rem; }
.nv-books .nv-books__filters-clear { display: grid; place-items: center; height: 44px; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); font-size: .9rem; text-decoration: none; }
.nv-books__filters-actions .nv-books__apply { height: 44px; }

.nv-books__applied { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; margin-bottom: 1.5rem; font-size: .85rem; }
.nv-books__applied > span { margin-right: .25rem; color: var(--nv-text-secondary); }
.nv-books .nv-books__chip { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .75rem; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: var(--nv-books-panel); text-decoration: none; }
.nv-books__chip span { color: var(--nv-text-muted); }
.nv-books .nv-books__clear { margin-left: .5rem; color: var(--nv-text); text-decoration: underline; text-underline-offset: 3px; }

.nv-books__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.nv-books__count { margin: 0; color: var(--nv-text-secondary); font-size: .9rem; }
.nv-books__views { display: inline-flex; padding: 3px; border-radius: var(--nv-radius-sm, 6px); background: var(--nv-books-panel); }
.nv-books .nv-books__view { display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .8rem; border-radius: 5px; color: var(--nv-text); font-size: .85rem; text-decoration: none; }
.nv-books .nv-books__view.is-active { color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); }
.nv-books__footer { display: flex; justify-content: center; margin-top: 2.5rem; }

/* Catalog cards: bordered, cover on a soft panel, summary and a meta row with the bookmark. */
.nv-books .nv-book-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.nv-books .nv-book-card { gap: 0; overflow: hidden; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); background: var(--nv-surface); transition: box-shadow .2s ease; }
.nv-books .nv-book-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .07); }
.nv-books .nv-book-card__cover { aspect-ratio: 4 / 3; padding: .75rem 1rem 0; border-radius: 0; background: var(--nv-books-panel); box-shadow: none; }
.nv-books .nv-book-card__cover img { object-position: bottom; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }
.nv-books .nv-book-card__body { display: flex; flex: 1; flex-direction: column; gap: .3rem; padding: 1rem 1rem .9rem; }
.nv-books .nv-book-card__title { font-family: var(--nv-books-serif); font-size: 1.1rem; font-weight: 700; }
.nv-books .nv-book-card__summary { -webkit-line-clamp: 2; font-size: .85rem; line-height: 1.5; }
.nv-books .nv-book-card__meta { justify-content: flex-start; gap: 1.25rem; padding-top: .75rem; color: var(--nv-text-secondary); }
.nv-books .nv-book-card__rating { color: var(--nv-text-secondary); font-weight: 400; }
.nv-books .nv-book-card__rating svg { color: #f5b321; }
.nv-books .nv-book-badge { display: inline-flex; align-items: center; gap: .3rem; padding: 0; border: 0; font-size: .8rem; }
.nv-books .nv-book-card__shelf { position: static; width: 30px; height: 30px; margin-left: auto; border-radius: 6px; background: none; box-shadow: none; }
.nv-books .nv-book-card__shelf:hover { background: var(--nv-books-panel); }

.nv-books .nv-book-grid--list { grid-template-columns: 1fr; }
.nv-books .nv-book-grid--list .nv-book-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0; padding: 0; }
.nv-books .nv-book-grid--list .nv-book-card__cover { aspect-ratio: auto; height: 100%; min-height: 150px; padding: .75rem; }
.nv-books .nv-book-grid--list .nv-book-card__cover img { object-position: center; }

/* ---- Detail -------------------------------------------------------------------------------- */
.nv-book__hero { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); margin: 2rem 0 2.5rem; }
.nv-book__cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; }
.nv-book__cover img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .25)); }
.nv-book__thumbs { display: flex; gap: .75rem; justify-content: center; margin-top: 1.25rem; }
.nv-book__thumbs button { width: 64px; padding: 0; border: 1px solid var(--nv-border); background: var(--nv-surface); cursor: pointer; }
.nv-book__thumbs img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: contain; }
.nv-book__thumbs-caption { margin: .5rem 0 0; color: var(--nv-text-muted); font-size: .8rem; text-align: center; }
.nv-book__eyebrow { color: var(--nv-text-secondary); font-size: .8rem; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.nv-book__title { margin-top: .5rem; }
.nv-book__subtitle { margin: .4rem 0 1.25rem; font-size: 1.25rem; }
.nv-book__author { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.nv-book__author div { display: flex; flex-direction: column; }
.nv-book__author span:not(.nv-book__avatar) { color: var(--nv-text-muted); font-size: .8rem; }
.nv-book__avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--nv-surface); background: var(--nv-text-secondary); font-weight: 700; font-size: .9rem; }
.nv-book__stats { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; color: var(--nv-text-secondary); }
.nv-book__stars { display: inline-flex; align-items: center; gap: .15rem; }
.nv-book__stars svg, .nv-book__rate svg { fill: var(--nv-border); }
.nv-book__stars svg.is-on, .nv-book__rate .is-on svg { fill: var(--nv-text); }
.nv-book__stars strong { margin-left: .4rem; color: var(--nv-text); }
.nv-book__summary { margin: 1.25rem 0; color: var(--nv-text-secondary); font-size: 1.05rem; line-height: 1.65; }
.nv-book__editions h2 { margin: 0 0 .6rem; font-size: 1rem; }
.nv-book__edition-list { display: flex; flex-wrap: wrap; gap: .75rem; }
.nv-book__edition { display: inline-flex; align-items: center; gap: .6rem; padding: .55rem 1rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text-secondary); background: var(--nv-surface); font: inherit; font-size: .9rem; cursor: pointer; }
.nv-book__edition.is-active { border-color: var(--nv-text); color: var(--nv-text); font-weight: 600; }
.nv-book__radio { width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; }
.nv-book__edition.is-active .nv-book__radio { background: currentColor; box-shadow: inset 0 0 0 2px var(--nv-surface); }
.nv-book__specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid var(--nv-border); border-bottom: 1px solid var(--nv-border); }
.nv-book__specs div { padding: 0 1rem; border-left: 1px solid var(--nv-border); }
.nv-book__specs div:first-child { padding-left: 0; border-left: 0; }
.nv-book__specs dt { color: var(--nv-text-muted); font-size: .8rem; }
.nv-book__specs dd { margin: .25rem 0 0; font-weight: 600; }
.nv-book__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.nv-book__read { min-width: 200px; }
.nv-book__want, .nv-book__share { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 48px; padding: 0 1.4rem; border: 1px solid var(--nv-border); border-radius: var(--nv-radius-sm, 6px); color: var(--nv-text); background: var(--nv-surface); font: inherit; font-weight: 600; cursor: pointer; }
.nv-book__share { width: 48px; padding: 0; }
.nv-book__access, .nv-book__note { margin: .6rem 0 0; color: var(--nv-text-muted); font-size: .85rem; }
.nv-book__progress { margin-top: 1.5rem; }
.nv-book__progress p { margin: 0 0 .5rem; font-size: .9rem; }
.nv-book__progress-row { display: flex; align-items: center; gap: 1rem; font-size: .85rem; }
.nv-book__progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--nv-surface-alt); overflow: hidden; }
.nv-book__progress-bar span { display: block; height: 100%; background: var(--nv-text); }
.nv-book__progress-row a { color: var(--nv-text); }

.nv-book__tabs { display: flex; gap: 2.5rem; margin: 0 calc(-1 * clamp(0px, 2vw, 2rem)); padding: 0 clamp(0px, 2vw, 2rem); border-top: 1px solid var(--nv-border); border-bottom: 1px solid var(--nv-border); overflow-x: auto; }
.nv-book__tabs a { padding: 1rem 0; border-bottom: 2px solid transparent; color: var(--nv-text-secondary); white-space: nowrap; text-decoration: none; }
.nv-book__tabs a.is-active { border-bottom-color: var(--nv-text); color: var(--nv-text); font-weight: 600; }
.nv-book__body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 3rem; margin-top: 2rem; }
.nv-book__aside { padding-left: 2rem; border-left: 1px solid var(--nv-border); }
.nv-book__section { margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.nv-book__section h2 { margin: 0 0 1rem; font-size: 1.5rem; }
.nv-book__intro { color: var(--nv-text-secondary); line-height: 1.75; }
.nv-book__intro.is-collapsed { max-height: 320px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.nv-book__more { padding: 0; border: 0; color: var(--nv-text); background: none; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.nv-book__toc { margin: 0 0 1rem; padding: 0; list-style: none; }
.nv-book__toc li { display: grid; grid-template-columns: 3rem 1fr auto; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--nv-border); }
.nv-book__toc-no, .nv-book__toc-page { color: var(--nv-text-muted); }
.nv-book__facts { margin: 0; }
.nv-book__facts div { display: grid; grid-template-columns: 9rem 1fr; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--nv-border); }
.nv-book__facts dt { color: var(--nv-text-secondary); }
.nv-book__facts dd { margin: 0; }
.nv-book__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.nv-book__tags a { padding: .2rem .7rem; border: 1px solid var(--nv-border); border-radius: 999px; color: var(--nv-text-secondary); font-size: .85rem; text-decoration: none; }
.nv-book__quote { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; margin: 0 calc(-1 * clamp(0px, 2vw, 2rem)) 2.5rem; padding: 2.25rem clamp(1.25rem, 3vw, 2.5rem); background: var(--nv-surface-alt); scroll-margin-top: 5rem; }
.nv-book__quote blockquote { margin: 0; }
.nv-book__quote blockquote p { margin: 0; font-family: var(--nv-font-display); font-size: clamp(14px, 2.5vw, 16px); font-style: italic; }
.nv-book__quote blockquote p::before { content: "\201C"; margin-right: .5rem; color: var(--nv-text-muted); }
.nv-book__quote footer { margin-top: .5rem; color: var(--nv-text-muted); font-size: .85rem; }
.nv-book__quote-list { grid-column: 1 / -1; margin: 0; padding-left: 1.25rem; }
.nv-book__quote-link { color: var(--nv-text); white-space: nowrap; }
.nv-book__rate { display: flex; align-items: center; gap: .25rem; }
.nv-book__rate button { padding: .2rem; border: 0; background: none; cursor: pointer; }
.nv-book__rate button:hover svg, .nv-book__rate button:focus-visible svg { fill: var(--nv-text-secondary); }
.nv-book__rate-hint { margin-left: .75rem; color: var(--nv-text-muted); font-size: .85rem; }
.nv-book__related-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.25rem; }
.nv-book__related-head h2 { margin: 0; font-size: 1.5rem; }
.nv-book__related-head a { color: var(--nv-text); }
.nv-book__related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem; }
.nv-related-card { display: flex; flex-direction: column; gap: .4rem; color: var(--nv-text); text-decoration: none; }
.nv-related-card__image { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; background: var(--nv-book-cover-bg, var(--nv-surface-alt)); }
.nv-related-card__image img { width: 100%; height: 100%; object-fit: contain; }
.nv-related-card:not(.nv-related-card--book) .nv-related-card__image { aspect-ratio: 16 / 9; }
.nv-related-card:not(.nv-related-card--book) .nv-related-card__image img { object-fit: cover; }
.nv-related-card span:last-child { color: var(--nv-text-secondary); font-size: .875rem; }

/* ---- Reader -------------------------------------------------------------------------------- */
.nv-book-reader { max-width: 720px; padding-top: 2rem; text-align: center; }
.nv-book-reader__back { display: inline-block; margin-bottom: 1.5rem; color: var(--nv-text-secondary); }
.nv-book-reader__title { margin: 0; font-family: var(--nv-font-display); }
.nv-book-reader__mode { color: var(--nv-text-secondary); }
.nv-book-reader__editions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1rem 0; }
.nv-book-reader__editions a { padding: .3rem .8rem; border: 1px solid var(--nv-border); border-radius: 6px; color: var(--nv-text); text-decoration: none; }
.nv-book-reader__editions .is-active { border-color: var(--nv-text); font-weight: 600; }
.nv-book-reader__open { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.5rem; padding: .9rem 1.6rem; border-radius: var(--nv-radius-sm, 6px); color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); font-weight: 600; text-decoration: none; }
.nv-book-reader__hint { color: var(--nv-text-muted); font-size: .85rem; }

/* ---- /wiki mixed listing ------------------------------------------------------------------- */
.nv-content-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.nv-content-filter a { padding: .35rem .9rem; border: 1px solid var(--nv-border); border-radius: 999px; color: var(--nv-text); font-size: .9rem; text-decoration: none; }
.nv-content-filter a.is-active { border-color: transparent; color: var(--nv-button-text, #fff); background: var(--nv-button-bg, var(--nv-dark, #1d1d1f)); }
.nv-content-filter span { margin-left: .35rem; opacity: .7; }
.nv-home-grid .nv-book-card { padding: .25rem; }

@media (max-width: 960px) {
    .nv-book__hero, .nv-book__body { grid-template-columns: 1fr; }
    .nv-book__gallery { max-width: 300px; margin: 0 auto; }
    .nv-book__aside { padding-left: 0; border-left: 0; }
    .nv-books__controls { grid-template-columns: 1fr 1fr; }
    .nv-books__search, .nv-books__advanced-toggle { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .nv-book-card { gap: .55rem; }
    .nv-book-card__cover { padding: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .09); }
    .nv-book-card__cover img { object-fit: contain; filter: none; }
    .nv-book-card__shelf { top: .5rem; right: .5rem; width: 36px; height: 36px; border-radius: 8px; background: color-mix(in srgb, var(--nv-surface) 94%, transparent); box-shadow: 0 1px 5px rgba(0, 0, 0, .08); }
    .nv-book-card__title { font-size: .95rem; line-height: 1.4; }
    .nv-book-card__author { margin-top: .2rem; line-height: 1.45; }
    .nv-book-card__meta { margin-top: .55rem; }
    .nv-book-card__rating svg { color: #f5b321; }
    .nv-book__specs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; }
    .nv-book__specs div:nth-child(3) { padding-left: 0; border-left: 0; }
    .nv-book__quote { grid-template-columns: 1fr; }
    .nv-book__facts div { grid-template-columns: 7rem 1fr; }
    .nv-book__tabs { gap: 1.5rem; }
    .nv-books { padding-bottom: 2rem; }
    .nv-books .nv-breadcrumb { margin-top: 1rem; }
    .nv-books__header { flex-direction: column; align-items: stretch; margin: 1rem 0 1.25rem; }
    .nv-books .nv-books__title { font-size: clamp(1.7rem, 8vw, 2.1rem); }
    .nv-books__intro { font-size: .95rem; }
    .nv-books__shelf-link { align-self: flex-end; height: 40px; }
    .nv-books-featured { padding: 1.25rem 1rem 1.5rem; }
    .nv-books-featured__slide { grid-template-columns: 1fr; gap: 1.25rem; }
    .nv-books-featured__cover { width: min(48%, 170px); margin: 0 auto 1.5rem; }
    .nv-books-featured__copy { padding-bottom: 0; }
    .nv-books-featured__summary { -webkit-line-clamp: 2; }
    .nv-books-featured__dots { position: static; justify-content: center; margin-top: 1.25rem; }
    .nv-books-featured__arrows { top: calc(min(48vw, 170px) * .75); right: .75rem; left: .75rem; bottom: auto; justify-content: space-between; pointer-events: none; }
    .nv-books-featured__arrows button { pointer-events: auto; }
    .nv-books__views .nv-books__view span { display: none; }
    .nv-books .nv-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .nv-books .nv-book-grid--list { grid-template-columns: 1fr; }
    .nv-books .nv-book-card__body { padding: .75rem; }
    .nv-books .nv-book-card__title { font-size: 1rem; }
    .nv-books .nv-book-card__summary { display: none; }
    .nv-books .nv-book-card__meta { gap: .75rem; }
    .nv-books .nv-book-grid--list .nv-book-card { grid-template-columns: 96px minmax(0, 1fr); }
    .nv-books .nv-book-grid--list .nv-book-card__cover { min-height: 120px; }
}

/* Button-styled links: the site's content link colour is more specific than a single class. */
.nv-book a.nv-book__read, .nv-book-reader a.nv-book__read, .nv-book-reader a.nv-book-reader__open,
.nv-content-filter a.is-active { color: var(--nv-button-text, #fff); }

/* "Report an issue": discreet text action on the book page and in the reader. */
.nv-book__report { margin: 24px 0 8px; font-size: var(--fs-sm, 13px); }
.nv-book__report-link { padding: 4px 0; border: 0; background: none; color: var(--nv-text-secondary, #666); font: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.nv-book__report-link:hover, .nv-book__report-link:focus-visible { color: var(--nv-text, #111); }
.nv-book-report { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.nv-book-report__form { margin: 0; border: 0; padding: 0; }
.nv-book-report__title { margin: 0 0 4px; font-size: 1.15rem; }
.nv-book-report__context, .nv-book-report__hint { margin: 0; color: var(--nv-text-secondary, #666); font-size: var(--fs-sm, 13px); }
.nv-book-report__error { margin: 0; color: var(--nv-danger, #b42318); font-size: var(--fs-sm, 13px); }
.nv-book-report__page { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.nv-book-report__page legend { width: 100%; }
.nv-book-report__page input[type="number"] { width: 110px; }

/* Book editor preview (POST /preview/books): a clear, non-dismissable notice above the real template. */
.nv-book__preview-banner { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 12px 0 4px; padding: 10px 14px;
    border: 1px dashed var(--color-warning, #b7791f); border-radius: 10px; background: color-mix(in srgb, var(--color-warning, #b7791f) 10%, transparent); font-size: var(--fs-sm, 13px); }
.nv-book__preview-banner strong { text-transform: uppercase; letter-spacing: .04em; }
[data-nv-book-preview="true"] [data-nv-book-read], [data-nv-book-preview="true"] [data-nv-book-shelf-toggle], [data-nv-book-preview="true"] [data-nv-book-rate] button,
[data-nv-book-preview="true"] [data-nv-book-report] { cursor: not-allowed; }

/* External PDF sources on the reader page. */
.nv-book-reader__external { margin-top: 12px; display: grid; gap: 8px; justify-items: start; }
