/* Canonical geometry: scale the whole leaf, never reflow text by viewport. */
.spread{grid-template-columns:repeat(2,minmax(0,1fr));aspect-ratio:auto;max-width:1100px;perspective:none}
.book-leaf{position:relative;width:100%;aspect-ratio:550/760;container-type:inline-size;overflow:hidden;min-width:0}
.book-leaf .book-page{position:absolute;left:0;top:0;width:550px;height:var(--leaf-height,760px);min-height:0;padding:0;display:block;transform:scale(calc(100cqw / 550px));transform-origin:top left;border:0}
.book-leaf .page-copy h2{font-size:34px;line-height:1.06;overflow-wrap:break-word}
.book-leaf .page-copy p{font-size:12px;line-height:1.58;white-space:pre-line;overflow:visible;overflow-wrap:break-word;max-height:none}
.book-leaf .page-copy blockquote{font-size:32px;line-height:1.2;overflow:visible;white-space:pre-line;overflow-wrap:break-word}
.book-leaf .page-kicker{font-size:8px;line-height:1.3;display:block}
/* Decorative gold remains in rules; small readable labels use the page ink. */
.book-leaf .book-page .page-kicker{color:inherit}
.book-leaf .layout-editorial-column .page-copy p::first-letter{color:inherit}
.book-leaf .layout-editorial-cover .page-copy h2{font-size:48px}
.book-leaf .layout-cinematic-cover .page-copy h2{font-size:44px}
.book-leaf .layout-cinematic-intertitle .page-copy{display:flex;flex-direction:column;justify-content:center;gap:16px;padding:8%;overflow:visible}
.book-leaf .layout-cinematic-intertitle .page-copy blockquote{font-size:20px;line-height:1.25;max-height:none}
.book-leaf .design-family_archive .page-copy p{font-size:12px}
.book-leaf .layout-archive-letter .page-copy p{font-size:14px}
.book-leaf .book-photo img{height:100%;object-fit:contain}
.book-leaf .book-photo::after{display:none}
/* No image may conceal another person's meaningful details. */
.book-leaf .layout-editorial-detail .page-photos{display:grid;grid-template-columns:1.1fr 1fr;gap:4%;align-items:center}
.book-leaf .layout-editorial-detail .book-photo{position:relative;inset:auto;width:100%;height:80%;border:0}
.book-leaf .layout-editorial-detail .photo-2{height:60%}
.book-leaf .layout-archive-scrapbook .page-photos{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:6%;padding:3%}
.book-leaf .layout-archive-scrapbook .book-photo{position:relative;inset:auto;width:100%;height:100%;transform:none}
.book-leaf .layout-archive-scrapbook .photo-1{grid-column:1/3;width:70%;justify-self:center;transform:rotate(-2deg)}
.book-leaf .layout-editorial-quote .page-copy{display:flex;flex-direction:column;justify-content:center;gap:18px}
.book-leaf .layout-editorial-quote .page-copy::before{display:none}
.book-leaf .layout-editorial-finale .page-copy,.book-leaf .layout-cinematic-credits .page-copy,.book-leaf .layout-archive-epilogue .page-copy{inset:12%;gap:14px}
@media(max-width:850px){.spread{grid-template-columns:repeat(2,minmax(0,1fr));max-width:1100px}.spread .book-leaf .book-page{display:block;min-height:0}}
@media(max-width:600px){.book-stage{padding:14px}.book-leaf .book-page{display:block}}
.render-preview-dialog{width:min(1200px,96vw);max-height:94vh;overflow:auto;padding:24px;background:#f8f2e8;color:#24211f;border:1px solid #c9b49b;border-radius:14px}
.render-preview-dialog::backdrop{background:#151719c9}
.render-preview-dialog header,.render-preview-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.render-preview-dialog h2{font:30px/1.1 Georgia;margin:0}
.render-preview-dialog [data-error]{color:#9f342f}
.render-preview-image{display:block;max-width:100%;max-height:72vh;margin:20px auto;object-fit:contain}
/* Explicit geometry for newly composed versions. Old manifests retain their layout. */
.book-leaf .book-page.composed{background:var(--page-paper);color:var(--page-ink)}
.book-leaf .book-page.composed .page-photos{inset:0;width:100%;height:100%;display:block;padding:0;background:none;box-shadow:none;transform:none}
.book-leaf .book-page.composed .book-photo{position:absolute;inset:auto;display:block;min-width:0;min-height:0;margin:0;padding:0;border:0;transform:none;background:none;box-shadow:none}
.book-leaf .book-page.composed .book-photo img{display:block;object-fit:contain;width:100%;height:100%}
.book-leaf .book-page.composed .page-copy{inset:auto;display:block;padding:0;border:0;columns:auto;transform:none;background:none;box-shadow:none;overflow:visible;color:var(--page-ink);text-align:left}
.book-leaf .book-page.composed .page-copy:before{display:none}
.book-leaf .book-page.composed .page-copy h2{font-size:28px;line-height:1.1;margin:5px 0 10px;letter-spacing:-.02em;color:inherit;text-transform:none;overflow-wrap:break-word}
.book-leaf .book-page.composed .page-copy p{font:14px/1.5 Georgia,serif;margin:0;white-space:pre-line;columns:auto;color:inherit}
.book-leaf .book-page.composed .page-copy p:first-letter{float:none;font:inherit;padding:0;color:inherit}
.book-leaf .book-page.composed .page-kicker{font:700 9px/1.4 Arial;letter-spacing:.1em;color:inherit}
.book-leaf .book-page.composed .page-ornament{inset:3% 4%;width:auto;height:auto;border:0;border-top:1px solid var(--page-accent);border-bottom:1px solid var(--page-accent);border-radius:0;opacity:.55}
.book-leaf .design-family_archive.composed{background-image:repeating-linear-gradient(0deg,#fff2 0 2px,#00000004 3px 4px),radial-gradient(ellipse at 110% 0,#d7c6a899,transparent 70%)}
.book-leaf .design-family_archive.composed .book-photo{outline:5px solid #fff9ed;box-shadow:0 6px 15px #49372928}
.book-leaf .design-family_archive.composed .page-ornament{border:1px solid var(--page-accent);border-radius:35% 0 35% 0;opacity:.2}
.book-leaf .design-cinematic_story.composed .page-ornament{border-top-width:3px;border-bottom-width:3px;inset:3% 6%;opacity:.75}
.book-leaf .design-editorial_wedding.composed .page-ornament{border-bottom:0;inset:4% 8%;height:12px;width:48px;border-top-width:3px}
.book-leaf .book-page.photos-only .page-copy{display:none}
.book-toolbar button.secondary,.book-toolbar a.secondary{color:#fff8ef;border-color:#fff8ef80}
.book-stage .status{color:#24211f}
.composition-summary{max-width:1100px;margin:12px auto 20px;color:#e8ddd2;font:13px/1.5 Arial,sans-serif}
.composition-options{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:20px;border:1px solid var(--line);border-radius:12px;margin:20px 0;background:#fffaf3}
.composition-options p{grid-column:1/-1;margin:0;font-size:13px;color:#615650}
@media(max-width:600px){.composition-options{grid-template-columns:1fr}}
/* Art is kept in margins: it cannot cover a face, a photograph or the body copy. */
.art-margin{position:absolute;left:3%;top:7.5%;width:10%;height:84%;overflow:hidden;pointer-events:none;color:#ae6654}
.art-margin svg{position:absolute;bottom:0;left:0;width:100%;height:48%}
.art-margin i{position:absolute;top:0;left:20%;width:65%;aspect-ratio:1;border:1px solid #18334b;border-radius:50%;background:transparent}
.art-margin b{position:absolute;top:3%;left:0;width:65%;aspect-ratio:1;border:1px solid #c15e48;border-radius:50%;background:transparent}
.book-leaf .book-page.art-directed .page-ornament{border:0;inset:3% 8%;height:1px;width:auto;background:var(--page-accent);opacity:.6}
.book-leaf .design-editorial_wedding.art-directed{background-color:#f7f3eb;background-image:linear-gradient(90deg,#18334b 0 5px,transparent 5px);color:#24211f}
.book-leaf .design-editorial_wedding.art-directed .book-photo{outline:1px solid #bcaea2;outline-offset:4px}
.book-leaf .design-editorial_wedding.art-directed.art-variation-1 .art-margin i{border-color:#c15e48}
.book-leaf .design-editorial_wedding.art-directed.art-variation-2 .art-margin{color:#18334b}
.book-leaf .design-editorial_wedding.art-directed.art-variation-2 .art-margin b{border-color:#18334b}
.book-leaf .design-cinematic_story.art-directed{background:#0c1720;color:#f3ecdf}
.book-leaf .design-cinematic_story.art-directed .art-margin{left:2%;width:2.5%;color:#d4b179;background:repeating-linear-gradient(0deg,transparent 0 13px,#d4b179 13px 20px,transparent 20px 33px);opacity:.75}
.book-leaf .design-cinematic_story.art-directed .art-margin>*{display:none}
.book-leaf .design-cinematic_story.art-directed .book-photo{outline:1px solid #d4b179;outline-offset:4px}
.book-leaf .design-cinematic_story.art-directed.art-variation-1{background:#171516}
.book-leaf .design-cinematic_story.art-directed.art-variation-2 .page-ornament{background:#d97159;height:3px}
.book-leaf .design-family_archive.art-directed{background-color:#f1e7d4;background-image:repeating-linear-gradient(90deg,#fff2 0 1px,transparent 1px 4px),repeating-linear-gradient(0deg,#ac916711 0 1px,transparent 1px 4px);color:#5d5044}
.book-leaf .design-family_archive.art-directed .art-margin{left:3%;width:10%;border-left:1px dashed #9e7553;color:#8a6046}
.book-leaf .design-family_archive.art-directed .art-margin svg{height:60%;bottom:3%}
.book-leaf .design-family_archive.art-directed .art-margin i{left:25%;width:40%;height:12%;border:0;border-radius:0;clip-path:polygon(0 0,100% 0,100% 100%,50% 85%,0 100%);background:#963f32}
.book-leaf .design-family_archive.art-directed .art-margin b{display:none}
.book-leaf .design-family_archive.art-directed .book-photo{outline:5px solid #fff9ed;box-shadow:0 6px 16px #49372930}
.book-leaf .design-family_archive.art-directed.art-variation-1 .art-margin i{background:#435e56;height:10%}
.book-leaf .design-family_archive.art-directed.art-variation-2 .art-margin i{background:#9e7553;height:7%;border-radius:50%}
.photo-analysis-controls{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px}
.photo-analysis-report{grid-column:1/-1;font:14px/1.5 Arial;max-height:400px;overflow:auto}
.photo-analysis-report li{padding:8px 0;border-bottom:1px solid #ddcfc0}
.photo-analysis-report small{display:block;color:#615650}
