/* Yezbi Bookshelf, as book-themed as it can be (Derek, November 19, 2026: "Maybe use a paper look, and maybe use
   [spines] of books or library shelves, or just make it as book-themed as possible"). Loaded last on every page with
   the header, after css/bookshelf-look.css. It draws; it never moves a control, hides anything or changes a word:
   - the desk: Homeschool's parchment with its faint grain and a little morning sun (Light, a sunny reading room), or
     walnut with a faint vertical grain under a lamp's glow (Dark, a wood-paneled library at night). Only the desk has
     texture; cards, sheets and panels are plain paper, so no words sit on texture;
   - books as books: every cover has a cloth hinge at its binding and a page block at its fore-edge, and lifts a little
     on hover (not when the device asks for less motion);
   - library shelves: in the list each book stands on a wooden shelf that runs the width of the bookcase; in the covers
     view each row of books stands on one shelf. The shelf is the row's ::after, a grid item between the book and its
     buttons, so the cover always touches it; the book's words and buttons are where they were;
   - library labels: the shelf's book count, the "Yezbi apps" headings and the pages' eyebrows in brass label holders
     with a paper card (dark ink on the card, 4.5:1 or better); headings and book titles in a book serif with a
     card-catalog double rule under section headings;
   - binding: a cloth spine on the left of the book details, the account panel, the Help card, the feedback sheet and
     the dialogs; a stack of pages under each card; a ribbon bookmark on the open book;
   - book spines standing on a shelf in the empty shelf, family shelf setup, the front door and the Family plan's card.
   Colors are the --bs-* tokens in css/bookshelf-brand.css. css/bookshelf.css (lent to Homeschool) is untouched;
   Homeschool does not load this file. */

/* ================= The desk ================= */
/* Light: Homeschool's faint paper grain (its css/app/palette.css) and morning sun from the top left. */
html[data-yezbi-app="bookshelf"]:not([data-yezbi-theme="dark"]) body:is(.bookshelf-app,.bs-page){background:radial-gradient(ellipse 70% 55% at 10% 0%,rgba(255,248,228,.75),rgba(255,248,228,0) 70%),url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.006 0.22' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.231 0 0 0 0 0.180 0 0 0 0 0.125 0 0 0 0.044 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.231 0 0 0 0 0.180 0 0 0 0 0.125 0 0 0 0.072 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),var(--bs-bg)}
/* Dark: a reading lamp's warm glow at the top and the faint vertical grain of walnut paneling. */
html[data-yezbi-app="bookshelf"][data-yezbi-theme="dark"] body:is(.bookshelf-app,.bs-page){background:radial-gradient(ellipse 60% 45% at 50% -6%,rgba(255,190,110,.11),rgba(255,190,110,0) 70%),url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.945 0 0 0 0 0.910 0 0 0 0 0.847 0 0 0 0.035 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),var(--bs-bg)}

/* ================= The header: Homeschool's paper bar with a stack of pages along its edge ================= */
html[data-yezbi-app="bookshelf"] .bs-shell-bar,html[data-yezbi-app="bookshelf"] .bs-shell-bar.is-scrolled{box-shadow:0 1px 0 var(--bs-rule),0 3px 0 var(--bs-header),0 4px 0 var(--bs-rule)}
html[data-yezbi-app="bookshelf"][data-yezbi-theme="dark"] .bs-shell-bar,html[data-yezbi-app="bookshelf"][data-yezbi-theme="dark"] .bs-shell-bar.is-scrolled{box-shadow:0 1px 0 var(--bs-rule),0 6px 14px rgba(0,0,0,.35)}
/* What's chosen in the bar and the menu is kraft with the ink edge (Homeschool's paper "what's chosen"). */
:root .bs-shell-bar .bs-shell-center .shelf-views button[aria-pressed="true"],:root .bs-shell-bar .bs-shell-tool[aria-current="page"],:root .bs-shell-bar button.bs-shell-tool[aria-expanded="true"],:root .bs-shell-bar .bs-shell-nav .bs-shell-item[aria-current="page"]{background:var(--bs-sel);border-color:var(--bs-primary);color:var(--bs-primary-on-soft)}
:root .bs-shell-bar .bs-shell-menu[aria-expanded="true"]{background:var(--bs-sel);color:var(--bs-primary-on-soft)}

