/*
 * Pip Reader, the app (Shelf_Brief.md; look: Visual_Design.md). Ink on cream
 * in every theme. Colours come from tokens.css; a series' own colour and a
 * speaker's ink and fill come from the book data, set inline as --c / --f.
 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface-page);
  color: var(--text-ink);
  font-family: var(--font);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--pip-ink); outline-offset: 2px; }
h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.app { max-width: 1100px; margin: 0 auto; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; min-height: 64px; }
.grow { flex: 1; }
.bartitle { font-size: 20px; }
.muted { color: var(--text-quiet); }
.small { font-size: 15px; margin: -6px 0 0; }
.count { text-align: center; color: var(--text-quiet); margin: 0; font-size: 17px; }

.iconbtn { width: 48px; height: 48px; border-radius: 999px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text-ink); flex: none; }
.iconbtn:active { background: var(--surface-sunk); }
.iconbtn:disabled { opacity: 0.25; }
.quietbtn { opacity: 0.55; }
.btn {
  min-height: var(--button-height); border-radius: var(--radius-button); font-size: 20px; font-weight: 700; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; user-select: none;
  border: 2px solid var(--action-primary-bg); background: var(--action-primary-bg); color: var(--action-primary-fg);
}
.btn.out { background: transparent; color: var(--text-ink); }
.btn.wide { width: min(100%, 360px); }
.btn svg { flex: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.textbtn { border: 0; background: none; font-size: 18px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; padding: 8px; }
.textbtn.quiet { color: var(--text-quiet); font-size: 16px; }
.linkbtn { border: 0; background: none; text-decoration: underline; font-size: 16px; padding: 4px; color: var(--text-ink); }
.gu { position: relative; height: 48px; padding: 0 12px; white-space: nowrap; flex: none; border: 2px solid var(--pip-ink); border-radius: var(--radius-button); background: transparent; font-size: 18px; font-weight: 700; }
.gu .dot { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 99px; background: var(--pip-ink); border: 2px solid var(--surface-page); }
.cover { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-cover); background: var(--surface-sunk); box-shadow: var(--shadow-book); }
.pill { background: var(--surface-card); color: var(--pip-ink); border: 1.5px solid var(--line-draw); font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 99px; line-height: 1.3; } /* a chip, not a black slab (founder 2026-10-19) */
.tick { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 99px; background: var(--pip-ink); color: var(--pip-cream); display: grid; place-items: center; border: 2px solid var(--surface-page); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--pip-ink); color: var(--pip-cream); padding: 10px 16px; border-radius: 12px; z-index: 9; max-width: 90%; text-align: center; }
.wiggle { animation: wig 0.35s; }
@keyframes wig { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- discs: reader faces on cream ---------- */
.disc { width: 44px; height: 44px; border-radius: 999px; border: 0; padding: 0; background: var(--face-disc); display: grid; place-items: center; flex: none; overflow: hidden; color: var(--text-ink); font-size: 20px; }
.disc img { width: 100%; height: 100%; display: block; pointer-events: none; }
.disc.on { width: 64px; height: 64px; font-size: 28px; box-shadow: 0 0 0 3px var(--surface-page), 0 0 0 6px var(--pip-ink); }
.disc.add { background: transparent; border: 2px dashed var(--text-quiet); color: var(--text-quiet); }
.readers { display: flex; gap: 10px; align-items: center; padding: 6px; overflow-x: auto; }

/* ---------- the collage (Shelf_Brief § 7.1) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; }
.wordmark img { width: 30px; height: 30px; }
.pick { margin: 0 16px 4px; font-size: 18px; color: var(--text-quiet); text-align: center; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; padding: 16px 16px 48px; max-width: 560px; margin: 0 auto; width: 100%; }
.tile:nth-child(even) { margin-top: 56px; }
.tile:last-child:nth-child(odd) { grid-column: 1 / -1; width: 50%; justify-self: center; }
.tile {
  border: 0; background: none; padding: 6px; display: grid; justify-items: center; gap: 8px; color: var(--text-ink);
  transform: rotate(var(--tilt)); transition: transform 0.12s ease-out; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tile.lift { transform: rotate(0deg) scale(1.06) translateY(-4px); }
.tile-disc { width: min(100%, 170px); aspect-ratio: 1; border-radius: 999px; display: block; position: relative; background: color-mix(in srgb, var(--sc) 38%, var(--surface-page)); }
.tile-art { position: absolute; inset: 0; width: 100%; height: 100%; animation: breathe 3.2s ease-in-out infinite; animation-delay: calc(var(--breathe) * -1); pointer-events: none; }
.tile-name { font-size: 20px; font-weight: 700; }
@keyframes breathe { 50% { transform: scale(1.025); } }
.hello { max-width: 520px; gap: 12px; }
.hello h2 { font-size: 26px; }
@media (min-width: 800px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 860px; } .tile-disc { width: min(100%, 230px); } .tile-name { font-size: 24px; } .tile:nth-child(even) { margin-top: 0; } .tile:nth-child(3n + 2) { margin-top: 56px; } .tile:last-child:nth-child(odd) { grid-column: auto; width: auto; } }

/* ---------- the shelf (§ 3) ---------- */
.scroll { padding: 4px 16px 32px; }
.shelfgrid { display: grid; gap: 18px; }
.next { display: grid; gap: 12px; justify-items: center; }
.next .kr { font-size: 18px; font-weight: 700; color: var(--text-quiet); margin: 0; }
.covwrap { width: 160px; border: 0; padding: 0; background: none; }
.nexttext { display: grid; gap: 2px; text-align: center; }
.next .ttl { font-size: 26px; font-weight: 700; margin: 0; text-wrap: balance; }
.next .sub { margin: 0; color: var(--text-quiet); font-size: 17px; }
.next .pair { max-width: 460px; }
.rows { display: grid; gap: 8px; min-width: 0; }
.srow { display: grid; gap: 2px; min-width: 0; }
.slabel { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; border: 0; background: none; padding: 4px 0; text-align: left; color: var(--text-ink); }
.slabel b { font-size: 20px; }
.fc { display: flex; flex: none; border: 0; background: none; padding: 0; }
.fc img { width: 32px; height: 32px; border-radius: 99px; background: var(--face-disc); border: 2px solid var(--surface-page); margin-left: -8px; }
.fc img:first-child { margin-left: 0; }
.chev { color: var(--text-quiet); display: inline-flex; }
.thumbs { display: flex; gap: 14px; overflow-x: auto; padding: 9px 9px 14px; margin: 0 -9px; scroll-padding-inline: 9px; scroll-snap-type: x proximity; }
.thumb { position: relative; flex: none; width: 140px; border: 0; padding: 0; background: none; scroll-snap-align: start; text-align: left; color: var(--text-ink); }
.cvr { position: relative; display: block; }
.thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-cover); display: block; background: var(--surface-sunk); }
.thumb.isnext img { box-shadow: 0 0 0 3px var(--surface-page), 0 0 0 6px var(--pip-ink); }
.num { position: absolute; bottom: 6px; left: 6px; min-width: 24px; height: 24px; border-radius: 99px; background: var(--surface-card); color: var(--pip-ink); border: 1.5px solid var(--line-draw); font-size: 14px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.thumb .pill { position: absolute; bottom: 6px; right: 6px; }
/* On a cover the tick is the number's twin: same disc, same inset, same baseline (founder 2026-10-13). */
.cvr .tick { right: 6px; bottom: 6px; width: 24px; height: 24px; border: 0; }
.sechead { font-size: 20px; font-weight: 700; margin: 6px 0 0; }
@media (min-width: 800px) {
  .shelfgrid { grid-template-columns: 360px minmax(0, 1fr); align-items: start; gap: 28px; }
  .next { position: sticky; top: 12px; }
  .covwrap { width: 100%; }
  .thumb, }

/* ---------- a series page (§ 3.1) ---------- */
.shead { display: flex; align-items: center; gap: 12px; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.fc.mid img { width: 48px; height: 48px; margin-left: -12px; border-width: 2px; }
.fc.mid img:first-child { margin-left: 0; }
.sname { display: grid; min-width: 0; }
.shead h2 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shead .count { text-align: left; font-size: 15px; }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 4px 0 12px; }
.sgrid .thumb, .sgrid .stitle { font-size: 16px; margin: 8px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forgrown { text-align: center; padding: 4px 0 24px; }
@media (min-width: 800px) { .sgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- the cover (§ 5) ---------- */
.coverscreen .body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 0 20px 24px; align-items: center; }
/* Above centre (founder 2026-10-23: the cover sat too low): one part of the space above, two below; 28px to the buttons. */
.coverscreen .body::before { content: ""; flex: 1; }
.coverscreen .body::after { content: ""; flex: 2; }
/* One layout at every size (founder 2026-10-13): the cover as large as the window allows, the two equal buttons side by side under it. */
.coverscreen .big { width: min(84vw, calc(62dvh * 0.75), 460px); margin-bottom: 12px; }
.coverscreen .ded { margin: 0; color: var(--text-quiet); font-size: 17px; min-height: 1.4em; }
.coverscreen .pair { width: min(100%, max(min(84vw, calc(62dvh * 0.75), 460px), 360px)); }
.coverscreen.guard .body { pointer-events: none; }
.readyscreen .gr { flex: 1; }

/* ---------- reading (§ 5.1) ---------- */
/* A page of a picture book (§ 5.1; founder 2026-10-13): the page is the book's own paper,
   one portrait column at every size, the picture on top and the words under it. */
.reading { height: 100dvh; min-height: 0; overflow: hidden; background: var(--paper, var(--surface-page)); }
body:has(.screen.reading) { background: var(--paper, var(--surface-page)); }
.reading .bar { min-height: 56px; padding-block: 6px 2px; }
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; width: min(100%, 720px); margin: 0 auto; }
/* The picture keeps its shape and hugs the top; never cropped. Its edges fade into the paper, so it has no box. */
.art { display: flex; justify-content: center; position: relative; width: 100%; border: 0; padding: 0; background: transparent; min-height: 0; }
.art > img, .stage > img { -webkit-mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent), linear-gradient(to bottom, transparent, black 2.5%, black 97.5%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent), linear-gradient(to bottom, transparent, black 2.5%, black 97.5%, transparent); mask-composite: intersect; }
.art > img { width: 100%; height: auto; max-height: 60dvh; object-fit: contain; display: block; }
.stage { position: relative; width: min(100%, calc(60dvh * var(--ar, 1))); aspect-ratio: var(--ar, 1); container-type: size; }
.stage > img { width: 100%; height: 100%; display: block; }
.page > .art { flex: none; }
.textarea-wrap { flex: 1 1 auto; display: grid; align-content: start; gap: 8px; min-height: 0; overflow: auto; padding-top: 14px; }
.textarea { padding: 10px 14px; display: flex; flex-direction: column; gap: 12px; }
.brow { display: flex; align-items: flex-end; gap: 8px; }
.brow.right { flex-direction: row-reverse; }
.brow.center, .brow.st-banner, .brow.st-card { justify-content: center; }
.bubble { max-width: 84%; background: var(--f); border: 3px solid var(--c); border-radius: 22px; padding: 6px 18px 8px; cursor: pointer; transition: box-shadow 0.12s; }
.brow.center .bubble, .brow.st-banner .bubble, .brow.st-card .bubble { padding: 6px 16px 8px; text-align: center; }
.brow.left .bubble { border-bottom-left-radius: 6px; }
.brow.right .bubble { border-bottom-right-radius: 6px; }
.bubble.playing, .soundword.playing { box-shadow: 0 0 0 5px var(--word-highlight); }
.bubble.st-whisper { border-style: dashed; }
.bubble.st-whisper .line { font-style: italic; }
.line { font-size: clamp(24px, 6.4vw, 32px); line-height: 1.22; margin: 0; overflow-wrap: break-word; }
.bubble .line { font-weight: 700; color: var(--text-ink); }
.soundword { align-self: center; transform: rotate(-4deg); cursor: pointer; padding: 0 10px; border-radius: 12px; }
.soundword .line { font-size: clamp(40px, 12vw, 56px); font-weight: 700; color: var(--c); }
.w { border-radius: 6px; padding: 0 2px; cursor: pointer; }
.w.lit { background: var(--word-lit); }
/* Be Dot (010 P5, pilot): the character's face under Read to me and My turn, no label; on the page, that character's
   bubble waits for the child with the stop shows' slider under its words (slider.css draws the thumb, smaller here) */
