.cover-presentation { min-width:0; display:flex; flex-direction:column; gap:1rem; padding:1rem 0; }
.has-js .book-turntable.js-only { display:block; position:relative; width:280px; max-width:80vw; aspect-ratio:846/1231; perspective:1400px; cursor:grab; touch-action:pan-y; outline-offset:14px; }
.book-turntable:focus-visible { outline:3px solid var(--gold); }
.book-turntable.is-dragging { cursor:grabbing; }
.book-model { position:absolute; inset:0; transform-style:preserve-3d; transform:rotateY(0deg); will-change:transform; }
.book-face { position:absolute; inset:0; width:100%; height:100%; backface-visibility:hidden; border-radius:2px 5px 5px 2px; }
.book-front { transform:translateZ(16px); }
.book-back { transform:rotateY(180deg) translateZ(16px); border-radius:5px 2px 2px 5px; }
.book-spine { position:absolute; inset:0; transform-style:preserve-3d; }
.book-spine canvas { position:absolute; top:0; height:100%; backface-visibility:hidden; }
.book-pages { position:absolute; top:0; right:0; width:32px; height:100%; transform:translateX(50%) rotateY(90deg); backface-visibility:hidden; }
.book-pages canvas { display:block; width:100%; height:100%; border-radius:1px; }
.book-paper-cut { position:absolute; left:1px; width:calc(100% - 2px); height:30px; backface-visibility:hidden; }
.book-paper-top { top:1.17%; transform:translateY(-50%) rotateX(90deg); }
.book-paper-bottom { bottom:1.17%; transform:translateY(50%) rotateX(-90deg); }
.book-turntable::after { content:''; position:absolute; left:50%; bottom:-24px; width:80%; height:20px; background:radial-gradient(ellipse closest-side,#2336302e 15%,#23363018 55%,transparent 100%); border-radius:50%; transform:var(--book-shadow-transform,translateX(-50%) scale(1,.47)); opacity:var(--book-shadow-opacity,.7); transform-origin:center; will-change:transform; pointer-events:none; }
body[data-theme=dark] .book-turntable::after { background:radial-gradient(ellipse closest-side,#0007 15%,#0003 55%,transparent 100%); }
.book-turn-help { margin:.5rem 0 0; text-align:center; max-width:320px; }
.has-js .book-actions.js-only { display:flex; gap:.5rem; justify-content:center; align-items:center; }
.book-actions .tool { min-height:44px; padding:.5rem .8rem; font-size:.85rem; }
.cover-is-open { overflow:hidden; }
.cover-viewer { box-sizing:border-box; width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; padding:max(.7rem,env(safe-area-inset-top)) max(.7rem,env(safe-area-inset-right)) max(.7rem,env(safe-area-inset-bottom)) max(.7rem,env(safe-area-inset-left)); border:0; background:var(--paper); color:var(--ink); }
.cover-viewer[open] { display:flex; flex-direction:column; gap:.5rem; }
.cover-viewer::backdrop { background:#16241fe6; }
.cover-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.5rem; flex-shrink:0; }
.cover-toolbar h2 { margin:0; font-size:clamp(1rem,3vw,1.5rem); }
.cover-toolbar > div { display:flex; gap:.5rem; }
.cover-toolbar .tool,.cover-controls .tool { min-height:44px; padding:.45rem .7rem; }
.cover-stage { position:relative; flex:1; min-height:0; overflow:hidden; }
.cover-stage canvas { position:absolute; inset:0; width:100%; height:100%; display:block; cursor:grab; touch-action:none; user-select:none; -webkit-touch-callout:none; }
.cover-stage canvas.is-dragging { cursor:grabbing; }
.cover-controls { display:flex; justify-content:center; align-items:center; gap:.45rem; flex-wrap:wrap; flex-shrink:0; }
.cover-controls output { min-width:3.5em; text-align:center; font-size:.85rem; }
.cover-status { text-align:center; margin:0; flex-shrink:0; }
@media(max-width:600px) { .book-turntable { width:250px; } .cover-toolbar .tool { font-size:.8rem; } .cover-toolbar h2 { max-width:8em; } .cover-status { font-size:.7rem; } }

/* Added binding and soft edge treatment; cover pixels remain unchanged. */
.book-face { outline:1px solid #23362f35; box-shadow:0 0 3px #23362f3d,0 2px 7px #23362f20; }
.book-model::before,.book-model::after { content:''; position:absolute; inset:0; border-radius:3px 5px 5px 3px; box-shadow:inset 0 0 2px 1px #23362f35,inset 5px 0 9px -7px #23362f80; backface-visibility:hidden; pointer-events:none; }
.book-model::before { transform:translateZ(16.1px); }
.book-model::after { transform:rotateY(180deg) translateZ(16.1px); }
.book-actions { flex-wrap:wrap; }
@media(prefers-reduced-motion:reduce) { .book-model { transition:none !important; } }

/* Visible disclosure about the book process, independent of the cover artwork and drag area. */
.book-cover-display{position:relative;width:280px;max-width:80vw}
.cover-ai-badge{position:absolute;right:-14px;bottom:16px;z-index:3;display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:7px 10px;border:1px solid var(--gold);border-radius:7px;background:var(--surface);color:var(--ink);box-shadow:0 3px 12px #23363024;text-decoration:none;font-size:11px;line-height:1.3;text-align:left;max-width:calc(100vw - 40px)}
.cover-ai-badge svg{flex:none;color:var(--accent)}
.cover-ai-badge strong{font-weight:650}
.cover-ai-badge:hover{border-color:var(--accent);background:var(--wash)}
.cover-ai-badge:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.cover-stage .cover-ai-badge{top:10px;right:10px;bottom:auto;min-height:40px}
@media print{.cover-ai-badge{position:static;box-shadow:none}}

/* A smaller label sits beyond the lower-right edge, leaving the whole cover visible. */
.book-cover-display{padding-bottom:44px}
.book-cover-display>.cover-ai-badge{right:-12px;bottom:0;min-height:32px;padding:4px 7px;gap:5px;font-size:10px;border-radius:5px;box-shadow:0 2px 6px #23363014}
.book-cover-display>.cover-ai-badge svg{width:12px;height:12px}

/* Compact, accessible explanation without leaving the cover. */
.cover-ai-badge{cursor:pointer;font-family:inherit}
.cover-ai-info{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);box-shadow:0 12px 40px #23363030}
.cover-ai-info::backdrop{background:#16241f55}
.cover-ai-info-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.cover-ai-info-header h2{font:400 25px/1.25 Georgia,serif;margin:0}
.cover-ai-info-header .tool{display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:36px;padding:6px}
.cover-ai-info p{font:400 14px/1.7 system-ui,sans-serif;margin:16px 0 0}

/* Keep cover controls clickable when a rotated 3D face projects beyond its frame. */
.book-actions{position:relative;z-index:4}
