/* Matte, softly fibrous book stock. Paper tint and grain use 50% opacity; the olive background remains visible. */
.continuous-reader.reading-column { box-sizing:border-box; position:relative; padding:clamp(20px,4vw,42px); margin-top:18px; border:1px solid #8b927b40; border-radius:3px 8px 8px 3px; background:linear-gradient(100deg,#b1a58f12 0,transparent 24px),url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22256%22%20height%3D%22256%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%3C%21--%20Seamless%20matte%20paper%20grain%3A%20no%20glossy%20highlights%20or%20geometric%20weave.%20Decorative%20only.%20--%3E%0A%3Cdefs%3E%0A%3Cfilter%20id%3D%22grain%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%0A%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.62%20.36%22%20numOctaves%3D%223%22%20seed%3D%2219%22%20stitchTiles%3D%22stitch%22%2F%3E%0A%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%20.32%20%200%200%200%200%20.27%20%200%200%200%200%20.18%20%20.11%20.11%20.11%200%20-.08%22%2F%3E%0A%3C%2Ffilter%3E%0A%3Cfilter%20id%3D%22fibres%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%0A%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.045%20.19%22%20numOctaves%3D%223%22%20seed%3D%2231%22%20stitchTiles%3D%22stitch%22%2F%3E%0A%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%20.76%20%200%200%200%200%20.70%20%200%200%200%200%20.54%20%20.08%20.08%20.08%200%20-.035%22%2F%3E%0A%3C%2Ffilter%3E%0A%3C%2Fdefs%3E%3Cg%20opacity%3D%22.5%22%3E%3Cpath%20d%3D%22M0%200h256v256H0z%22%20filter%3D%22url%28%23grain%29%22%2F%3E%3Cpath%20d%3D%22M0%200h256v256H0z%22%20filter%3D%22url%28%23fibres%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat,rgba(244,237,219,.5); background-size:auto,256px 256px,auto; box-shadow:inset 3px 0 7px #85745b0d,0 3px 0 -1px #f0ebdf9c,0 4px 0 #8b927b25,0 14px 30px #23362f0c; transform-origin:center center; }
body[data-theme=dark] .continuous-reader.reading-column { background:linear-gradient(100deg,#cbbf9e0c,transparent 24px),url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22256%22%20height%3D%22256%22%20viewBox%3D%220%200%20256%20256%22%3E%0A%3C%21--%20Seamless%20matte%20paper%20grain%3A%20no%20glossy%20highlights%20or%20geometric%20weave.%20Decorative%20only.%20--%3E%0A%3Cdefs%3E%0A%3Cfilter%20id%3D%22grain%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%0A%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.62%20.36%22%20numOctaves%3D%223%22%20seed%3D%2219%22%20stitchTiles%3D%22stitch%22%2F%3E%0A%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%20.32%20%200%200%200%200%20.27%20%200%200%200%200%20.18%20%20.11%20.11%20.11%200%20-.08%22%2F%3E%0A%3C%2Ffilter%3E%0A%3Cfilter%20id%3D%22fibres%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%0A%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.045%20.19%22%20numOctaves%3D%223%22%20seed%3D%2231%22%20stitchTiles%3D%22stitch%22%2F%3E%0A%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220%200%200%200%20.76%20%200%200%200%200%20.70%20%200%200%200%200%20.54%20%20.08%20.08%20.08%200%20-.035%22%2F%3E%0A%3C%2Ffilter%3E%0A%3C%2Fdefs%3E%3Cg%20opacity%3D%22.5%22%3E%3Cpath%20d%3D%22M0%200h256v256H0z%22%20filter%3D%22url%28%23grain%29%22%2F%3E%3Cpath%20d%3D%22M0%200h256v256H0z%22%20filter%3D%22url%28%23fibres%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat,rgba(36,43,34,.5); background-size:auto,256px 256px,auto; border-color:#9aa68a40; box-shadow:inset 3px 0 7px #00000022,0 3px 0 -1px #26362d99,0 4px 0 #a6b49725,0 14px 30px #00000020; }
.continuous-reader .book-text { touch-action:pan-y; }
.continuous-reader .reading-nav a.page-turn-link { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:12px; padding:16px; text-decoration:none; background:rgba(231,238,227,.4); border:1px solid var(--line); border-radius:7px; }
.page-turn-link > span { flex:1; min-width:0; }
.page-turn-icon { flex-shrink:0; width:40px; height:40px; color:var(--accent); }
.reading-nav a[rel=next].page-turn-link { text-align:right; flex-direction:row-reverse; }
.page-turn-link:hover,.page-turn-link:focus-visible { border-color:var(--accent); box-shadow:0 4px 12px #23362f12; }
.page-turn-link:hover .page-turn-icon,.page-turn-link:focus-visible .page-turn-icon { animation:invite-next .7s ease-in-out 2; }
.page-turn-link[rel=prev]:hover .page-turn-icon,.page-turn-link[rel=prev]:focus-visible .page-turn-icon { animation-name:invite-prev; }
@keyframes invite-next { 50% { transform:translateX(5px); } }
@keyframes invite-prev { 50% { transform:translateX(-5px); } }
@media(max-width:600px) { .continuous-reader.reading-column { padding:20px 16px; } .continuous-reader .reading-nav { gap:10px; } .continuous-reader .reading-nav a.page-turn-link { padding:12px; gap:8px; font-size:.9rem; } .page-turn-icon { width:34px; height:34px; } }
@media(prefers-reduced-motion:reduce) { .page-turn-link .page-turn-icon { animation:none !important; } }
@media print { .continuous-reader.reading-column { background:transparent !important; box-shadow:none !important; border:0; padding:0; } }

.section-number { color:var(--accent); font-size:1.1rem; font-weight:600; margin:0 0 12px; }
.page-drag-preview { position:fixed; z-index:70; top:50%; bottom:auto; left:auto; right:max(12px,env(safe-area-inset-right)); transform:translateY(-50%); box-sizing:border-box; width:60vw; max-height:80dvh; overflow:hidden; padding:16px 20px; background:var(--paper); border:1px solid var(--line); border-top:4px solid var(--accent); border-radius:8px; box-shadow:0 12px 40px #23362f30; pointer-events:none; }
.page-drag-preview[data-direction=prev] { left:max(12px,env(safe-area-inset-left)); right:auto; }
.page-drag-preview[hidden] { display:none; }
.page-drag-preview strong { display:block; font:600 clamp(18px,3vw,23px)/1.25 Georgia,serif; overflow-wrap:anywhere; }
.page-drag-label { margin:0 0 6px; color:var(--accent); font-size:.8rem; }
.page-drag-excerpt { margin:8px 0; font-size:.85rem; line-height:1.4; }
.page-drag-hint { margin:8px 0 0; color:var(--muted); font-size:.75rem; }
.page-drag-progress { height:3px; background:var(--accent); margin-top:10px; transform-origin:left; }
.page-drag-preview[data-direction=prev] .page-drag-progress { transform-origin:right; }
@media(max-height:450px) { .page-drag-preview { padding:10px 16px; max-height:80dvh; } .page-drag-excerpt { display:none; } }

@media(min-width:1024px) { .page-drag-preview { width:28vw; } }

/* Short desktop invitation, with a close control and no continuous animation. */
.reading-end-cue{position:fixed;z-index:65;right:0;top:var(--reading-end-top,calc(45% + 76px));width:min(28vw,390px);box-sizing:border-box;max-height:calc(100dvh - var(--reading-end-top,calc(45% + 76px)) - 12px);overflow:auto;padding:12px;border:1px solid var(--line,#d4ded2);border-radius:14px;background:var(--paper,#f7f4ed);box-shadow:0 8px 30px #20332c24;animation:reading-end-invite 2s ease-in-out 2}
.reading-end-cue[hidden]{display:none}
.reading-end-go{display:grid;grid-template-columns:1fr 40px;gap:9px;text-align:left;padding:18px 24px 12px 10px;width:100%;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit}
.reading-end-go small,.reading-end-go strong{grid-column:1;overflow-wrap:anywhere}
.reading-end-go svg{grid-column:2;grid-row:1/3;align-self:center;width:36px;height:36px}
.reading-end-close{position:absolute;right:3px;top:3px;width:32px;height:32px;border:0;background:transparent;color:inherit;font-size:24px;cursor:pointer}
@keyframes reading-end-invite{0%,100%{transform:translateX(0)}50%{transform:translateX(-8px)}}
@media(prefers-reduced-motion:reduce){.reading-end-cue{animation:none}}

/* AI process disclosure stays outside book text and does not narrow reading. */
.section-ai-meta{display:flex;justify-content:flex-end;margin:0 0 10px}
.section-ai-badge{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 9px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--muted);font:500 11px/1.4 system-ui,sans-serif;text-decoration:none}
.section-ai-badge svg{flex:none;width:14px;height:14px;color:var(--accent)}
.section-ai-badge:hover{border-color:var(--accent);color:var(--ink)}
.section-ai-badge:focus-visible{outline:3px solid var(--gold);outline-offset:3px}

/* Printed-book reference beside the return link, without splitting the section. */
.continuous-reader .reader-end{display:flex;align-items:center;justify-content:center;gap:.85rem;flex-wrap:wrap}
.reader-page-number{white-space:nowrap;font:.88rem/1.4 system-ui,sans-serif;color:var(--muted);font-variant-numeric:tabular-nums}