/* Be Dot on the cover: the second row's first button, in the character's colour, the label alone */
.coverscreen .berow { width: min(100%, max(min(84vw, calc(62dvh * 0.75), 460px), 360px)); }
.coverscreen .berow > :only-child { grid-column: 1 / -1; }
.btn.be { background: var(--c); border-color: var(--c); color: var(--neutral-0); }
.bubble.turn { position: relative; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 35%, transparent); animation: be-wait 1.6s ease-in-out infinite alternate; cursor: default;
  --sl-paper: var(--player-paper); --sl-line: var(--player-line); --sl-act: var(--c); }
@keyframes be-wait { to { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 18%, transparent); } }
.bubble.turn { max-width: 100%; }
/* room under every row for the track */
.bubble.turn .w { display: inline-block; margin-bottom: 46px; }
.bubble .w.said:not(.lit) { background: color-mix(in srgb, var(--word-lit) 35%, transparent); }
.bubble .be-track { position: absolute; height: 44px; } /* over slider.css's .sl-track, which loads after */
.be-track .sl-thumb { width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 14px; }
.be-track .sl-thumb i { height: 15px; width: 3px; }
.bubble.turn .pop { animation: be-pop 0.3s; }
@keyframes be-pop { 40% { transform: translateY(-5px); } }
.glow.on { color: var(--taught-letter); }
.pnav { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px 10px; width: min(100%, 720px); margin: 0 auto; }
/* Read to me has read the page: Next sits on a soft disc and pulses until the child turns it (reduced motion: the disc alone) */
.pnav .iconbtn.nudge { background: color-mix(in srgb, var(--pip-ink) 12%, transparent); animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } }
.pcount { font-size: 15px; color: var(--text-quiet); font-variant-numeric: tabular-nums; }
.modepop { position: fixed; top: 64px; right: 12px; background: var(--surface-card); border-radius: var(--radius-card); padding: 12px; box-shadow: 0 10px 30px color-mix(in srgb, var(--pip-ink) 25%, transparent); z-index: 5; width: 280px; }
.modepop .pair { grid-template-columns: 1fr; }

