/* Love Book V1: preserves the supplied gold-foil cover, textured paper,
   3D leaf-turn, 30-tone palette, safe areas and one/two-page layout. */
:root {
  --book-bg1:#fff1ee; --book-bg2:#efc4c8; --book-ui:#5a2231;
  --book-heart:#d9576f; --book-c1:#7a1830; --book-c2:#3b0a17;
  --book-ac:#8a1c33; --book-gold:#d9b46a; --book-paper:#fbf5ea;
  --pw:360px; --ph:511px;
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing:border-box }
html { height:100%; }
body.zi-love-book {
  margin:0; height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden;
  padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0)
      env(safe-area-inset-bottom,0) env(safe-area-inset-left,0);
  background:radial-gradient(ellipse at 50% 35%,var(--book-bg1),var(--book-bg2));
  color:var(--book-ui);font-family:"Cormorant Garamond",Georgia,serif;
}
body.zi-love-book button,body.zi-love-book input,body.zi-love-book select,body.zi-love-book textarea{font:inherit}
button {cursor:pointer}
button:disabled {opacity:.3;cursor:default}
.hearts{position:fixed;inset:0;overflow:hidden;pointer-events:none}
.hearts span{position:absolute;bottom:-2rem;opacity:0;color:var(--book-heart);font-size:var(--s);animation:up var(--d) linear infinite}
@keyframes up{10%{opacity:.45}100%{transform:translateY(-110vh) rotate(40deg);opacity:0}}
.book-header{display:flex;gap:14px;align-items:center;justify-content:space-between;padding:14px clamp(16px,4vw,38px);z-index:4;font:600 13px/1.3 system-ui,sans-serif}
.book-header a{color:inherit;text-decoration:none}
.book-header .return{display:inline-flex;align-items:center;gap:8px}
.book-header .return:first-letter{font-size:25px}
.book-header .preview{font-size:12px}
.book-brand{text-align:center;letter-spacing:.2em}
.book-brand small{display:block;font-size:9px;letter-spacing:.25em;opacity:.65;margin-top:4px}
.book-edit-toolbar{position:relative;z-index:4;display:flex;gap:8px;overflow-x:auto;padding:8px 14px;scrollbar-width:none}
.book-edit-toolbar[hidden]{display:none}
.book-edit-toolbar button{flex:none;padding:9px 14px;border:1px solid rgba(90,34,49,.22);border-radius:20px;background:rgba(255,255,255,.55);color:inherit}
.book-edit-toolbar .danger{color:#9d243a}
.workspace{display:flex;flex:1;min-height:0;position:relative;gap:12px;padding:0 clamp(8px,2vw,22px)}
.book-stage{position:relative;display:grid;place-items:center;flex:1;min-width:0;min-height:0;perspective:2600px;touch-action:pan-y;outline:0}
.book{position:relative;width:calc(var(--pw)*2);height:var(--ph);transform-style:preserve-3d;transition:transform .9s cubic-bezier(.4,.1,.2,1)}
.book.port{width:var(--pw)}
.book-ground{position:absolute;left:0;right:0;bottom:-20px;height:26px;background:radial-gradient(closest-side,rgba(0,0,0,.5),transparent);filter:blur(8px)}
.book:not(.port).at-cover .book-ground{left:50%}
.book:not(.port).at-end .book-ground{right:50%}
.book-edge{position:absolute;top:3px;bottom:3px;width:7px;background:repeating-linear-gradient(90deg,#d9ccb2 0 1px,#fbf3e2 1px 2px);border-radius:1px}
.book-edge.left{left:-6px}.book-edge.right{right:-6px}.book.port .book-edge{display:none}
.book-leaf{position:absolute;left:50%;top:0;width:50%;height:100%;transform-origin:left center;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transition:transform .9s cubic-bezier(.45,.05,.2,1);will-change:transform}
.book.port .book-leaf{left:0;width:100%}
.book-face{position:absolute;inset:0;overflow:hidden;background:var(--book-paper);backface-visibility:hidden;-webkit-backface-visibility:hidden}
.book-face.front{border-radius:0 7px 7px 0;background-image:linear-gradient(90deg,rgba(60,20,20,.17),transparent 9%),var(--grain)}
.book-face.back{transform:rotateY(180deg);border-radius:7px 0 0 7px;background-image:linear-gradient(270deg,rgba(60,20,20,.17),transparent 9%),var(--grain)}
.book.port .book-face.front{border-radius:7px}
.book-cover{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#f3dca0;background:var(--grain),linear-gradient(135deg,var(--book-c1),var(--book-c2));box-shadow:inset 12px 0 14px -10px rgba(0,0,0,.7);padding:12% 9%}
.book-cover:before{content:"";position:absolute;inset:6%;border:1px solid rgba(217,180,106,.7);border-radius:4px;outline:1px solid rgba(217,180,106,.3);outline-offset:5px;pointer-events:none}
.book-cover svg{width:calc(var(--pw)*.17);fill:var(--book-gold);filter:drop-shadow(0 2px 6px rgba(0,0,0,.45));animation:beat 2.4s ease-in-out infinite}
.book-cover h1{margin:.1em 0 0;font:400 calc(var(--pw)*.23)/1.1 "Great Vibes",cursive;background:linear-gradient(100deg,#8a6a2c,#f6e3a6 30%,#c49a45 50%,#f6e3a6 70%,#8a6a2c) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:foil 5s linear infinite}
.book-cover b{display:block;margin:.5em 0 .35em;font:600 calc(var(--pw)*.065)/1.2 "Cormorant Garamond",Georgia,serif;letter-spacing:.12em;text-transform:uppercase}
.book-cover p{margin:0;font-size:calc(var(--pw)*.064);font-style:italic}
.book-cover small{position:absolute;bottom:10%;font-size:calc(var(--pw)*.039);letter-spacing:.2em;opacity:.75;animation:pulse 2.4s infinite}
@keyframes beat{50%{transform:scale(1.09)}}@keyframes foil{to{background-position:-200% 0}}@keyframes pulse{50%{opacity:.25}}
.book-page{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;position:relative;padding:9% 11%;color:var(--book-ink,#3a1a22);font-family:var(--book-font,inherit);font-size:calc(max(12.5px,calc(var(--pw)*.055)) * var(--book-scale,1));overflow:hidden}
.book-page h2{font:var(--book-title-font,400 2.3em/1.1 "Great Vibes",cursive);color:var(--book-ac);margin:0 0 .35em}
.book-page p{margin:.4em 0;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.book-page p.drop:first-letter{float:left;font-size:3em;line-height:.8;color:var(--book-ac);padding:.06em .1em 0 0}
.book-page ul{list-style:none;padding:0;margin:0;line-height:1.5}
.book-page li{margin:.4em 0;overflow-wrap:anywhere}
.book-page li:before{content:"♥ ";color:var(--book-ac)}
.book-page figure{margin:.5em auto;width:78%;max-height:54%;background:white;padding:.4em .4em .2em;box-shadow:0 .3em .9em rgba(60,20,20,.28);transform:rotate(var(--r,-2deg))}
.book-page figure img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.book-page figcaption{font-size:.8em;font-style:italic;padding:.35em 0 .1em;color:#6a3a46}
.book-page .page-number{position:absolute;bottom:4%;left:0;right:0;font-size:.75em;opacity:.5}
.book-page.bleed{padding:0}
.book-page.bleed img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.book-page.bleed:before{content:"";position:absolute;inset:0;background:linear-gradient(transparent 50%,rgba(26,10,16,.8));z-index:1}
.book-page.bleed .bleed-label{z-index:2;color:white;position:absolute;left:8%;right:8%;bottom:10%}
.book-page.bleed h2{color:white}
.book-page.bleed .page-number{color:white;z-index:3}
.book-page img{filter:blur(15px);transition:filter .55s ease,opacity .55s ease}
.book-page img.ready{filter:blur(0)}
.book-page img.no-image{filter:none;background:#e6d9c5}
.book-footer{position:relative;z-index:5;display:flex;align-items:center;justify-content:center;gap:12px;padding:6px 18px 16px}
.book-footer>button{width:46px;height:46px;flex:none;border-radius:50%;border:1px solid rgba(90,34,49,.25);background:rgba(255,255,255,.55);backdrop-filter:blur(10px);color:var(--book-ui);font-size:1.7rem;line-height:1}
.book-counter{flex:0 1 320px;text-align:center;font-size:1.05rem;min-width:80px}
.progress{height:3px;border-radius:3px;background:rgba(90,34,49,.2);margin-bottom:6px;overflow:hidden}
.progress i{display:block;height:100%;width:0;background:var(--book-heart);transition:width .5s}
.book-palette{position:fixed;bottom:calc(84px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:20;display:grid;grid-template-columns:repeat(6,34px);gap:9px;padding:14px;background:rgba(255,255,255,.9);border:1px solid rgba(90,34,49,.2);border-radius:20px;box-shadow:0 9px 35px #0002}
.book-palette[hidden]{display:none}
.book-palette button{width:34px;height:34px;border:2px solid white;border-radius:50%}
.book-editor{flex:0 0 clamp(280px,28vw,375px);align-self:stretch;overflow:auto;padding:16px 19px;background:rgba(255,255,255,.86);backdrop-filter:blur(16px);border:1px solid rgba(90,34,49,.1);border-radius:18px;box-shadow:0 10px 30px #0001;font:14px/1.45 system-ui,sans-serif}
.book-editor h2{font:500 29px "Cormorant Garamond",Georgia,serif;margin:0 0 5px}
.book-editor p{font-size:12px;opacity:.85;line-height:1.6}
.book-editor label{display:block;font-weight:600;font-size:12px;margin:10px 0}
.book-editor input,.book-editor textarea,.book-editor select{display:block;width:100%;margin-top:5px;background:white;color:#3a1a22;border:1px solid #d8bbc2;border-radius:10px;padding:9px 10px;resize:vertical}
.book-editor .book-editor-actions{display:grid;gap:8px;margin-top:12px}
.book-editor-actions button{border:1px solid #93515d;background:transparent;color:#5a2231;border-radius:10px;padding:10px}
.book-editor-actions .primary{background:var(--book-c1);color:white}
.book-editor .feedback{min-height:26px;color:#5a2231;font-weight:600}
.book-plain{position:fixed;inset:50px 10px 70px;z-index:9;background:#fbf5ea;overflow:auto;padding:22px max(18px,calc((100vw - 680px)/2));border-radius:12px;box-shadow:0 10px 45px #0004;font-size:20px;line-height:1.7}
.book-plain article{border-bottom:1px solid #c8ac98;padding:20px 0}
.book-plain img{max-width:100%;border-radius:8px}
.book-plain h2{font:32px "Great Vibes",cursive;color:var(--book-ac)}
@media(max-width:820px){.workspace:has(.book-editor){flex-direction:column}.workspace:has(.book-editor) .book-stage{min-height:40dvh}.book-editor{flex:0 1 auto;min-height:20vh;max-height:38vh}.book-header{padding:8px 14px}.book-header .preview{font-size:10px}}
@media(max-width:520px){.book-brand{font-size:10px}.book-header .return span{display:none}.book-footer{gap:7px;padding:5px 8px 13px}.book-footer>button{width:40px;height:40px}.book-palette{grid-template-columns:repeat(6,30px)}}
@media(max-height:520px){.book-footer{padding:3px 10px}.book-counter span{display:none}.book-header{padding:5px 12px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important}.book,.book-leaf{transition-duration:.01s!important}.hearts{display:none}}

/* V2: independent cover hue, accessible editorial blocks and studio catalog. */
:root {
  --book-c1:#624633;
  --book-c2:#2e2019;
  --book-ac:#7c4b32;
  --book-bg1:#f8f5ee;
  --book-bg2:#e8ded0;
}
html[data-zi-theme="dark"] body.zi-love-book {
  --book-bg1:#201c19; --book-bg2:#171411;
  --book-ui:#f8eee1;
}
html[data-zi-theme="light"] body.zi-love-book {
  --book-bg1:#f8f5ee; --book-bg2:#e8ded0;
  --book-ui:#5a3b32;
}
@media (prefers-color-scheme:dark) {
  html:not([data-zi-theme]) body.zi-love-book {
    --book-bg1:#201c19; --book-bg2:#171411; --book-ui:#f8eee1;
  }
}
.book-cover-initials {
  display:block;margin:.6em auto .2em;color:var(--book-gold);
  font:500 calc(var(--pw)*.063)/1.2 "Cormorant Garamond",Georgia,serif;
  letter-spacing:.25em;
}
.book-cover-date {
  margin:1.1em 0 0;color:#e4c78a;opacity:.84;
  font:500 calc(var(--pw)*.037)/1.4 "Cormorant Garamond",Georgia,serif;
  text-transform:uppercase;letter-spacing:.16em;
}
.book-page-blocks {
  height:100%;width:100%;display:flex;flex-direction:column;
  align-items:center;justify-content:center;justify-content:safe center;
  min-width:0;min-height:0;
  padding:0;margin:0;gap:.2em;overflow:hidden;
}
.book-page-blocks--dense{font-size:.9em;gap:.12em}
.book-page-blocks--compact{font-size:.8em;gap:.08em}
.book-page-blocks--dense h2{margin-bottom:.2em;line-height:1.05}
.book-page-blocks--dense h3{margin:.12em}
.book-page-blocks--dense p{line-height:1.38}
.book-page-blocks--dense li{margin:.24em 0}
.book-page-blocks .book-block {max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
.book-page-blocks h3 {margin:.2em;font:italic 1.25em/1.3 "Cormorant Garamond",Georgia,serif}
.book-page-blocks blockquote {
  margin:.4em auto;color:var(--book-ac);
  font:italic 1.3em/1.3 "Cormorant Garamond",Georgia,serif;max-width:94%;
}
.book-page-blocks .book-block-date,.book-page-blocks .book-block-caption {
  font-size:.8em;letter-spacing:.06em;opacity:.7;
}
.book-page-blocks .book-block-heart {
  display:inline-block;color:var(--book-ac);font-size:1.7em;
}
.book-page-blocks .book-block-divider {
  width:40%;border:0;border-top:1px solid var(--book-gold);margin:.55em 0;
}
.book-page-blocks figure {max-height:45%;flex:none;margin:.25em 0}
.book-page-blocks figure img {height:100%;max-height:calc(var(--ph)*.35);object-fit:cover}
.book-page-blocks.book-bleed-content {
  position:absolute;z-index:2;inset:0;padding:12%;
  display:flex;justify-content:end;color:#fff;
  background:linear-gradient(transparent 45%,rgba(28,13,17,.75));
}
.book-page.bleed .book-bleed-content .book-block,.book-page.bleed .book-bleed-content h2 {
  color:white;
}
.book-page.bleed .book-bleed-content .book-block-heart{color:#f0cf91}
.book-photo-slot {
  width:85%;padding:1em;border:1px dashed #b09b85;
  font-size:.8em;color:#887a6a;
}
.book-editor .book-templates-panel,.book-editor .book-block-editor {
  margin:18px 0;padding:12px;background:rgba(255,255,255,.65);
  border:1px solid rgba(90,34,49,.12);border-radius:14px;
}
.book-editor .book-templates-panel h3,.book-editor .book-block-editor h3 {
  font:600 22px "Cormorant Garamond",Georgia,serif;margin:0;
}
.book-editor .book-templates-panel p,.book-editor .book-block-editor p {
  font-size:12px;line-height:1.5;color:#655b55;
}
.book-template-list {display:grid;gap:8px;max-height:235px;overflow:auto}
.book-template-tile {
  display:flex;gap:10px;align-items:center;min-width:0;border:1px solid #d6c8b7;
  padding:7px;border-radius:10px;background:#fff;color:#43362d;text-align:left;
}
.book-template-cover {
  width:55px;height:75px;flex:none;border-radius:3px 7px 7px 3px;
  display:grid;place-items:center;color:#f8dcaa;
  font:500 15px "Great Vibes",cursive;
  box-shadow:inset 5px 0 6px #0006,3px 4px 6px #0002;
  padding:7px;text-align:center;
}
.book-template-info {display:grid;gap:5px;min-width:0}
.book-template-info strong {font-size:12px}
.book-template-info small {font:11px/1.4 system-ui,sans-serif;color:#61544a}
.book-add-blocks {display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}
.book-add-blocks button,.book-duplicate,.book-block-editor>button {
  border:1px solid #cab39f;border-radius:10px;padding:7px 9px;
  background:#fff8ee;color:#56392d;font-size:12px;
}
.book-block-list {
  padding:0;display:grid;gap:5px;list-style:none;margin:8px 0;
  max-height:240px;overflow-y:auto;
}
.book-block-row {display:flex;gap:4px;align-items:stretch;min-width:0}
.book-block-row button {
  border:1px solid #d7c1b5;padding:7px;border-radius:8px;
  background:#fff;color:#543d32;font-size:12px;
}
.book-block-row button[aria-pressed="true"] {
  outline:2px solid #956d50;outline-offset:-2px;
}
.book-block-row .book-block-pick {
  flex:1;text-align:left;min-width:0;white-space:nowrap;text-overflow:ellipsis;
  overflow:hidden;cursor:grab;
}
.book-block-row .book-block-move {min-width:32px;flex:none}
.book-block-hint {color:#655a4f}


/* Original physical model: textured leaves, tactile turning, visible edges. */
.book-leaf{transform-style:preserve-3d;-webkit-transform-style:preserve-3d;filter:none!important}
.book-face.front,.book-face.back{box-shadow:inset 0 0 11px rgba(57,30,22,.09)}
.book-face.front::after,.book-face.back::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:7;
  background:linear-gradient(90deg,rgba(24,13,13,.7),transparent 70%);
  opacity:var(--fold-shadow,0)
}
.book-face.back::after{background:linear-gradient(270deg,rgba(24,13,13,.7),transparent 70%)}
.book-page{color:#332521;line-height:1.35}
.book-page-blocks .book-block-quote{font-style:italic;line-height:1.5}
.book-page-blocks .book-block-caption{font-style:italic;opacity:.94}
.book-page-blocks .book-block-heart{font-size:3.5em;animation:beat 2.4s ease-in-out infinite}
.book-page.bleed.pending-photo{background:linear-gradient(135deg,#f7c6b0,#c9506e)}
.book-page.bleed.pending-photo[data-index="5"]{background:linear-gradient(145deg,#e9b8d8,#7a3b8c)}
.book-page.bleed.pending-photo[data-index="8"]{background:linear-gradient(145deg,#f3c98b,#c2506a)}
.book-page.bleed.pending-photo::before{
  content:"";position:absolute;inset:0;z-index:1;
  background:radial-gradient(circle at 75% 26%,rgba(255,255,255,.5) 0 9%,transparent 9.5%),
    linear-gradient(180deg,transparent 40%,rgba(28,13,17,.78))
}
.book-page.bleed.pending-photo .book-bleed-content{
  position:absolute;inset:0;padding:10% 8%;z-index:2;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  color:#fff;background:transparent
}
.book-page.bleed .book-bleed-content .book-block,
.book-page.bleed .book-bleed-content h2{color:#fff;text-shadow:0 1px 6px rgba(0,0,0,.28)}
.book-demo-photo{padding:5px;background:#fff}
.book-photo-placeholder{
  display:grid;place-items:center;position:relative;
  width:100%;aspect-ratio:4/3;min-height:90px;
  color:rgba(255,255,255,.85);font-size:clamp(32px,7vw,62px);
  background:linear-gradient(145deg,#f6b7a8,#d96a85)
}
.book-photo-placeholder::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(circle at 72% 23%,rgba(255,255,255,.35) 0 11%,transparent 11.5%),
    linear-gradient(165deg,transparent 50%,rgba(62,28,50,.2) 51%)
}
.book-cover-date{
  font-size:clamp(13px,calc(var(--pw)*.044),21px);
  font-weight:600;letter-spacing:.08em;opacity:1;color:#f3dca0
}
.book-cover-initials{letter-spacing:.15em}
.book-cover h1{max-width:100%;overflow-wrap:anywhere}
.book-page .book-block-paragraph{line-height:1.55}
.book-page-blocks .book-block-date{opacity:1;color:#654533}
@media(prefers-reduced-motion:reduce){.book-page-blocks .book-block-heart{animation:none}}

body.zi-love-book .book-editor{flex-basis:clamp(300px,29vw,410px)}
html[data-zi-theme="dark"] body.zi-love-book .book-editor{
  background:rgba(252,245,233,.97);color:#392e29
}
html[data-zi-theme="dark"] body.zi-love-book .book-footer>button{
  background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3)
}
@media(max-width:820px){
  body.zi-love-book{overflow:auto;min-height:100dvh}
  body.zi-love-book .workspace{flex-direction:column;min-height:0}
  body.zi-love-book .book-stage{
    flex:none;width:100%;height:clamp(500px,130vw,760px);min-height:0
  }
  body.zi-love-book .book-editor{
    flex:none;max-height:none;min-height:0;width:100%;overflow:visible
  }
}

/* Physical book editing matches the supplied single-stage HTML reference.
   The dashboard shell lives outside an owner-only same-origin iframe. */
body.zi-love-book .workspace{min-height:0;flex:1;overflow:hidden}
body.zi-love-book .book-stage{min-width:0;min-height:0}
body.zi-love-book .book-edit-toolbar{padding:8px 14px;align-items:center;min-height:52px}
body.zi-love-book .book-edit-toolbar button{white-space:nowrap;min-height:34px;font:600 12px/1.3 system-ui,sans-serif}
body.zi-love-book .book-edit-toolbar .book-toolbar-spacer{flex:1;min-width:8px}
body.zi-love-book .book-edit-toolbar .book-save-action,
body.zi-love-book .book-edit-toolbar .book-publish-action{
  background:var(--book-c1);color:#fff;border-color:var(--book-c1)
}
body.zi-love-book .book-edit-toolbar .book-unpublish-action{border-color:var(--book-ac)}
body.zi-love-book .book-editor[hidden]{display:none!important}
body.zi-love-book .book-editor{
  position:absolute;z-index:9;inset:4px 6px 4px auto;
  width:min(395px,96%);max-height:none;min-height:0;flex:none;
  background:#f9f3ea;color:#43352c;border:1px solid #d7c4b2;
  box-shadow:-18px 4px 46px rgba(39,19,18,.18);overflow:auto
}
body.zi-love-book .book-settings-heading{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  position:sticky;top:-16px;z-index:2;background:#f9f3ea;padding:8px 0 12px
}
body.zi-love-book .book-settings-heading h2{margin:0}
body.zi-love-book .book-settings-heading button{
  width:34px;height:34px;flex:none;border:1px solid #ccb6a3;border-radius:50%;
  background:#fff;color:#43352c
}
body.zi-love-book .book-toast{
  position:absolute;z-index:10;top:120px;left:50%;transform:translateX(-50%);
  padding:8px 14px;margin:0;max-width:90%;border-radius:12px;
  background:rgba(255,248,237,.93);color:#563b32;font:600 12px/1.4 system-ui,sans-serif;
  box-shadow:0 6px 20px rgba(46,24,24,.12);pointer-events:none
}
body.zi-love-book .book-toast:empty{display:none}
body.zi-love-book .book-mode-edit{font-size:1.45rem}
body.zi-love-book .book-mode-edit[aria-pressed="true"]{
  background:var(--book-c1);color:#fff;border-color:var(--book-c1)
}
body.zi-love-book.in-book-editing [data-book-editable="true"]{
  cursor:text;-webkit-user-select:text;user-select:text;
  outline:1px dashed rgba(125,67,64,.6);outline-offset:3px
}
body.zi-love-book.in-book-editing [data-book-editable="true"]:focus{
  outline:2px solid var(--book-heart);border-radius:3px;
  background:rgba(255,255,255,.09)
}
body.zi-love-book.in-book-editing .book-cover [data-book-editable="true"]{
  outline-color:rgba(243,220,160,.65);caret-color:#f3dca0
}
body.zi-love-book.in-book-editing .book-page[data-index]{cursor:text}
body.zi-love-book.in-book-editing .book-page figure,
body.zi-love-book.in-book-editing .book-page .book-photo-placeholder,
body.zi-love-book.in-book-editing .book-page.bleed img{cursor:pointer}
body.zi-love-book.in-book-editing .book-page figure:before{
  content:"📷 Changer la photo";position:absolute;top:8px;left:50%;
  transform:translateX(-50%);z-index:4;background:rgba(25,16,18,.7);
  color:#fff;font:600 11px/1.3 system-ui,sans-serif;border-radius:15px;
  padding:5px 10px;white-space:nowrap;pointer-events:none
}
body.zi-love-book.in-book-editing .book-page.bleed:after{
  content:"📷 Changer la photo";position:absolute;top:12px;left:50%;
  transform:translateX(-50%);z-index:4;background:rgba(25,16,18,.7);
  color:#fff;font:600 11px/1.3 system-ui,sans-serif;border-radius:15px;
  padding:5px 10px;white-space:nowrap;pointer-events:none
}
body.zi-love-book .book-page figure{position:relative}
@media(max-width:820px){
  body.zi-love-book{height:100dvh;min-height:0;overflow:hidden}
  body.zi-love-book .workspace{display:flex;flex-direction:row;min-height:0;overflow:hidden}
  body.zi-love-book .book-stage{
    flex:1;height:auto;min-height:0;width:auto
  }
  body.zi-love-book .book-editor{
    width:min(420px,96%);inset:4px 2% 4px auto;overflow:auto
  }
}
@media(max-width:560px){
  body.zi-love-book .book-edit-toolbar{justify-content:flex-start}
  body.zi-love-book .book-edit-toolbar button{padding:7px 10px;font-size:11px}
  body.zi-love-book .book-header{min-height:44px}
  body.zi-love-book .book-toast{top:118px}
}

/* Love Book formatting (shared with the app): aligned lines, indent, bar. */
.lb-rich .lb-line{min-height:1em}
.lb-rich .lb-center{text-align:center}
.lb-rich .lb-right{text-align:right}
.lb-rich .lb-indent{text-indent:1.6em}
.lb-rich strong{font-weight:700}
.lb-rich u{text-decoration:underline;text-underline-offset:.15em}
.book-format-bar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin:4px 0 6px;padding:4px;border-radius:12px;background:rgba(160,120,90,.08)}
.book-format-bar button{min-width:34px;height:32px;border:0;border-radius:9px;background:transparent;font:inherit;font-size:15px;cursor:pointer;color:inherit}
.book-format-bar button:hover,.book-format-bar button:focus-visible{background:rgba(160,120,90,.18)}
.book-format-sep{width:1px;height:20px;background:rgba(120,90,70,.25);margin:0 4px}

/* The book appears once built, in one piece, instead of an empty shell
   that vanishes and comes back. */
.zi-love-book .book{transition:opacity .35s ease}
.zi-love-book:not(.is-built) .book{opacity:0}
@media (prefers-reduced-motion:reduce){.zi-love-book .book{transition:none}}

/* A studio book's own cover (drawn by book_cover_v1.js) fills the leaf. */
.book-cover--studio{padding:0;background:none}
.book-cover--studio:before{display:none}
.book-cover--studio>.zi-cover{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;border-radius:0!important}
.book-cover--studio.back{padding:12% 9%;display:flex;align-items:center;justify-content:center}
.book-cover--studio.back p{font-style:italic;font-size:calc(var(--pw)*.07)}

/* Studio books: no rising hearts (they are not all love stories), their
   editions in other languages in the top bar, their words for search
   engines and readers without JavaScript (visually hidden). */
.zi-love-book--studio .hearts{display:none}
.book-editions{display:flex;gap:6px;margin-left:auto;margin-right:12px}
.book-editions a{min-width:38px;height:30px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;border:1px solid currentColor;color:inherit;font:600 12px/1 "DM Sans",Arial,sans-serif;letter-spacing:.08em;text-decoration:none;opacity:.7}
.book-editions a[aria-current="page"]{opacity:1;background:rgba(255,255,255,.12)}
.book-seo-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:normal}
/* Phones: the top never widens the page (the book is sized from it). */
.book-header{min-width:0;max-width:100vw}
.book-brand{min-width:0;overflow:hidden}
.book-brand span,.book-brand small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:600px){
  .zi-love-book--studio .book-brand small{display:none}
  .zi-love-book--studio .book-brand span{font-size:10px;letter-spacing:.14em}
  .book-editions{margin-right:4px}
  .book-editions a{min-width:32px;height:28px;padding:0 8px}
}
/* A closed book has no pages on its empty side. */
.book:not(.port).at-cover .book-edge.left,.book:not(.port).at-end .book-edge.right{display:none}