/* ================= Type: a book serif for headings and book titles ================= */
:root body.bookshelf-app :is(.shelf-page-heading h1,.shelf-card>h2,.shelf-dialog h2,#shelf-capture h2,#hh-appearance-dialog h2),
:root body.bookshelf-app #shelf-manage :is(.shelf-panel-header h2,h3),
:root body.bookshelf-app .bookshelf-page .shelf-book-title,
:root body.bs-page main :is(h1,h2),
:root .bs-signin h1,
html dialog.bs-feedback h2{font-family:var(--bs-font-book);letter-spacing:0}
:root body.bookshelf-app .shelf-page-heading h1,:root body.bs-page main h1,:root .bs-signin h1{font-size:30px;line-height:1.15}
@media(max-width:767px){:root body.bookshelf-app .shelf-page-heading h1,:root body.bs-page main h1,:root .bs-signin h1{font-size:26px}}
/* Section headings with a card-catalog double rule under them. */
:root body.bookshelf-app .bookshelf-page .shelf-card>h2,:root body.bs-page.learning-surface main section>h2,:root body.bookshelf-app #shelf-manage #shelf-panel-content h3{padding-bottom:6px;border-bottom:3px double var(--bs-rule)}

/* ================= Library labels: a brass label holder with a paper card ================= */
/* The words keep their own case (no text-transform: what the page reads, and what a screen reader says, is unchanged);
   the eyebrows were capitals before and stay so. */
:root body.bookshelf-app #shelf-count,:root .bs-shell-bar .bs-shell-h,:root body.bs-page.learning-surface .learning-banner,:root .bs-signin .bs-eyebrow{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:max-content;max-width:100%;margin:0;padding:3px 17px;border:2px solid var(--bs-brass);border-radius:4px;background:var(--bs-label);color:var(--bs-label-ink);font:700 13px/1.35 var(--bs-font);letter-spacing:.03em;white-space:nowrap;box-shadow:inset 0 0 0 1px var(--bs-brass-light),0 1px 2px rgba(40,25,5,.28)}
/* The holder's two small screws, in the card's margins, never under its words. */
:root body.bookshelf-app #shelf-count::before,:root body.bookshelf-app #shelf-count::after,:root .bs-shell-bar .bs-shell-h::before,:root .bs-shell-bar .bs-shell-h::after,:root body.bs-page.learning-surface .learning-banner::before,:root body.bs-page.learning-surface .learning-banner::after,:root .bs-signin .bs-eyebrow::before,:root .bs-signin .bs-eyebrow::after{content:"";position:absolute;top:50%;width:5px;height:5px;margin-top:-2.5px;border-radius:50%;background:radial-gradient(circle at 35% 35%,var(--bs-brass-light),var(--bs-brass) 75%);box-shadow:0 0 0 .5px rgba(60,40,10,.35)}
:root body.bookshelf-app #shelf-count::before,:root .bs-shell-bar .bs-shell-h::before,:root body.bs-page.learning-surface .learning-banner::before,:root .bs-signin .bs-eyebrow::before{left:5px}
:root body.bookshelf-app #shelf-count::after,:root .bs-shell-bar .bs-shell-h::after,:root body.bs-page.learning-surface .learning-banner::after,:root .bs-signin .bs-eyebrow::after{right:5px}
:root .bs-shell-bar .bs-shell-h{align-self:flex-start;margin:10px 24px 6px}
:root body.bs-page.learning-surface .learning-banner{margin-bottom:6px}

/* ================= Paper: cards with a stack of pages under them ================= */
:root body.bookshelf-app .bookshelf-page .shelf-card,:root body.bs-page.learning-surface main :is(section,article):not(:is(section,article) *),:root body.bs-page.learning-surface main .bs-family-form{box-shadow:0 1px 0 var(--bs-rule),0 4px 0 -2px var(--bs-surface),0 5px 0 -2px var(--bs-rule),0 8px 0 -4px var(--bs-surface),0 9px 0 -4px var(--bs-rule),var(--bs-shadow)}
/* The status note under the header is a kraft slip. */
:root body.bookshelf-app #shelf-status:not(:empty){background:var(--bs-sel)}
/* The page's own view switch (phones) and what's chosen elsewhere: kraft with the ink edge. */
:root body.bookshelf-app .bookshelf-page .shelf-shortcuts [aria-pressed="true"],html dialog.bs-feedback .bs-fb-kind[aria-pressed="true"]{background:var(--bs-sel);border-color:var(--bs-primary);color:var(--bs-primary-on-soft)}

/* ================= Binding: a cloth spine on the left of the book details, panels and sheets ================= */
:root body.bookshelf-app #shelf-manage[data-mode][open]{box-shadow:inset 7px 0 0 var(--bs-cloth),inset 8px 0 0 var(--bs-cloth-edge)}
@media(min-width:768px){:root body.bookshelf-app #shelf-manage[data-mode=modal][open]{box-shadow:inset 7px 0 0 var(--bs-cloth),inset 8px 0 0 var(--bs-cloth-edge),var(--bs-shadow-raised)}}
/* The details' pinned Save bar (and, on a phone, its pinned header) span the panel, so they carry the binding across. */
@media(max-width:767px){:root body.bookshelf-app #shelf-manage[data-mode=modal] .shelf-panel-header{box-shadow:inset 7px 0 0 var(--bs-cloth),inset 8px 0 0 var(--bs-cloth-edge)}}
:root body.bookshelf-app #shelf-manage .shelf-form-actions{box-shadow:inset 7px 0 0 var(--bs-cloth),inset 8px 0 0 var(--bs-cloth-edge),0 -6px 14px rgb(0 0 0/.12)}
:root .bs-shell-bar :is(.bs-shell-account,.bs-shell-help):not([hidden]),html dialog.bs-feedback,:root body.bookshelf-app :is(.shelf-dialog:not([data-mode=side]),#shelf-capture,#hh-appearance-dialog){box-shadow:inset 7px 0 0 var(--bs-cloth),inset 8px 0 0 var(--bs-cloth-edge),var(--bs-shadow-raised)}
/* A book's reading history: each entry a small catalog card with its red rule. */
:root body.bookshelf-app #shelf-manage [data-reading-history] article{margin:8px 0;padding:10px 12px;border:0;border-top:2px solid var(--bs-ribbon);border-radius:4px;background:var(--bs-raised)}

/* ================= Books: a hinge at the binding, a page block at the fore-edge ================= */
:root body.bookshelf-app :is(.bookshelf-page,#shelf-manage) .shelf-cover-frame{overflow:hidden;border-radius:2px 5px 5px 2px;background:var(--bs-wood-deep);box-shadow:2px 0 0 -1px var(--bs-pages),3px 0 0 -1px var(--bs-pages-edge),4px 0 0 -2px var(--bs-pages),5px 0 0 -2px var(--bs-pages-edge),5px 4px 9px -4px var(--bs-wood-shadow);transition:transform .18s ease-out}
:root body.bookshelf-app :is(.bookshelf-page,#shelf-manage) .shelf-cover-frame::after{content:"";position:absolute;z-index:2;top:0;bottom:0;left:0;width:8px;pointer-events:none;background:linear-gradient(90deg,rgba(0,0,0,.36) 0 2px,rgba(255,255,255,.28) 2px 3px,rgba(0,0,0,.16) 3px 5px,rgba(0,0,0,0) 8px)}
/* The cloth hinge replaces the spine's old dark edge; the words keep clear of it. */
:root body.bookshelf-app .shelf-cover-spine{border-left:0;padding-left:11px}
/* A book lifts a little off its shelf under the pointer. */
@media(hover:hover){:root body.bookshelf-app .bookshelf-page .shelf-inventory-book:hover .shelf-cover-frame{transform:translateY(-3px)}}
/* The open book: kraft behind it, the ink edge at its side and a ribbon bookmark in its cover. */
:root body.bookshelf-app .bookshelf-page .shelf-inventory .shelf-inventory-book:is(.is-open,.is-new){outline:0;border-radius:0;background:var(--bs-sel);box-shadow:inset 4px 0 0 var(--bs-primary)}
:root body.bookshelf-app .bookshelf-page .shelf-inventory-book:is(.is-open,.is-new) .shelf-cover-frame::before{content:"";position:absolute;z-index:3;top:0;right:9px;width:10px;height:42%;background:var(--bs-ribbon);clip-path:polygon(0 0,100% 0,100% 100%,50% 78%,0 100%)}

/* ================= The list: each book stands on a wooden shelf ================= */
/* The shelf: lit front edge, the top seen from above, then the front board with a little light along it. */
:root{--bs-plank:linear-gradient(90deg,rgba(0,0,0,.07),rgba(0,0,0,0) 25%,rgba(255,255,255,.07) 55%,rgba(0,0,0,0) 80%,rgba(0,0,0,.06)),linear-gradient(var(--bs-wood-top) 0,var(--bs-wood-top) 3px,var(--bs-wood-lip) 3px,var(--bs-wood-lip) 4px,var(--bs-wood) 4px,var(--bs-wood-deep) 100%)}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book{--shelf-bleed:34px;position:relative;row-gap:0;padding:14px 10px 0;border:0;border-radius:0}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book:first-child{padding-top:8px}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>:is(.shelf-pick,.shelf-cover,.shelf-book-summary){grid-row:1}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-pick{align-self:start}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-cover{align-self:end}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-book-summary{padding-bottom:14px}
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book::after{content:"";grid-row:2;grid-column:1/-1;display:block;height:12px;margin:0 calc(-1*var(--shelf-bleed-end,var(--shelf-bleed))) 0 calc(-1*var(--shelf-bleed));border-radius:1px;background:var(--bs-plank);box-shadow:0 6px 7px -5px var(--bs-wood-shadow);pointer-events:none}
/* The book's buttons sit under its shelf, close to it, with room before the next book. */
:root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-row-actions{grid-row:3;margin-top:10px;margin-bottom:6px}
/* Tablets: a book-shaped cover. */
@media(min-width:768px) and (max-width:1099px){
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book{grid-template-columns:24px 56px minmax(0,1fr)}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-cover{width:56px;height:84px}
}
/* Laptops: the buttons stay beside the book, so the shelf runs under all of it. */
@media(min-width:1100px){
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-row-actions{grid-row:1;align-self:start;margin:0 0 10px}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book::after{margin-bottom:6px}
 /* With a book's details open beside the list, the shelves stop short of them. */
 :root body.bookshelf-app #shelf-workspace.has-book-panel .shelf-inventory-book{--shelf-bleed-end:19px}
}
/* Phones: the bookcase's sides are closer. */
@media(max-width:767px){
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book{--shelf-bleed:22px;padding:14px 6px 0}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book:first-child{padding-top:6px}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-book-summary{padding-bottom:12px}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory:not(.shelf-cover-grid) .shelf-inventory-book>.shelf-row-actions{margin:10px 0 8px}
}

/* ================= The covers view: each row of books stands on one shelf ================= */
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid{column-gap:10px;row-gap:26px}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book{--shelf-bleed:14px;position:relative;row-gap:0;align-content:start;padding:6px 8px 0;border:0;border-radius:0;background:transparent}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book>:is(.shelf-pick,.shelf-cover){grid-row:1}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book>.shelf-pick{align-self:start}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book>.shelf-cover{grid-column:2;justify-self:center;align-self:end;width:min(100%,116px);height:auto;aspect-ratio:2/3}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book::after{content:"";grid-row:2;grid-column:1/-1;display:block;height:12px;margin:0 calc(-1*var(--shelf-bleed));border-radius:1px;background:var(--bs-plank);box-shadow:0 6px 7px -5px var(--bs-wood-shadow);pointer-events:none}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book>.shelf-book-summary{grid-row:3;grid-column:1/-1;padding-top:12px}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-inventory-book>.shelf-row-actions{grid-row:4;grid-column:1/-1;margin-top:10px}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-spine-title{font-size:.82rem}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-spine-author{font-size:.7rem}
:root body.bookshelf-app .bookshelf-page .shelf-cover-grid .shelf-cover-spine{padding:10px 8px 10px 14px}

/* ================= Book spines on a shelf: the empty shelf, family shelf setup and the front door ================= */
/* Six cloth spines with gilt bands, one book leaning, on a short shelf (140 × 64px; CSS only). */
:root{--bs-spines:
 linear-gradient(transparent 5px,rgba(236,205,138,.85) 5px 7px,transparent 7px calc(100% - 9px),rgba(236,205,138,.85) calc(100% - 9px) calc(100% - 7px),transparent 0) 12px 10px/14px 46px no-repeat,linear-gradient(#7A3B2E,#7A3B2E) 12px 10px/14px 46px no-repeat,
 linear-gradient(transparent 6px,rgba(236,205,138,.85) 6px 8px,transparent 8px) 27px 4px/11px 52px no-repeat,linear-gradient(#2E4A7A,#2E4A7A) 27px 4px/11px 52px no-repeat,
 linear-gradient(transparent 5px,rgba(236,205,138,.85) 5px 7px,transparent 7px calc(100% - 8px),rgba(236,205,138,.85) calc(100% - 8px) calc(100% - 6px),transparent 0) 39px 16px/16px 40px no-repeat,linear-gradient(#2F5D50,#2F5D50) 39px 16px/16px 40px no-repeat,
 linear-gradient(transparent 7px,rgba(236,205,138,.85) 7px 9px,transparent 9px) 56px 8px/12px 48px no-repeat,linear-gradient(#6B5A1E,#6B5A1E) 56px 8px/12px 48px no-repeat,
 linear-gradient(transparent 5px,rgba(236,205,138,.85) 5px 7px,transparent 7px calc(100% - 9px),rgba(236,205,138,.85) calc(100% - 9px) calc(100% - 7px),transparent 0) 69px 2px/15px 54px no-repeat,linear-gradient(#5B3A6E,#5B3A6E) 69px 2px/15px 54px no-repeat,
 linear-gradient(#7A2F4F,#7A2F4F) 85px 12px/10px 44px no-repeat,
 linear-gradient(-68deg,transparent 0 41%,#345E2A 41% 63%,transparent 63%) 95px 14px/36px 42px no-repeat,
 linear-gradient(var(--bs-wood-top) 0 3px,var(--bs-wood-lip) 3px 4px,var(--bs-wood) 4px,var(--bs-wood-deep)) 0 56px/140px 8px no-repeat}
:root body.bookshelf-app #shelf-list>p:is(:only-child,:has(+.shelf-empty-actions:last-child)){display:flow-root;text-align:center;color:var(--bs-muted)}
:root body.bookshelf-app #shelf-list>p:is(:only-child,:has(+.shelf-empty-actions:last-child))::before,:root body.bs-page main .bs-family-form::before,:root .bs-signin::before,:root body .bs-plan-card::before{content:"";display:block;width:140px;height:64px;margin:4px auto 14px;background:var(--bs-spines);filter:drop-shadow(0 3px 2px var(--bs-wood-shadow))}
:root body.bs-page main .bs-family-form::before{margin:0 0 16px}
:root .bs-signin::before{margin:8px auto 12px}
/* The Family plan's card (js/bookshelf-plan.js): the shelf above its heading, at the card's start. */
:root body .bs-plan-card::before{margin:0 0 14px}

/* ================= Less motion: nothing moves or fades ================= */
@media(prefers-reduced-motion:reduce){
 :root body.bookshelf-app :is(.bookshelf-page,#shelf-manage) .shelf-cover-frame,:root body.bookshelf-app .shelf-cover-frame>img{transition:none}
 :root body.bookshelf-app .bookshelf-page .shelf-inventory-book:hover .shelf-cover-frame{transform:none}
 :root .bs-shell-bar :is(.bs-shell-nav.is-open,.bs-shell-scrim,.bs-shell-account,.bs-shell-help){animation:none}
 :root .bs-shell-bar{transition:none}
}
/* Forced colors: the drawings step back; the system draws the labels' edges. */
@media(forced-colors:active){
 :root body.bookshelf-app .bookshelf-page .shelf-inventory-book::after{background:CanvasText;forced-color-adjust:none;height:3px}
 :root body.bookshelf-app #shelf-list>p:is(:only-child,:has(+.shelf-empty-actions:last-child))::before,:root body.bs-page main .bs-family-form::before,:root .bs-signin::before,:root body .bs-plan-card::before{display:none}
}