/* games: hunt, find, clear */
.game { cursor: pointer; overflow: hidden; }
.ring { position: absolute; border: 4px solid var(--pip-ink); border-radius: 999px; pointer-events: none; box-shadow: 0 0 0 3px var(--pip-cream); }
.huntwords { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 16px 0; justify-content: center; }
.chip { font-size: 28px; font-weight: 700; padding: 2px 14px; border-radius: 10px; background: var(--surface-card); border: 2px solid var(--border-subtle); }
.chip.found { background: var(--word-highlight); border-color: var(--pip-ink); text-decoration: line-through; text-decoration-thickness: 3px; }
.chip.card { border-color: var(--pip-ink); }
.clear .sprite { position: absolute; transform: translate(-50%, -50%); transition: transform 0.9s ease-in, opacity 0.9s ease-in; cursor: pointer; height: auto; }
.clear .sprite.gone { transform: translate(calc(-50% + var(--gx)), calc(-50% + var(--gy))) rotate(var(--gr)) scale(var(--gs)); opacity: 0; pointer-events: none; }
.clear .after { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s; pointer-events: none; }
.clear .after.on { opacity: 1; }

/* ---------- finish (§ 6) ---------- */
/* the last page (019): one centred column; the book read, one way on, the series, the grown-ups' corner */
.finish .body { flex: 1; padding: 8px 20px 32px; display: grid; gap: 18px; align-content: start; justify-items: center; max-width: 460px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.finish .body > * { width: 100%; }
.finish h2 { margin: 0; font-size: 28px; text-align: center; }
.fin-book { display: grid; justify-items: center; gap: 14px; }
.fin-cov { position: relative; width: min(180px, 46vw); }
.fin-cov img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; border-radius: var(--radius-cover); box-shadow: var(--shadow-book); }
.fin-cov .tick { position: absolute; right: -8px; top: -8px; width: 34px; height: 34px; }
.fin-again { min-height: 44px; font-size: 18px; padding: 0 22px; }
/* the series' next book: the same card as the Path's Next */
.fin-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border: 3px solid var(--action-primary-bg); border-radius: 20px; background: var(--surface-card); box-shadow: 0 4px 0 var(--shadow-lift); box-sizing: border-box; }
.fin-card .cv img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; border-radius: 8px; }
.nextside { display: grid; gap: 8px; min-width: 0; }
.nextside small { font-size: 16px; font-weight: 700; color: var(--text-quiet); }
.nextside b { font-size: 20px; line-height: 1.15; }
.nextside .pair { grid-template-columns: 1fr; gap: 8px; }
.nextside .btn { min-height: 46px; font-size: 18px; }
.fin-series { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--surface-card); box-shadow: 0 0 0 1px var(--neutral-300); color: var(--text-ink); font: inherit; font-size: 18px; text-align: left; cursor: pointer; }
.fin-series span { margin-left: auto; color: var(--text-quiet); font-size: 16px; }
.fin-series svg { flex: none; color: var(--text-quiet); }
/* for the grown-ups, quiet and last */
.fin-grown { display: grid; justify-items: center; gap: 4px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--neutral-300); }
.fin-grown > small { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-quiet); }

/* ---------- sheets: gate, grown-ups, offer, readers ---------- */
.sheet .body { flex: 1; padding: 20px; display: grid; gap: 16px; align-content: center; justify-items: center; text-align: center; }
.sheet .body.top { align-content: start; text-align: left; }
.sheet h2 { font-size: 28px; }
.sheet input[type="text"], .sheet input[type="email"] { font-size: 26px; height: 60px; width: min(100%, 360px); border: 2px solid var(--pip-ink); border-radius: var(--radius-button); padding: 0 14px; text-align: center; background: var(--surface-card); }
.gl { display: grid; gap: 14px; width: min(100%, 560px); justify-items: stretch; }
.card { background: var(--surface-card); border-radius: var(--radius-card); padding: 16px; display: grid; gap: 10px; text-align: left; }
.card h3 { font-size: 19px; }
.card p { margin: 0; }
.req { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.req img, .lrow img { width: 48px; border-radius: 4px; aspect-ratio: 3/4; object-fit: cover; }
.opt { display: flex; gap: 8px; flex-wrap: wrap; }
.opt button { border: 2px solid var(--pip-ink); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 16px; }
.opt button[aria-pressed="true"] { background: var(--pip-ink); color: var(--pip-cream); }
.lst { display: grid; gap: 10px; }
.lrow { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; background: var(--surface-card); border-radius: 14px; padding: 10px; border: 0; text-align: left; }
.lrow span { display: grid; gap: 2px; min-width: 0; }
.rrow { display: flex; gap: 12px; align-items: center; }
.rrow b { flex: 1; }
.searchbox { font-size: 18px; height: 48px; width: 100%; border: 2px solid var(--pip-ink); border-radius: var(--radius-button); padding: 0 12px; background: var(--surface-card); }
.findbox { display: grid; gap: 10px; }
.faces { display: grid; grid-template-columns: repeat(4, 64px); gap: 12px; justify-content: center; }
.faces button { width: 64px; height: 64px; border-radius: 999px; border: 0; padding: 0; background: var(--face-disc); overflow: hidden; }
.faces button img { width: 100%; height: 100%; display: block; pointer-events: none; }
.faces button.on { box-shadow: 0 0 0 3px var(--surface-page), 0 0 0 6px var(--pip-ink); }
@media (min-width: 800px) { .faces { grid-template-columns: repeat(6, 72px); } .faces button { width: 72px; height: 72px; } }
.offer .body { gap: 14px; }
.fan { display: flex; align-items: flex-end; justify-content: center; }
.fan img { width: 110px; }
.fan img:first-child:not(:last-child) { transform: rotate(-6deg) translateX(18px); opacity: 0.9; }
.fan img:last-child { width: 150px; position: relative; transform: rotate(3deg); }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 18px; }
.perks li { display: flex; gap: 10px; align-items: center; }
.perks .tick { position: static; flex: none; width: 24px; height: 24px; border: 0; }
.offerlinks { display: flex; gap: 18px; justify-content: center; }
.cover.share { width: 140px; }
.linktext { font-size: 15px; overflow-wrap: anywhere; color: var(--text-quiet); }

/* ---------- the win card (Reader_App.md § 7) ---------- */
.wincard { display: grid; gap: 6px; }
.wincard .wc-title { font-size: 21px; font-weight: 700; color: var(--text-ink); }
.wincard .row { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.print-card { display: none; }
@media print {
  body.printing-card > :not(.print-card) { display: none !important; }
  body.printing-card .print-card { display: block; padding: 48px; font-family: var(--font); color: var(--text-ink); }
  .print-card .pc-word { font-size: 24px; }
  .print-card h1 { font-size: 40px; margin: 32px 0 24px; }
  .print-card p { font-size: 24px; }
}

/* ---------- the foundation's feature row and pages (Word_Shows.md § 3) ---------- */
.ftiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 4px 0 10px; }
.ftile { display: grid; gap: 2px; justify-items: center; min-width: 0; }
/* A tile is one word and one picture (founder 2026-10-23: no boxes in boxes; as iOS): the word on white, the picture
   filling the rest to the tile's edges, its top fading into the white so no seam shows between them. */
.fart { width: 100%; aspect-ratio: 1; border: 0; padding: 0; border-radius: var(--radius-card); overflow: hidden; background: var(--surface-card); box-shadow: var(--shadow-book); display: flex; flex-direction: column; }
.fword { flex: none; padding: 4px 8px 0; font-size: 30px; font-weight: 700; line-height: 1.3; color: var(--text-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpic { flex: 1; min-height: 0; width: 100%; display: block; object-fit: cover; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%); mask-image: linear-gradient(to bottom, transparent, #000 30%); }
.fname { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; border: 0; background: none; font-size: 18px; font-weight: 700; color: var(--text-ink); }
.fpage .scroll { padding: 0 16px 24px; }
.fnext { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; border-radius: var(--radius-card); background: var(--surface-card); padding: 10px 14px; margin: 4px 0 14px; text-align: left; box-shadow: var(--shadow-book); }
.fnext img { width: 96px; height: 72px; object-fit: contain; flex: none; }
.fgo { width: 52px; height: 52px; border-radius: 99px; background: var(--pip-ink); color: var(--pip-cream); display: grid; place-items: center; flex: none; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; } /* a link styled as a button (the feedback email) */
/* the little-word tiles (009 LW3): the word on a card, the way the show shows it */
.fwcard { display: inline-block; font-weight: 700; font-size: 28px; line-height: 1.25; background: var(--surface-card); color: var(--text-ink); border: 2px solid var(--line-draw); border-radius: 12px; box-shadow: 0 3px 0 var(--shadow-lift); padding: 0 0.3em 2px; }
.flwc { position: relative; aspect-ratio: 3 / 2; border: 0; padding: 0; overflow: hidden; border-radius: var(--radius-card); background: var(--neutral-0); box-shadow: var(--shadow-book); }
.flwc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.flwc .fwcard { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 22px; }
.ftick { position: absolute; top: 6px; right: 10px; font-weight: 700; font-size: 20px; color: var(--pip-ink); }
.fnext .fwcard { flex: none; }
/* a library page (library.js): search and the next one on top, every card A to Z; a search's Path stop is a link over its cards */
.flib-n { margin-left: auto; color: var(--text-quiet); font-weight: 700; }
.flib-top { display: flex; gap: 12px; align-items: stretch; margin: 4px 0 10px; }
.flib-find { flex: 1; display: flex; align-items: center; gap: 10px; min-height: var(--touch-min); padding: 0 16px; border-radius: var(--radius-card); background: var(--surface-card); box-shadow: var(--shadow-book); color: var(--text-quiet); }
.flib-q { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 22px; font-weight: 700; color: var(--text-ink); outline: none; }
.flib-q::placeholder { color: var(--neutral-500); font-weight: 400; opacity: 1; } /* light and regular: never mistaken for typed text */
.flib-top .fnext { width: auto; margin: 0; flex: none; }
.flib-stop { display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch-min); margin: 18px 0 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 20px; font-weight: 700; color: var(--text-ink); }
.flib-none { color: var(--text-quiet); font-size: 18px; }
@media (max-width: 599px) { .flib-top { flex-direction: column; } .flib-top .fnext { width: 100%; } }
/* the Path's search (search.js): the best answer, lessons one to a row, pictures many to a row, books last */
.msr-top { padding: 0 16px 8px; }
.msr { padding-bottom: 24px; }
.msr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.msr-head h3 { margin: 0; font-size: 20px; }
.msr-all { display: inline-flex; align-items: center; gap: 2px; min-height: var(--touch-min); border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-ink); }
.msr-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; }
.msr-strip .flwc { flex: none; width: 200px; }
.msr-book { flex: none; width: 120px; border: 0; padding: 0; background: none; font: inherit; color: var(--text-quiet); text-align: center; }
.msr-cover { display: block; width: 120px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-cover); box-shadow: var(--shadow-book); }
.msr-book small { display: block; margin-top: 6px; font-size: 13px; }
.msr-lesson { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 10px; padding: 8px 12px 8px 8px; border: 0; border-radius: var(--radius-card); background: var(--surface-card); box-shadow: var(--shadow-book); font: inherit; color: var(--text-ink); text-align: left; }
.msr-pic { flex: none; width: 72px; height: 72px; display: grid; place-items: center; }
.msr-pic { overflow: hidden; }
.msr-pic > img { width: 100%; height: 100%; object-fit: contain; }
/* a lesson with no picture: its sound in a plain square, like a Path stop without one (search.js sizes the text) */
.msr-chip { width: 100%; height: 100%; display: grid; place-items: center; box-sizing: border-box; border: 2px solid var(--line-draw); border-radius: var(--radius-tile); font-weight: 700; white-space: nowrap; }
.msr-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msr-what b { font-size: 20px; }
.msr-what small { color: var(--text-quiet); }
.msr-best { margin: 4px 0 6px; }
.msr-lesson.msr-best .msr-pic { width: 110px; height: 110px; }
.msr-best .msr-what b { font-size: 26px; }
.fnext.msr-best img { width: 150px; height: 100px; }
.fnext.msr-best .msr-what { flex: 1; align-items: flex-start; }
@media (max-width: 599px) { .msr-lesson.msr-best .msr-pic { width: 80px; height: 80px; } .msr-best .msr-what b { font-size: 22px; } .fnext.msr-best img { width: 110px; height: 74px; } }
.fhost { height: 100dvh; padding: 0; }
.fhost .ws { flex: 1; }
@media (min-width: 800px) { .fgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ftiles { max-width: 460px; } }
/* the Reading Path (010 P1): the map and a stop's page are path/map.css; here the shelf's tile and button */
.pathpage { --psign-top: 76px; }
.pathpage > .bar, .stoppage > .bar { position: sticky; top: 0; z-index: 7; background: var(--surface-page); }
.fhost .sl { flex: 1; }
.fhost.ss { height: 100dvh; } /* a stop show mounts on the screen itself: its own height: 100% would follow the app's auto height */
.pathrow { display: flex; justify-content: center; padding: 4px 16px 0; }
.pathbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; white-space: nowrap; flex: none; border-radius: 999px; border: 2px solid var(--pip-ink); background: var(--surface-card); color: var(--pip-ink); font: inherit; font-weight: 700; }

/* our own review ask on the finish screen (finish.js): quiet, under the quiet row */
.askreview { display: grid; justify-items: center; gap: 2px; margin-top: 6px; color: var(--text-quiet); font-size: 16px; }
.askreview p { margin: 0; }
.askreview .stars { display: flex; gap: 2px; }
.askreview .stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--star); padding: 6px; min-width: 44px; min-height: 44px; }

/* The review bar (reviewbar.js): one line and five stars at the bottom of the home screens. */
.rbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 48px calc(10px + env(safe-area-inset-bottom)) 16px; background: var(--surface-card); border-top: 2px solid var(--pip-ink); font-weight: 700; font-size: 17px; }
.rbar[hidden] { display: none; }
.rbar-stars { display: flex; gap: 2px; }
.rbar-stars a { font-size: 30px; line-height: 1; color: var(--star); text-decoration: none; padding: 0 2px; }
.rbar-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: transparent; font-size: 26px; color: var(--pip-ink); }
body.has-rbar { padding-bottom: 64px; }
@media (max-width: 420px) { .rbar { flex-direction: column; gap: 2px; } body.has-rbar { padding-bottom: 88px; } }

/* ---------- home's top: what the child is working on (019 screen 1) ---------- */
.wcard { display: grid; gap: 10px; min-width: 0; }
.wc-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; border: 0; background: none; padding: 0; text-align: left; color: var(--text-ink); }
.wc-head b { font-size: 20px; }
.wc-head small { color: var(--text-quiet); font-size: 15px; }
.wc-book { display: flex; align-items: center; gap: 16px; width: 100%; border: 0; background: none; padding: 0; text-align: left; color: var(--text-ink); font: inherit; cursor: pointer; }
.wc-book .chev { margin-left: auto; flex: none; color: var(--text-quiet); }
.wc-cov { flex: none; width: 120px; }
.wc-cov img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; border-radius: var(--radius-cover); background: var(--surface-sunk); box-shadow: var(--shadow-book); }
.wc-text { display: grid; gap: 4px; min-width: 0; }
.wc-kick { display: block; margin: 0; font-size: 17px; font-weight: 700; color: var(--text-quiet); }
.wc-ttl { display: block; margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; text-wrap: balance; }
.krow { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: var(--radius-card); background: var(--surface-card); box-shadow: var(--shadow-book); padding: 8px 14px 8px 8px; text-align: left; color: var(--text-ink); }
.krow img { width: 42px; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; display: block; flex: none; }
.krow-t { display: grid; flex: 1; min-width: 0; }
.krow-t small { color: var(--text-quiet); font-size: 14px; }
.krow-t b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* phone: one column, path → Keep reading → play rows → books; laptop: path and play rows left, books right */
.shelfgrid.with-path { display: flex; flex-direction: column; gap: 18px; }
.with-path .side, .with-path .main { display: contents; }
.with-path .wcard { order: 1; } .with-path .krow { order: 2; } .with-path .play { order: 3; } .with-path .main > .rows { order: 4; }
@media (min-width: 800px) {
  .shelfgrid.with-path { display: grid; grid-template-columns: 360px minmax(0, 1fr); align-items: start; gap: 28px; }
  .with-path .side, .with-path .main { display: grid; gap: 18px; align-content: start; min-width: 0; }
}
/* a play row's card (Word Shows, Little Words): the library's card, the height of a book cover */
.pcardw { position: relative; flex: none; width: 200px; aspect-ratio: 3 / 2; border: 0; padding: 0; overflow: hidden; border-radius: var(--radius-card); background: var(--neutral-0); box-shadow: var(--shadow-book); scroll-snap-align: start; }
.pcardw img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pcardw .fwcard { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 22px; white-space: nowrap; }
.pcardw .tick { right: 8px; top: 8px; bottom: auto; width: 24px; height: 24px; border: 0; }
.prow-play .fc img { background: var(--surface-card); object-fit: cover; }
@media (min-width: 800px) { .with-path .side .pcardw { width: 156px; } .with-path .side .pcardw .fwcard { font-size: 19px; } }

/* 019: a book's ways in, one block on the cover, a stop's book and home's path card (cover.js bookButtons) */
.bookbtns { display: grid; gap: 12px; width: 100%; justify-items: center; }
.bookbtns > .pair { width: 100%; }
.coverscreen .bookbtns > .pair { width: min(100%, max(min(84vw, calc(62dvh * 0.75), 460px), 360px)); }
.bookbtns .berow > :only-child { grid-column: 1 / -1; }
.bookbtns[hidden], .bookbtns [hidden] { display: none; } /* a book that cannot load hides its buttons */
/* 019 map: on a phone the path's search opens from a magnifier in the bar; from the tablet split up it always shows */
.pathpage .msr-top:not(.open) { display: none; }
@media (min-width: 760px) { .pathpage .msr-top:not(.open) { display: block; } .pathpage .msr-lens { display: none; } }
/* 019 screen 4: a stop's book's last page; the path's way on where the series' next book sits */
.pfin { display: grid; gap: 12px; justify-items: center; }
.finish [hidden] { display: none !important; }
.pfin .pnext { margin: 0; }
.pfin-all { margin: 0; font-size: 20px; font-weight: 700; }
/* the web's path has a search row above the split too (map.css counts the bar only): the split fits the window, so the
   map column's foot, where Back to my stop sits, is on screen */
.pathpage .psplit { height: calc(100dvh - 140px); }
