
/* styles.css */
@font-face{font-family:RubikBook;src:url("fonts/Rubik-8358f0a47ba7922b.woff2") format("woff2"),url("fonts/Rubik.ttf") format("truetype");font-weight:300 900;font-style:normal;font-display:swap;}
[hidden] { display:none !important; }   /* .btn/.row set display, which otherwise beats the hidden attribute */
:root { --ink:#1b2440; --muted:#4a5470; --accent:#0d5f68; --accent-ink:#ffffff; --line:#d5dbe6; --bg:#f4f6fa; --card:#ffffff; --bad:#a3262a; --ok:#1f6b3a; }
* { box-sizing:border-box; }
html { font-family: system-ui, "Segoe UI", Roboto, "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif; color:var(--ink); background:var(--bg); }
body { margin:0; padding:0 12px 32px; max-width:1100px; margin-inline:auto; line-height:1.5; }
.top { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px 0; }
h1 { font-size:1.4rem; margin:0; } h2 { font-size:1.15rem; margin:0 0 10px; }
.tag { font-size:.8rem; font-weight:500; color:var(--muted); border:1px solid var(--line); border-radius:6px; padding:1px 6px; }
.actions, .row, .nav { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; margin:12px 0; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; }
label { display:flex; flex-direction:column; gap:4px; font-weight:600; font-size:.95rem; }
input, textarea, select { font:inherit; font-weight:400; color:var(--ink); background:#fff; border:1px solid #9aa4b8; border-radius:8px; padding:10px; min-height:48px; }
textarea { resize:vertical; min-height:96px; font-size:1.2rem; }
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible { outline:3px solid #2a6fdb; outline-offset:2px; }
.btn { font:inherit; font-weight:600; border:0; border-radius:10px; padding:10px 16px; min-height:48px; min-width:48px; background:var(--accent); color:var(--accent-ink); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.btn.secondary { background:#e7edf5; color:var(--ink); border:1px solid #b9c3d4; }
.btn.danger { background:#f6e3e3; color:var(--bad); border:1px solid #e0b4b4; }
.btn[disabled] { opacity:.55; cursor:not-allowed; }
.status { min-height:1.5em; margin:0; font-weight:600; }
.status.bad { color:var(--bad); } .status.ok { color:var(--ok); }
.muted { color:var(--muted); } .small { font-size:.85rem; }
.stage { margin:12px 0; display:flex; justify-content:center; }
.spread { position:relative; width:100%; aspect-ratio:2/1; border-radius:8px; overflow:hidden; background:#ccd5e3 center/cover no-repeat; display:flex; flex-direction:row; box-shadow:0 2px 10px rgba(20,30,60,.18); }
.spread::after { content:""; position:absolute; inset:0 50% 0 auto; width:2px; background:rgba(20,30,60,.25); }
.page { position:relative; flex:1 1 50%; display:flex; flex-direction:column; justify-content:center; padding:4%; }
.page .num { position:absolute; bottom:6px; inset-inline-start:10px; font-size:.8rem; color:var(--ink); background:rgba(255,255,255,.8); border-radius:4px; padding:0 4px; }
.page.band-top { justify-content:flex-start; padding:0; } .page.band-bottom { justify-content:flex-end; padding:0; }
.page.band-bottom .num { bottom:auto; top:6px; }   /* the number sits clear of the text band (it covered wrapped band text on a phone) */
.ptext { font-size:clamp(1rem, 2.6vw, 2rem); line-height:1.45; white-space:pre-wrap; color:var(--ink); background:rgba(255,255,255,.82); border-radius:8px; padding:3% 4%; margin:0; }
.band-top .ptext, .band-bottom .ptext { border-radius:0; background:rgba(255,255,255,.92); }
/* reader15 band, scaled to the page width on a 386 dp leaf (ArtPage.kt): 16/18 dp outside, 12/18 dp inside, 24 sp on 36 sp, #FBF8F1 at .94 */
.page.leaf { container-type:inline-size; overflow:hidden; background-color:#fff; }
.page.leaf .ptext { margin:4.15cqw 4.66cqw; padding:3.11cqw 4.66cqw; border-radius:4.15cqw; background:rgba(251,248,241,.94); font-size:6.22cqw; line-height:9.33cqw; text-align:center; max-height:calc(100% - 8.3cqw); overflow:auto; }
.reader-page .page.leaf { flex:none; width:min(100%, 62vh); aspect-ratio:1/1; padding:0; border-radius:10px; box-shadow:0 2px 10px rgba(20,30,60,.18); }
.board { position:relative; width:min(100%, 520px); aspect-ratio:1/1; border-radius:8px; overflow:hidden; background:#ccd5e3 center/cover no-repeat; display:flex; flex-direction:column; justify-content:flex-end; box-shadow:0 2px 10px rgba(20,30,60,.18); }
.board.wide { width:100%; aspect-ratio:2/1; }   /* the end page: a full 2:1 spread picture (reader14) */
.board .ptext { margin:4%; text-align:center; }
.board h3 { margin:0; font-size:clamp(1.3rem,4vw,2.2rem); }
.editor { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.editor fieldset { border:1px solid var(--line); border-radius:10px; padding:10px; margin:0; display:flex; flex-direction:column; gap:8px; }
.editor legend { font-weight:700; padding:0 4px; }
.clips { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.clips li { display:flex; flex-wrap:wrap; align-items:center; gap:8px; border:1px solid var(--line); border-radius:10px; padding:8px; }
.clips .what { flex:1 1 220px; min-width:0; }
.clips .what b { display:block; } .clips .what span { color:var(--muted); font-size:.9rem; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pill { font-size:.85rem; border-radius:999px; padding:2px 10px; border:1px solid var(--line); }
.pill.ok { color:var(--ok); border-color:#9cc8aa; } .pill.missing { color:var(--bad); border-color:#e0b4b4; } .pill.todo { color:var(--muted); border-color:var(--line); }
.checklist { padding-inline-start:20px; } .checklist .bad { color:var(--bad); } .checklist .ok { color:var(--ok); } .checklist .hint { color:var(--muted,#667575); list-style:none; margin-inline-start:-20px; }
.report { background:#f0f3f8; border:1px solid var(--line); border-radius:8px; padding:10px; white-space:pre-wrap; direction:ltr; text-align:left; font-size:.85rem; max-height:280px; overflow:auto; }
@media (max-width:600px){ .ptext { font-size:clamp(.8rem, 3.4vw, 1.2rem); } h1 { font-size:1.2rem; } }

.steps { margin:6px 0 12px; padding-inline-start:20px; } .steps li { margin:2px 0; }
.review { border-top:1px solid var(--line); margin-top:12px; padding-top:10px; }
.review table { width:100%; border-collapse:collapse; font-size:.95rem; } .review td, .review th { border-bottom:1px solid var(--line); padding:6px 4px; text-align:start; vertical-align:top; }
.flag { color:var(--bad); font-weight:600; } .proof { font-family:ui-monospace, monospace; font-size:.8rem; direction:ltr; text-align:left; white-space:pre-wrap; background:#f4f6fa; border-radius:8px; padding:8px; }
.warn { color:var(--bad); font-weight:600; }
.locked textarea, .locked select { background:#eef1f6; }
.reader { position:fixed; inset:0; background:#fbfcfe; z-index:50; display:flex; flex-direction:column; padding:12px; gap:10px; touch-action:pan-y; }
.reader[hidden] { display:none; }
.reader-top { display:flex; align-items:center; gap:10px; font-weight:700; }
.rec-dot { width:14px; height:14px; border-radius:50%; background:#9aa4b8; } .rec-dot.on { background:#c62828; } .rec-dot.paused { background:#4a5470; }
.reader-page { flex:1; display:flex; align-items:center; justify-content:center; text-align:center; font-size:clamp(1.4rem, 4.5vw, 2.6rem); line-height:1.6; border:1px solid var(--line); border-radius:14px; padding:8px; background:#fff; overflow:auto; }
.reader-alert { font-weight:700; color:var(--bad); border:2px solid var(--bad); border-radius:10px; padding:10px; background:#fff; }
.reader-nav { display:flex; gap:10px; justify-content:space-between; } .btn.big { min-height:64px; min-width:120px; font-size:1.2rem; }
.note-unproven { border:1px solid #9aa4b8; border-inline-start:6px solid var(--accent); border-radius:10px; background:#eef3f7; color:var(--ink); padding:8px 12px; margin:8px 0; } .note-unproven p { margin:4px 0; }
@media (max-width: 600px) { .review table, .review tbody, .review tr, .review td { display:block; width:auto; } .review tr { border-bottom:1px solid var(--line); padding:6px 0; } .review td { border:0; padding:2px 0; } }
.nowrap { white-space:nowrap; }
.tech { margin:8px 0; } .tech > summary { cursor:pointer; color:var(--muted); font-weight:600; min-height:32px; padding:4px 0; }
.tech > summary:focus-visible { outline:3px solid #2a6fdb; outline-offset:2px; } .tech .report { margin-top:6px; }
.note-unproven h3 { font-size:1rem; margin:2px 0 4px; } .note-unproven ul { margin:4px 0; padding-inline-start:20px; } .note-unproven li { margin:2px 0; }

/* v5: start screen + gallery, whole-text mode, image grid, log button */
body[data-screen="start"] #book { display:none; } body[data-screen="book"] #start { display:none; }
.start { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; margin:12px 0; }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; margin:10px 0; }
.story-card { font:inherit; color:var(--ink); text-align:start; background:#fff; border:1px solid #b9c3d4; border-radius:12px; padding:0; overflow:hidden; cursor:pointer; display:flex; flex-direction:column; min-height:48px; }
.story-card:focus-visible { outline:3px solid #2a6fdb; outline-offset:2px; }
.story-card img { width:100%; aspect-ratio:2/1; object-fit:cover; display:block; background:#e7edf5; }
.story-card .info { padding:8px 12px 12px; display:flex; flex-direction:column; gap:2px; }
.story-card .t { font-size:1.15rem; font-weight:700; } .story-card .ages { color:var(--muted); font-weight:600; }
.story-card .lic { color:var(--muted); font-size:.8rem; overflow-wrap:anywhere; } .story-card .note { font-size:.85rem; font-weight:600; color:var(--ink); } .story-card .demo { align-self:flex-start; font-size:.8rem; border:1px solid var(--line); border-radius:6px; padding:0 6px; color:var(--muted); }
.story-card[aria-busy="true"] { opacity:.6; cursor:progress; }
.start-more h3 { font-size:1rem; margin:8px 0; color:var(--muted); }
.modes { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; } .modes .btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.whole textarea { width:100%; min-height:220px; line-height:1.6; }
.whole-preview { list-style:none; padding:0; margin:8px 0; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; }
.whole-preview li { border:1px solid var(--line); border-radius:10px; padding:8px; background:#fbfcfe; }
.whole-preview li.bad { border-color:#e0b4b4; background:#fbf1f1; }
.whole-preview b { display:block; font-size:.9rem; color:var(--muted); } .whole-preview .pt { white-space:pre-wrap; max-height:9.5em; overflow:auto; font-size:1.05rem; }
.art-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:10px; margin:10px 0; }
.art-item { border:1px solid var(--line); border-radius:10px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.art-item img { width:100%; aspect-ratio:2/1; object-fit:contain; background:#f0f3f8; border-radius:6px; border:1px solid var(--line); }
.art-item.square img { aspect-ratio:1/1; } .art-item b { font-size:.95rem; } .art-item .meta { font-size:.8rem; color:var(--muted); direction:rtl; }
.art-item .row .btn { padding:6px 10px; min-height:44px; }
label.check { flex-direction:row; align-items:center; gap:8px; font-weight:600; } label.check input { min-height:24px; width:24px; height:24px; }
.btn.small { min-height:40px; padding:6px 12px; font-size:.9rem; }
footer .row { margin-top:6px; }
body[data-screen="start"] #save-draft, body[data-screen="start"] #go-export, body[data-screen="start"] #go-start, body[data-screen="start"] .top .actions label[for="open-file"] { display:none; }

/* layout editor (layout.js): one spread, two square leaves; text in cqw of the leaf at the 286 dp reader size */
body[data-screen="start"] #layout, body[data-screen="book"] #layout { display:none; }
body[data-screen="layout"] #book, body[data-screen="layout"] #start { display:none; }
body[data-screen="layout"] #save-draft, body[data-screen="layout"] #go-export, body[data-screen="layout"] .top .actions label[for="open-file"] { display:none; }
.lay { padding:10px; }
.lay-head { display:flex; align-items:baseline; gap:10px; } .lay-head h2 { margin:0; }
.lay-tpl { margin:8px 0; } .lay-tpl select { flex:1 1 180px; min-width:0; }
.lspread { display:flex; flex-direction:row; gap:6px; width:min(100%, 116vh); margin:0 auto; }
.lleaf { position:relative; flex:1 1 50%; aspect-ratio:1/1; container-type:inline-size; overflow:hidden; background:#fff; border-radius:6px; box-shadow:0 1px 6px rgba(20,30,60,.22); }
.lart, .ltext { position:absolute; box-sizing:border-box; touch-action:none; }
.lpic { position:absolute; overflow:hidden; } .lsrc { position:absolute; background-size:100% 100%; background-repeat:no-repeat; }
.ltext { padding:0; display:flex; align-items:center; overflow:hidden; background:rgba(251,248,241,.94); border-radius:3cqw; color:var(--ink); }
.ltext p { width:100%; margin:0; white-space:pre-wrap; } .ltext.align-center { text-align:center; } .ltext.align-start { text-align:start; }
.ltext.over { outline:2px solid var(--bad); outline-offset:-2px; }
.lart.sel, .ltext.sel { outline:2px dashed #2a6fdb; outline-offset:-1px; }
.ltext.over.sel { outline:2px solid var(--bad); }
.lhandle { display:none; position:absolute; right:-1px; bottom:-1px; width:24px; height:24px; background:rgba(42,111,219,.85); border-radius:8px 0 4px 0; cursor:nwse-resize; touch-action:none; }
.sel > .lhandle { display:block; }
.lfit { position:fixed; left:0; top:0; width:460px; height:0; overflow:hidden; visibility:hidden; pointer-events:none; z-index:-1; } .lfit .lleaf { width:460px; flex:none; }
.lleafbtns { display:flex; flex-direction:row; gap:6px; width:min(100%, 116vh); margin:6px auto 0; }
.lbtns { flex:1 1 50%; display:flex; flex-wrap:wrap; gap:4px; justify-content:center; }
.lbtns .btn { flex:1 1 80px; padding:4px 6px; min-height:40px; font-size:.85rem; }
.lay-tools { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:8px 0; }
.lay-tools select { min-height:40px; padding:4px 8px; }
.lay-size { order:3; flex:1 1 100%; flex-direction:row; align-items:center; gap:8px; font-weight:600; } .lay-size input { flex:1 1 auto; min-height:32px; padding:0; }
.lay-align { display:inline-flex; gap:4px; } .lay-align .btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); }
.lay-msg { color:var(--bad); font-weight:600; margin:6px 0; }
.lay-lock { flex-basis:100%; margin:2px 0 0; color:var(--muted); font-size:.9rem; }
.lay-tools.locked select, .lay-tools.locked input, .lay-tools.locked button { opacity:.6; }
.lock-notice { margin:6px 0; padding:6px 10px; border:1px solid var(--line, #c9cfdc); border-radius:8px; background:#eef2fa; color:inherit; font-size:.9rem; }
.lock-notice button { margin-inline-start:6px; }
.lay-nav { justify-content:space-between; margin-top:6px; } .lay-nav .btn { flex:1 1 0; min-width:0; padding:8px 6px; }
.lay-go { margin-top:10px; align-items:center; } .lay-go #lay-record { flex:1 1 auto; }
.lay.locked .lart, .lay.locked .ltext { cursor:default; }
.ltext.hi { box-shadow:0 0 0 2px rgba(42,111,219,.35); background:rgba(236,243,255,.96); }
.reader-page .rspread { width:min(100%, 118vh); }
@media (orientation:landscape) and (max-height:500px) { .lay .lspread, .lay .lleafbtns { width:min(100%, 118vh); } }

.fmt-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.fmt-row select { font: inherit; padding: .25rem .4rem; }

/* Phone-first staged work. One task is visible; required fields remain in the details step. */
#wizard {margin:12px 0;padding:14px;background:var(--card);border:1px solid var(--line);border-radius:14px;}
#wizard-step {font-weight:700;margin:0 0 4px;} #wizard-help {margin:0 0 10px;} #wizard .row {display:grid;grid-template-columns:1fr 1fr;margin-bottom:8px;}
body[data-screen="start"] #wizard {display:none;}
body:not([data-screen="start"]) #start {display:none;}
body[data-screen="layout"] #wizard {display:block;}
body[data-screen="book"] #book > .card {display:none;}
body[data-wizard="details"] #book > .wizard-details {display:block;}
body[data-wizard="preview"] #book > #wizard-preview,body[data-wizard="review"] #book > #wizard-preview,body[data-wizard="review"] #book > #export-card {display:block;}
body[data-wizard="review"] #book > #take-card {display:block;}
body[data-wizard="edit"] #book > .wizard-edit,body[data-wizard="edit"] #book > #images-card {display:block;}
#wp-stage {margin:14px 0;display:flex;justify-content:center;} #wp-stage > .lspread {width:100%;} #wp-stage > img {width:100%;max-height:60vh;object-fit:contain;}
.top .actions {gap:6px;} #go-export {display:none;} .lay-go {display:none;}
#wizard-next {min-width:0;} #wp-audio .btn {flex:1;min-width:0;} .nav {flex-wrap:nowrap;} .nav select {min-width:0;flex:1;} .nav .btn {padding:8px;}
@media(max-width:600px){body{padding:0 10px 24px;} .top{padding:10px 0}.top .actions{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.top .btn{padding:8px;font-size:.85rem} .grid{grid-template-columns:1fr}.gallery{grid-template-columns:1fr}.story-card img{max-height:180px}.lay-nav{display:grid;grid-template-columns:1fr 1fr 1fr}.lay-nav .btn{padding:8px;min-width:0}.btn.big{min-width:0;min-height:52px}.reader-nav{gap:6px}.reader-nav .btn{flex:1;padding:8px;font-size:1rem} .reader-page{font-size:1.25rem} .lay-tpl{display:grid;grid-template-columns:1fr}.lay-tpl select{width:100%}}

body{padding-bottom:108px;} #wizard .row{position:fixed;bottom:0;inset-inline:0;z-index:22;background:var(--card);padding:10px;box-shadow:0 -2px 12px #1b244018;max-width:1100px;margin:0 auto;} #wizard .small{display:block;} #wizard{padding:12px;} #take-card .steps,#take-card > .muted{display:none;} footer{margin:16px 0;} footer summary{min-height:44px;padding:10px;cursor:pointer;}

#layout-more{margin-top:10px} #layout-more>summary{min-height:44px;padding:10px;border:1px solid var(--line);border-radius:8px;cursor:pointer} body[data-wizard="review"] #export{display:none;} body[data-wizard="preview"] #wizard-preview>.small,body[data-wizard="review"] #wizard-preview>.small{display:none;}

/* Actions follow the active task in normal flow. They never cover a field or a keyboard. */
#wizard-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;padding:10px 0;position:static;}
body[data-screen="start"] #wizard-actions{display:none;} body{padding-bottom:24px;} #wizard .row{position:static;}

#r-choice {flex-wrap:wrap;} #r-choice .btn {flex:1 1 140px;}

#story-interview{margin-top:20px;} #interview-pages{padding-inline-start:24px;} #interview-pages li{padding:12px 0;border-bottom:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere;} #story-interview .grid{margin-bottom:16px;}

#start.interview-open > :not(#story-interview){display:none;} #start.interview-open{padding:0;background:transparent;border:0;} #start.interview-open #story-interview{margin-top:0;}

body[data-wizard="cover"] #book>.wizard-cover{display:block;} #cover-preview{display:block;width:min(100%,420px);height:auto;margin:16px auto;} #cover-design input[type="checkbox"]{width:auto;}

body[data-wizard="ending"] #book>.wizard-ending{display:block;}#end-preview{display:block;width:100%;height:auto;margin:16px auto;}#end-design input[type="checkbox"]{width:auto;}

.reader-page>img{display:block;flex:none;width:100%;min-width:0;max-width:100%;height:auto;max-height:100%;object-fit:contain;}

.credits-record-copy{font-size:clamp(16px,3.8vw,24px);text-align:center;max-width:100%;margin:auto}.credits-record-copy p{margin:12px 0}.reader-page:has(>.credits-record-copy){display:block;}
/* Rendered covers/end art in edit preview must fit the phone, including CSP-only styling. */
.stage>img{display:block;flex:none;width:100%;min-width:0;max-width:100%;height:auto;object-fit:contain;}

#cover-design>label,#end-design>label{flex-direction:row;align-items:center;gap:10px;}
#cover-design>label>input,#end-design>label>input{flex:none;min-width:28px;min-height:48px;margin:0;}

body[data-wizard="dedication"] #book>.wizard-dedication{display:block;}#dedication-preview{display:block;width:100%;height:auto;margin:16px auto;}#dedication-design>label{flex-direction:row;align-items:center;gap:10px;}#dedication-enable{flex:none;width:auto;min-width:28px;}

body[data-wizard="backcover"] #book>.wizard-backcover{display:block;}#back-preview{display:block;width:100%;height:auto;margin:16px auto;}#back-design>label{flex-direction:row;align-items:center;gap:10px;}#back-enable{flex:none;width:auto;min-width:28px;}


html,input,textarea,button,select{font-family:RubikBook,Arial,sans-serif;}

.interest-field>label{display:block;font-weight:700;margin-bottom:6px}.interest-entry{display:flex;gap:8px;align-items:stretch}.interest-entry input{min-width:0;flex:1}.interest-entry .btn{flex:none;padding:10px 14px}.interest-list{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.interest-chip{display:inline-flex;align-items:center;gap:8px;background:#e8f2ee;border:1px solid #b5cdc3;border-radius:24px;padding:5px 10px;max-width:100%;overflow-wrap:anywhere}.interest-chip button{border:0;background:transparent;color:#123d32;font-size:24px;line-height:1;min-width:32px;min-height:32px;cursor:pointer}

#lay-close-preview{display:none}.full-spread-preview #lay-stage{position:fixed;inset:0;z-index:1000;background:#101010;display:flex;align-items:center;justify-content:center;padding:0;overflow:hidden}.full-spread-preview #lay-stage>:not(.lspread){display:none}.full-spread-preview #lay-stage .lspread{width:min(100vw,200vh);max-width:none;flex:none;gap:0;border:0;border-radius:0;box-shadow:none}body[data-page-shape="portrait34"] .full-spread-preview #lay-stage .lspread{width:min(100vw,150vh)}.full-spread-preview .lleaf{border:0;border-radius:0;box-shadow:none}.full-spread-preview #lay-close-preview{display:block;position:fixed;top:12px;left:12px;z-index:1001;background:#fff;color:#123;font-size:14px}.full-spread-preview .lhandle{display:none}

.load-shade{position:fixed;inset:0;z-index:2000;background:rgba(18,30,40,.7);display:flex;align-items:center;justify-content:center;padding:18px}.load-panel{background:white;color:#1b2440;border-radius:16px;padding:24px;width:min(100%,480px);box-shadow:0 8px 36px #0005}.load-panel h2{margin-top:0}.load-panel p{line-height:1.7}.load-warning{background:#fff1cd;color:#573b00;border:2px solid #a97700;border-radius:10px;padding:14px;font-weight:600}.status.bad{position:sticky;top:0;z-index:20;background:#fff3f3;padding:16px;border:2px solid #a3262a;border-radius:10px}.status.ok{background:#edf9ee;padding:12px;border-radius:10px}
.cover-canvas{position:relative;max-width:520px;width:100%;aspect-ratio:1;background:#eef0f5;border:1px solid #b6c2d6;border-radius:8px;margin:16px auto;touch-action:none;overflow:hidden}.cover-canvas #cover-preview{display:block;width:100%;max-width:none;margin:0;border:0;border-radius:0;aspect-ratio:1;object-fit:contain;pointer-events:none}.cover-hit-layer{position:absolute;inset:0}.cover-hit{position:absolute;display:block;background:transparent;border:1px solid transparent;padding:0;min-width:0;min-height:0;touch-action:none;cursor:move;border-radius:3px}.cover-hit.selected{outline:2px dashed #075f6a;outline-offset:3px;background:#1b95a018}.cover-hit.selected:after{content:'';position:absolute;width:10px;height:10px;border-radius:50%;background:#fff;border:2px solid #075f6a;right:-8px;bottom:-8px}.cover-direct-tools{margin:12px 0;padding:14px;border-radius:12px;background:#eef5f7}.cover-direct-tools input,.cover-direct-tools select{max-width:100%;min-width:0}.cover-direct-tools .grid{grid-template-columns:1fr 1fr;gap:12px}.cover-direct-tools label{font-size:.9rem}.cover-direct-tools .row{display:flex;gap:8px;flex-wrap:wrap}.cover-direct-tools [aria-pressed=true]{background:#075f6a;color:white}.cover-selected{font-weight:600}.cover-direct-tools button{min-height:44px}.cover-canvas.readonly{touch-action:auto}

.cover-fast-preview{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.cover-hit-layer{z-index:2}

.cover-fast-bg,.cover-moving{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.cover-moving{will-change:transform}
.cover-static-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
/* Full-screen studio keeps the book as the primary surface. */
.studio-open{overflow:hidden}.studio-launch{width:100%;margin:12px 0;min-height:52px}.cover-direct-tools:not(#studio-controls .cover-direct-tools){display:none}body:not(.studio-open) .cover-canvas{max-width:240px;cursor:pointer}#book-studio{position:fixed;inset:0;z-index:3000;background:#f1efec;color:#251f21;display:flex;flex-direction:column;width:100%;height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);overflow:hidden;font-family:RubikBook,Arial,sans-serif}#book-studio[hidden]{display:none}.studio-header{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;background:white;border-bottom:1px solid #ddd;min-height:70px}.studio-header h2{font-size:17px;margin:0}.studio-header span{font-size:11px;color:#686363}.studio-header button{min-height:44px;min-width:44px;border:0;border-radius:8px;font:inherit;cursor:pointer}.studio-done{background:#075f6a;color:white;padding:0 18px}.studio-history{display:flex;gap:6px}.studio-history button{background:#efefef;font-size:24px}.studio-workspace{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:16px;overflow:hidden}#studio-stage{width:100%;height:100%;min-height:0;display:flex;align-items:center;justify-content:center}#book-studio .cover-canvas{max-width:min(100%,calc(100dvh - 320px));max-height:100%;margin:0;box-shadow:0 8px 24px #30282020;border-radius:3px;flex-shrink:0}#book-studio .cover-canvas img{border-radius:0}#studio-error{font-size:12px;color:#a3262a;text-align:center;max-height:56px;overflow:auto}#studio-footer{padding:10px 12px 4px;background:white;border-top:1px solid #ddd;flex:0 0 auto}#studio-footer .row{justify-content:center;gap:6px;margin:0}#studio-footer .studio-picks{display:grid;grid-template-columns:repeat(4,1fr)}#studio-footer .studio-picks button{font-size:13px;min-height:44px;padding:6px;border:1px solid #dedede;background:white;color:#4e4848;border-radius:8px}#studio-footer .studio-picks [aria-pressed=true]{background:#075f6a;border-color:#075f6a;color:white}#studio-footer .studio-common{display:grid;grid-template-columns:repeat(4,1fr);margin-top:8px}#studio-footer .studio-common button{font-size:11px;padding:4px;min-height:42px;background:#f3f5f5;border:0}#book-studio[data-selection=text] .studio-common{visibility:hidden;pointer-events:none}#studio-properties{flex:0 0 auto;border:0;background:white;color:#075f6a;font:600 14px RubikBook,Arial,sans-serif;padding:12px;min-height:44px}.studio-tip{background:white;color:#767070;font-size:10px;text-align:center;padding:0 10px 9px;flex:0 0 auto}#studio-tray{position:absolute;bottom:0;left:0;right:0;z-index:4;background:white;border-radius:18px 18px 0 0;box-shadow:0 -12px 40px #30282030;max-height:48dvh;overflow:auto;padding:14px 18px calc(16px + env(safe-area-inset-bottom))}.studio-tray-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:-14px;background:white;z-index:3;padding:4px 0 10px}.studio-tray-head button{width:44px;height:44px;background:#f3f3f3;border:0;border-radius:50%;font-size:25px}#studio-controls .cover-direct-tools{background:white;border:0;padding:0;margin:0;display:block}#studio-controls .cover-direct-tools>p,#studio-controls .cover-direct-tools>.cover-selected,#studio-controls .cover-direct-tools>.row{display:none}#studio-controls .cover-direct-tools label{font-size:12px}#studio-controls .cover-direct-tools .grid{gap:10px}#studio-controls input,#studio-controls select{min-height:44px}#studio-advanced{margin-top:12px;border-top:1px solid #eee;padding-top:12px;font-size:13px}#book-studio #lay-stage{width:100%;max-width:1100px;margin:auto}#book-studio .lspread{width:100%;max-height:calc(100dvh - 270px)}#book-studio #lay-style-tools,#book-studio #lay-tools{border:0;padding:0;background:white}#book-studio .studio-spread-nav{display:flex;justify-content:space-between;gap:8px}#book-studio .studio-spread-nav button{min-height:44px;flex:1;font-size:13px}#book-studio #cover-settings{margin:0}#book-studio .cover-canvas.readonly{touch-action:auto}@media(min-width:800px){#book-studio{padding-right:320px}#studio-tray{right:0;left:auto;top:70px;bottom:0;width:320px;max-height:none;border-radius:0;box-shadow:none;border-right:1px solid #ddd}#studio-tray[hidden]{display:block}#studio-properties{display:none}#book-studio .cover-canvas{max-width:min(100%,calc(100dvh - 245px))}.studio-workspace{padding:24px}#studio-footer .studio-common{display:flex}#studio-footer .studio-common button{padding:8px 16px}.studio-header{position:relative;margin-right:-320px}#studio-close-tray{display:none}.studio-tip{font-size:11px}}

#studio-controls .cover-toggle-item{width:100%;min-height:44px;margin:8px 0 14px;color:#9b2630}#studio-controls .cover-global-tools{padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid #ddd}#studio-controls .cover-global-tools strong{font-size:14px}#studio-controls .cover-global-tools p{margin:5px 0}#studio-controls .cover-global-tools .grid{margin-top:10px}

/* Voice workspaces are visible wherever a narrator is selected or reviewed. */
body[data-wizard="preview"] #book > #voice-manager,body[data-wizard="review"] #book > #voice-manager,body[data-wizard="review"] #book > .wizard-audio{display:block;}
#voice-manager select,#voice-new-label{width:100%;min-height:46px;}#voice-manager .row{align-items:end;}#voice-summary{font-size:13px;line-height:1.7;}#audio-imports>summary{min-height:46px;cursor:pointer;padding:10px 0;}@media(max-width:600px){#voice-manager .row{display:grid;grid-template-columns:1fr;}#voice-manager .btn{width:100%;}#voice-manager{padding:18px;}}

#voice-summary>div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--line);}#voice-summary>div>span:first-child{font-weight:600;}

.import-confirm { max-width: min(32rem, calc(100vw - 2rem)); border: 1px solid #b9c6d8; border-radius: 1rem; padding: 1.25rem; color: #1d2942; background: white; direction: rtl; }
.import-confirm::backdrop { background: rgba(15, 25, 40, .55); }
.import-confirm .row { justify-content: flex-end; gap: .75rem; }

/* Google Fonts picker (google-fonts.js) */
.gf-dialog{border:1px solid var(--line,#ccc);border-radius:12px;padding:0;max-width:min(560px,92vw);width:100%;max-height:86vh;overflow:auto}
.gf-dialog::backdrop{background:rgba(0,0,0,.35)}
.gf-dialog .gf-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line,#ddd)}
.gf-dialog .gf-filters{display:flex;flex-direction:column;gap:8px;padding:10px 12px}
.gf-dialog .gf-search{width:100%;box-sizing:border-box}
.gf-dialog label.gf-heb{flex-direction:row;align-items:center;gap:8px;font-weight:400;font-size:.95rem}
.gf-dialog .gf-heb input[type="checkbox"]{width:18px;min-width:18px;height:18px;min-height:18px;flex:none;margin:0;padding:0}
.gf-dialog .gf-count{margin:0;padding:0 12px}
.gf-list{list-style:none;margin:0;padding:6px 12px;max-height:50vh;overflow:auto}
.gf-item{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:8px;text-align:start;cursor:pointer;font-size:1rem;box-sizing:border-box}
.gf-item:hover,.gf-item:focus-visible{background:var(--tint,#f2f2f2);outline:none}
.gf-item .gf-name{font-weight:600}
.gf-item .gf-tags{font-size:.8rem;opacity:.7;white-space:nowrap}
.gf-empty{padding:14px;text-align:center}
.gf-dialog .gf-note{margin:0;padding:8px 12px;border-top:1px solid var(--line,#ddd)}

/* Recording is reachable without hunting for a hidden page-split lock. */
body[data-wizard="review"] #freeze{display:inline-flex;}
#family-transfer{display:none;}body[data-screen="book"][data-wizard="review"] #family-transfer{display:block;}

/* Real-file previews remain hidden until FontFace has loaded successfully. */
.gf-item:not(.gf-more){display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:start;padding:12px 10px}
.gf-item .gf-name{overflow-wrap:anywhere}.gf-item .gf-tags{white-space:normal;overflow-wrap:anywhere}
.gf-sample{font-size:26px;line-height:1.5;font-weight:400;overflow-wrap:anywhere}
.gf-preview-state{font-size:12px;color:var(--muted)}.gf-preview-state:empty{display:none}
.gf-head button{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}

/* Page shape (2026-11-15, Yohay): a book can be portrait 3:4 instead of the default square 1:1.
   Only the frames change below; text metrics are cqw of the leaf width, so they follow by themselves. */
body[data-page-shape="portrait34"] .spread { aspect-ratio:3/2; }
body[data-page-shape="portrait34"] .reader-page .page.leaf { aspect-ratio:3/4; width:min(100%, 46.5vh); }
body[data-page-shape="portrait34"] .board { aspect-ratio:3/4; width:min(100%, 390px); }
body[data-page-shape="portrait34"] .board.wide { aspect-ratio:3/2; width:100%; }
body[data-page-shape="portrait34"] .story-card img { aspect-ratio:3/2; }
body[data-page-shape="portrait34"] .art-item img { aspect-ratio:3/2; }
body[data-page-shape="portrait34"] .art-item.square img { aspect-ratio:3/4; }
body[data-page-shape="portrait34"] .lleaf { aspect-ratio:3/4; }
body[data-page-shape="portrait34"] .cover-canvas { aspect-ratio:3/4; }
body[data-page-shape="portrait34"] .cover-canvas #cover-preview { aspect-ratio:3/4; }

#take-page-box{border:1px solid #DDE3E0;border-radius:12px;padding:8px 10px;margin:10px 0;}
#take-page-box .take-page-nav{justify-content:space-between;align-items:center;gap:8px;}
#take-page-box .take-page-nav .btn{min-height:40px;}
#take-page-preview{max-height:150px;overflow-y:auto;font-size:15px;line-height:1.65;padding:6px 2px;white-space:pre-wrap;}

/* wizard-edit: one tidy control family - house icons, equal rhythm */
.wizard-edit .nav{display:flex;gap:8px;flex-wrap:wrap}
.wizard-edit .nav .btn{flex:1 1 110px}
.wizard-edit .nav #nav-select{flex:2 1 150px;min-height:44px;font:inherit}
.wizard-edit .modes .btn{flex:1 1 150px}
.wizard-edit>.row:has(#open-layout){display:flex}
#open-layout{flex:1 1 150px}
#pair-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#pair-row .btn{flex:1 1 160px}
#nav-next::before{transform:scaleX(-1)}


/* site-shell.css */
:root{--ink:#283b3d;--muted:#667575;--accent:#17686a;--line:#dce5e2;--bg:#f6f6f1;--card:#fff}html{font-family:RubikBook,Arial,sans-serif;background:var(--bg)}body{max-width:1200px;padding:0 24px 48px}.top{min-height:88px;gap:16px;border-bottom:1px solid var(--line);margin-bottom:16px}.top h1{display:flex;align-items:center;gap:10px;font-size:20px;letter-spacing:-.5px}.site-mark{display:grid;place-items:center;width:38px;height:42px;background:#17686a;color:white;border-radius:5px 12px 12px 5px;font-size:26px}.tag{font-size:10px;border:0;background:#e8eeeb;color:#58716f;padding:4px 8px}.actions>.btn{font-size:13px;min-height:44px;background:transparent;border:0}.site-file-menu{position:relative;z-index:40}.site-file-menu>summary{list-style:none;min-height:44px;display:flex;align-items:center;gap:18px;background:white;border:1px solid var(--line);border-radius:10px;padding:8px 14px;cursor:pointer;font-size:13px;font:inherit;font-size:13px;font-weight:600}.site-file-menu>summary>span{font-size:15px;line-height:1}.site-file-actions{position:absolute;top:52px;left:0;width:230px;padding:8px;background:white;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px #203a3d15;display:grid;gap:6px}.site-file-actions .btn{width:100%;justify-content:flex-start;background:white;border:0;color:var(--ink)}.site-file-actions .btn:hover{background:#eef5f1}.site-notice{font-size:12px;color:var(--muted);margin:0 0 22px}.site-notice>summary{cursor:pointer}.site-notice>summary span{font-size:10px}.site-notice .review-notice{border:0;background:#edf2ef;margin-top:10px;font-size:12px;padding:14px}.status:empty{display:none}#start{padding-top:16px}.site-eyebrow{text-transform:none;color:#17686a;font-size:12px;font-weight:600;margin:0 0 12px}#h-start{font-size:clamp(28px,4vw,42px);line-height:1.3;letter-spacing:-1px;max-width:650px;margin-bottom:14px}#h-start+.muted{max-width:640px;font-size:16px;line-height:1.8;margin:0 0 24px}.site-journey{display:flex;gap:28px;padding:18px 0 26px;font-size:13px;color:#526a68}.site-journey span{display:flex;align-items:center;gap:9px}.site-journey b{background:#e2ede7;color:#17686a;display:grid;place-items:center;border-radius:50%;width:28px;height:28px;font-weight:500}.site-gallery-title{font-size:18px;margin:30px 0 16px}.gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.story-card{display:flex;flex-direction:column;text-align:right;background:white;border:1px solid var(--line);border-radius:16px;overflow:hidden;padding:0;box-shadow:none;transition:transform .15s}.story-card:hover{transform:translateY(-3px);box-shadow:0 7px 22px #263c3a10}.story-card img{width:100%;height:auto;aspect-ratio:1.55;object-fit:cover;border-radius:0}.story-card .info{padding:18px;width:100%}.story-card .t{font-size:19px;color:var(--ink);font-weight:600;margin-bottom:7px}.story-card .ages{font-size:12px;color:#637774}.story-card .lic,.story-card .note{font-size:10px;line-height:1.5}.story-card .demo{background:#edf3ef;border:0;color:#506960}.site-resume{width:100%;border:1px solid #c9dcd4;background:#eaf3ed;border-radius:12px;display:flex;justify-content:space-between;align-items:center;padding:16px 20px;text-align:right;color:#254c46;font:inherit;cursor:pointer}.site-resume strong,.site-resume small{display:block}.site-resume small{margin-top:5px;font-size:12px}.start-more{margin:28px 0;padding:24px;background:#eef0e8;border:0;border-radius:16px}.start-more .guide-link{margin:0 0 14px;font-size:14px}.start-more .guide-link a{color:#17686a}.start-more h3{font-size:16px}.start-more .row{gap:12px}.start-more .btn{background:white;color:#335d57;border:1px solid #ced8d0}.start-more .small{max-width:720px;line-height:1.7}.card{border:1px solid var(--line);border-radius:16px;padding:24px;box-shadow:0 3px 12px #1f373a04}.card h2{font-size:21px;margin-bottom:15px}.card>.muted{font-size:13px;line-height:1.8}.btn{border-radius:10px;min-height:46px}.btn.secondary{background:#f1f5f2;border:1px solid #d4dfd9;color:#345b55}input,textarea,select{border-color:#b7c9c0;border-radius:9px}label{font-size:13px;gap:7px}.grid{gap:18px}#wizard{padding:0;margin:28px 0 24px;background:transparent;border:0}#wizard-step{font-weight:600;font-size:23px;margin:16px 0 8px}#wizard-help{font-size:13px;line-height:1.7;max-width:700px;margin-bottom:8px}#wizard>.small{font-size:10px;color:#7a8984}.site-progress{height:4px;border-radius:4px;overflow:hidden;background:#e2e9e3}.site-progress>span{height:100%;display:block;background:#277b71;border-radius:4px;transition:width .2s}#site-path{display:none}#wizard-actions{background:#fff;padding:14px 24px;border:1px solid var(--line);border-radius:14px;box-shadow:0 -4px 15px #203a3d06;gap:12px;margin:22px 0}#wizard-actions .btn{min-width:120px}#wizard-actions #wizard-next{margin-inline-start:auto}body[data-screen=start] #wizard-actions,body[data-screen=start] #wizard,body[data-screen=start] #site-path{display:none}#cover-design #cover-preview{border-radius:10px}#take-card .steps{font-size:13px;line-height:1.9}#take-card h2{font-size:23px}#export-card #checklist{font-size:13px;line-height:1.9}footer{margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}
@media(min-width:980px){body:not([data-screen=start]):not(.studio-open){padding-right:272px;position:relative}body:not([data-screen=start])>.top,body:not([data-screen=start])>.site-notice{margin-right:-248px}body:not([data-screen=start]) #site-path{display:block;position:absolute;top:178px;right:24px;width:218px;padding:20px 0}.site-path-title{font-size:11px;color:#779086}#site-book-name{font-size:18px;font-weight:600;margin:9px 0 18px;overflow-wrap:anywhere}#site-path ol{list-style:none;margin:0;padding:0;display:grid;gap:5px}#site-path button{border:0;background:transparent;width:100%;text-align:right;display:flex;gap:10px;align-items:center;padding:9px;border-radius:9px;font:inherit;font-size:12px;color:#6e7c77;cursor:pointer}#site-path button small{display:block;font-size:9px;margin-top:3px}.site-step-no{width:24px;height:24px;border:1px solid #d9e2dc;border-radius:50%;display:grid;place-items:center;font-size:11px}#site-path button[aria-current=step]{background:#e3eee6;color:#17686a;font-weight:600}#site-path button:disabled{opacity:.6;cursor:default}.site-path-note{font-size:10px;line-height:1.7;color:#7e8d85;border-top:1px solid var(--line);padding-top:16px;margin-top:20px}}
@media(max-width:700px){body{padding:0 16px 30px}.top{min-height:75px;gap:8px}.top h1{font-size:17px;gap:7px}.site-mark{width:28px;height:34px;font-size:22px}.top .tag{display:none}.top .actions{gap:2px}.actions>.btn{font-size:11px;padding:6px}.site-file-menu>summary{font-size:11px;padding:8px 10px;gap:6px}.site-notice{font-size:10px;margin-bottom:16px}.site-notice>summary span{display:none}#start{padding-top:12px}#h-start{font-size:30px}#h-start+.muted{font-size:14px;line-height:1.8}.site-journey{display:grid;gap:10px;padding:4px 0 18px;font-size:12px}.site-journey b{width:24px;height:24px}.gallery{grid-template-columns:1fr;gap:18px}.story-card{display:grid;grid-template-columns:125px 1fr;align-items:stretch;border-radius:14px}.story-card img{height:100%;aspect-ratio:auto;min-height:180px;object-fit:cover}.story-card .info{padding:14px}.story-card .t{font-size:17px}.story-card .note{font-size:10px}.site-gallery-title{font-size:16px;margin:24px 0 14px}.card{padding:18px;border-radius:14px}.card h2{font-size:20px}.start-more{padding:18px}.start-more .row{display:grid;grid-template-columns:1fr;gap:10px}.start-more .btn{width:100%}#wizard-step{font-size:21px}#wizard{margin:22px 0 16px}#wizard-actions{position:sticky;bottom:0;margin:18px -8px 0;padding:12px;border-radius:12px;z-index:30;background:#fffefb}#wizard-actions .btn{min-width:90px}.studio-open #wizard-actions{visibility:hidden}.site-resume{padding:14px;font-size:14px}.site-resume small{font-size:10px}}
@media(max-width:360px){.top h1{font-size:15px}.actions>.btn{max-width:50px;line-height:1.2}.story-card{grid-template-columns:105px 1fr}.story-card .info{padding:12px}.story-card .t{font-size:15px}}
.top .actions{display:flex;width:auto;align-items:center}.top .actions .site-file-actions label[for=open-file]{display:flex}.site-file-actions #save-draft,.site-file-actions #go-export{display:flex}#wizard-actions #wizard-back{flex:0 1 auto}#wizard-actions #wizard-next{flex:0 1 auto}@media(max-width:600px){.top{flex-wrap:nowrap}.top .actions{display:flex;width:auto}.top .actions>.btn{font-size:10px;max-width:52px;line-height:1.2}.story-card img{max-height:none}}
body[data-screen] .top .actions .site-file-actions label[for=open-file]{display:flex}body[data-screen=layout] .top .actions .site-file-actions #save-draft,body[data-screen=layout] .top .actions .site-file-actions #go-export{display:flex}body[data-screen=start] .site-file-actions #save-draft{display:flex}

/* File access is a direct action, not a one-item menu. */
body[data-screen=start] .top .actions label[for=open-file]{display:inline-flex}.top{flex-wrap:wrap}.top .actions{display:flex;flex-wrap:wrap;gap:6px}.top .actions label[for=open-file]{min-height:44px;align-items:center;background:white;border:1px solid #b7c9c0;border-radius:10px;padding:8px 12px}

.top .actions{flex-shrink:0}.top .actions label[for=open-file]{white-space:nowrap;min-width:96px;justify-content:center}

#start .start-more{margin:18px 0;padding:18px}#start .start-more>.row{display:grid;grid-template-columns:1fr;gap:10px}#start .start-more .btn{width:100%;min-height:52px;justify-content:center}#start .site-eyebrow{display:none}#start .site-journey[hidden],#existing-sources[hidden]{display:none}#start .site-resume{margin-top:14px}#h-start{font-size:28px}.start-more .small{font-size:12px}

#private-copies button{display:block;width:100%;margin-bottom:10px;text-align:right}

#private-copies button strong,#private-copies button small{display:block}#private-copies button strong{font-size:16px;line-height:1.5}#private-copies button small{font-size:11px;font-weight:400;color:#667575;margin-top:5px}#private-copies button bdi{unicode-bidi:isolate}

#start.ai-prompts-open>:not(#ai-prompt-workshop){display:none}#ai-prompt-workshop textarea{width:100%;box-sizing:border-box}#ai-prompt-workshop input[type=checkbox]{width:auto}#ai-prompt-workshop fieldset{border:1px solid #d4dfd9;border-radius:10px;padding:16px;margin:16px 0}#ai-prompt-workshop .btn{margin:10px 0}#ai-prompt-workshop label{margin-bottom:12px}

#ai-prompt-workshop input[type=checkbox]{width:20px!important;height:20px!important;min-height:20px;display:inline-block;vertical-align:middle;margin:0 6px 0 0}#ai-prompt-workshop textarea{font-size:16px;line-height:1.55}

/* Visible download, never hides behind the editing tools. */
.top .app-download{flex-basis:100%;width:fit-content;max-width:100%;text-align:center;text-decoration:none;box-sizing:border-box;}

/* Keep file opening in the header; avoid the duplicate home label. */
#start .start-more label[for=open-file]{display:none}

/* Give the copy action room to read on narrow phones. */

.series-badge{display:inline-block!important;width:fit-content;padding:3px 8px;border-radius:8px;background:#e8efe9;color:#315d50;font-weight:700;margin-bottom:4px}
.save-tip{font-size:12px;background:#edf2ef;color:#58716f;padding:10px 14px;margin:0 0 12px;border-radius:10px;text-align:center;line-height:1.7}

/* Recording-source feedback stays on the selected card, not only below the gallery. */
#existing-sources .story-card .note.recording-open-state:last-child{display:block!important;min-height:1.6em;font-weight:700;color:var(--accent);line-height:1.5;scroll-margin:16px}
.story-card[data-open-state="loading"]{opacity:1;outline:3px solid var(--primary,#315d50);outline-offset:2px;cursor:progress}
#existing-sources .story-card[data-open-state="loading"] .note.recording-open-state:last-child{display:flex!important;align-items:center;gap:.5rem}
.story-card[data-open-state="loading"] .recording-open-state::before{content:"";flex:none;width:1em;height:1em;border:2px solid currentColor;border-inline-end-color:transparent;border-radius:50%;animation:recording-download-spin .8s linear infinite}
@keyframes recording-download-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.story-card[data-open-state="loading"] .recording-open-state::before{animation:none}}

/* Header Options is compact; its picker remains keyboard and touch accessible. */
#editor-options{flex:none}
#editor-options>summary{min-height:44px;justify-content:space-between;border-color:var(--line);color:var(--ink)}
#editor-options .site-file-actions{inset-inline-start:0;inset-inline-end:auto;left:auto;max-width:calc(100vw - 40px);z-index:50}
#editor-options .site-file-actions button{min-height:48px;border:1px solid var(--line);border-radius:9px;text-align:start}
/* Keep sibling navigation buttons aligned when a Hebrew label wraps. */
#wizard-actions{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
#wizard-actions .btn{align-self:stretch;width:100%;min-width:0;white-space:normal;text-align:center;line-height:1.4;height:auto}
#wizard-actions #wizard-next{margin-inline-start:0}

/* Closed absolute menus must not contribute offscreen RTL scrollable overflow. */
#editor-options:not([open])>.site-file-actions{display:none}
#editor-options>.site-file-actions{inset-inline-start:auto;inset-inline-end:0;left:0;right:auto}


/* unified-editor.css */
/* Moshe v2 direction, implemented over existing draft/editor nodes. */
:root{--accent:#0F766E;--accent-dark:#0B5E57;--ink:#1F2A2E;--muted:#54666B;--line:#DDE3E0}
button,.btn{border-radius:12px;min-height:44px;font-weight:600} .btn:not(.secondary):not(.danger){background:#0F766E;color:white}.btn.secondary{background:white;color:#0B5E57;border-color:#0F766E}.btn.danger{color:#B91C1C;background:white;border-color:#E5A49F}button:disabled,.btn:disabled{background:#ECEEED!important;color:#66736F!important;opacity:1}
#book-studio{display:grid;grid-template-columns:minmax(0,1fr) 52px;grid-template-rows:52px minmax(0,1fr) 64px;padding:0;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);direction:ltr;background:#E7EDEA;color:#1F2A2E}
#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 126px 52px}
#book-studio .studio-header{grid-column:1/-1;grid-row:1;min-height:52px;height:52px;padding:4px 8px;margin:0;direction:rtl;gap:6px;border-color:#DDE3E0}
#book-studio .studio-header h2{font-size:14px;max-width:38vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#book-studio .studio-header span{display:none}
#book-studio .studio-header button{min-width:36px;min-height:36px;height:36px;border:1px solid #DDE3E0;background:white;color:#0B5E57;border-radius:10px;font-size:18px;padding:4px 8px}#book-studio .studio-header #studio-done{background:#0F766E;color:white;font-size:14px}
#book-studio .studio-workspace{grid-column:1;grid-row:2;min-width:0;min-height:0;padding:8px;position:relative;direction:rtl;overflow:hidden;display:flex;flex-direction:column}
#studio-stage{height:100%;width:100%;min-height:0;min-width:0;display:flex;justify-content:center;align-items:center;overflow:hidden}
#book-studio .cover-canvas{width:100%;max-width:none;max-height:100%;aspect-ratio:1;margin:0;box-shadow:0 3px 15px #18382c18;flex-shrink:1}
#book-studio .cover-canvas img{max-height:100%;object-fit:contain;width:100%}
#book-studio #lay-stage{width:100%;max-width:none;max-height:100%;margin:auto}#book-studio .lspread{width:100%;max-height:none;gap:2px;margin:0}
#book-studio #studio-tray{grid-column:2;grid-row:2;position:static;bottom:auto;top:auto;left:auto;right:auto;max-height:none;width:126px;min-width:0;border:0;border-inline-start:1px solid #DDE3E0;border-radius:0;padding:6px;box-shadow:none;overflow-y:auto;overflow-x:hidden;background:#FBFCFB;direction:rtl}
#book-studio #studio-tray[hidden]{display:none!important}
#book-studio .studio-tray-head{position:static;padding:0 0 6px;gap:3px;background:#FBFCFB;font-size:12px}#book-studio #studio-close-tray{display:block;width:32px;height:36px;min-width:32px;min-height:36px;font-size:20px;border-radius:8px}
#book-studio #studio-controls .grid,#book-studio #studio-controls .row{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:6px 0}#book-studio #studio-controls label{font-size:11px;line-height:1.5;display:block;min-width:0}#book-studio #studio-controls input:not([type=checkbox]),#book-studio #studio-controls select,#book-studio #studio-controls textarea{width:100%;max-width:100%;min-width:0;min-height:36px;font-size:12px;padding:4px}
#book-studio #studio-controls input[type=color]{height:36px}#book-studio #studio-controls input[type=range]{padding:0}#book-studio #studio-controls button{font-size:11px;padding:5px;min-height:36px;width:100%;height:auto;white-space:normal;line-height:1.5;border-radius:10px}
#book-studio #studio-controls h3,#book-studio #studio-controls strong{font-size:12px;margin:6px 0}#book-studio #studio-controls .small,#book-studio #studio-controls .muted{font-size:10px;line-height:1.5}
#book-studio #studio-footer{grid-column:1/-1;grid-row:3;height:64px;min-height:0;padding:6px 8px;background:white;direction:rtl;overflow-x:auto;overflow-y:hidden;border-color:#DDE3E0;display:flex;align-items:center;gap:8px}#book-studio #studio-footer .studio-picks{display:flex;gap:4px;flex:1}#book-studio #studio-footer .studio-picks button{min-height:40px;padding:4px 8px;width:auto;flex:1;font-size:11px}#book-studio #studio-footer .studio-common{display:none}#book-studio #studio-footer .studio-spread-nav{width:100%;margin:0}#book-studio #studio-footer button{min-height:40px}#book-studio .studio-tip,#book-studio #studio-properties{display:none}
#studio-rail{grid-column:-2;grid-row:2;display:flex;flex-direction:column;gap:4px;padding:6px 2px;background:white;border-left:1px solid #DDE3E0;direction:rtl;z-index:2;overflow-y:auto}#studio-rail button{border:0;background:white;color:#54666B;border-radius:8px;min-height:48px;width:48px;padding:4px 0;font-size:11px;display:flex;flex-direction:column;align-items:center;gap:1px}#studio-rail button span{font-size:19px;line-height:21px}#studio-rail button[aria-pressed=true]{background:#0F766E;color:white}#studio-rail button[data-tool=remove]{color:#B91C1C}
#book-studio .studio-panel-group[hidden]{display:none!important}#studio-error:empty{display:none}#studio-error{position:absolute;bottom:2px;left:6px;right:6px;background:#fff5ef;font-size:10px;max-height:42px;border-radius:5px;z-index:3}
#book-studio .cover-hit.image-locked{pointer-events:none!important;outline:0!important}#book-studio .lart.image-locked{pointer-events:none!important;outline:0!important}#book-studio .lart.image-locked .lhandle{display:none}
@media(min-width:800px){#book-studio{grid-template-columns:minmax(0,1fr) 60px}#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 210px 60px}#book-studio #studio-tray{width:210px;padding:12px}#studio-rail{padding:8px 5px}#book-studio .studio-workspace{padding:16px}#book-studio .cover-canvas{max-width:min(100%,calc(100dvh - 150px))}#book-studio .lspread{max-width:calc((100dvh - 150px)*2);margin:auto}#book-studio #studio-controls label{font-size:13px}#book-studio #studio-controls button{font-size:12px}}
@media(max-width:359px){#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 108px 48px}#book-studio #studio-tray{width:108px;padding:4px}#studio-rail{padding:4px 0}#studio-rail button{width:46px}#book-studio .studio-workspace{padding:4px}}
#book-studio [hidden]{display:none!important}
#book-studio .studio-cover-controller>p:not(.cover-selected){display:none}
#book-studio .studio-cover-controller>.row:has(.cover-undo){display:none}
#book-studio .cover-selected{font-size:11px;margin:0 0 6px}
#book-studio:not([data-tool=text]) .cover-global-tools,#book-studio:not([data-tool=text]) .cover-text-label,#book-studio:not([data-tool=text]) .cover-text-tools{display:none!important}
#book-studio:not([data-tool=image]) .cover-image-lock{display:none!important}
#book-studio:not([data-tool=remove]) .cover-toggle-item{display:none!important}
#book-studio:not([data-tool=image]):not([data-tool=text]) [data-cover-transform]{display:none!important}
#book-studio .studio-common{flex-direction:column;gap:6px}
#book-studio #studio-controls input:not([type=checkbox]),#book-studio #studio-controls select,#book-studio #studio-controls button{min-height:44px}
#book-studio #studio-controls label{font-size:12px}
#book-studio #studio-controls details{font-size:12px}
#book-studio #studio-part{min-height:44px;flex-shrink:0;max-width:42%;font-size:12px;padding:4px}
#book-studio #studio-controls .lleafbtns{display:flex;flex-direction:column}
#book-studio #studio-controls .lay-tpl{display:flex;flex-direction:column;gap:8px}
#book-studio #studio-controls #cover-settings>summary{display:none}
#book-studio #studio-controls #cover-settings>.grid>label:not(:has(#cover-imageX)):not(:has(#cover-imageY)):not(:has(#cover-imageSize)):not(:has(#cover-titleX)):not(:has(#cover-titleY)):not(:has(#cover-subtitleY)):not(:has(#cover-bylineY)){display:none}
#book-studio:not([data-tool=background]) .cover-background-tools{display:none!important}
#book-studio[data-tool=background] [data-cover-transform]{display:none!important}
#book-studio .cover-direct-tools .row:has(.cover-undo),#book-studio .cover-direct-tools .row:has(.cover-redo){display:none!important}
#studio-view-tools{margin-top:auto;display:flex;flex-direction:column;gap:4px;padding-top:14px}
#studio-view-tools button{font-size:10px;line-height:1.25;min-height:44px}
#book-studio[data-focus=selection] #studio-stage,#book-studio[data-focus=page] #studio-stage,#book-studio[data-focus=text] #studio-stage{display:block;overflow:auto;direction:ltr;overscroll-behavior:contain;scrollbar-width:thin}
#book-studio[data-focus=selection] #lay-stage,#book-studio[data-focus=page] #lay-stage,#book-studio[data-focus=text] #lay-stage{width:var(--studio-zoomwidth);max-width:none;max-height:none;margin:0}
#book-studio[data-focus=selection] .lspread,#book-studio[data-focus=page] .lspread,#book-studio[data-focus=text] .lspread{width:var(--studio-zoomwidth);max-width:none;max-height:none;display:block;margin:0}
#book-studio[data-focus=selection] .studio-focus-other,#book-studio[data-focus=page] .studio-focus-other,#book-studio[data-focus=text] .studio-focus-other{display:none}
#book-studio[data-focus=selection] .studio-focus-target,#book-studio[data-focus=page] .studio-focus-target,#book-studio[data-focus=text] .studio-focus-target{width:100%;max-width:none;aspect-ratio:1;display:block}
#book-studio.studio-pan #studio-stage{touch-action:pan-x pan-y}
#book-studio.studio-pan #studio-stage *{pointer-events:none;touch-action:pan-x pan-y}
body[data-wizard=images] #book>#bulk-images-card{display:block}
body[data-wizard=images] #book>#images-card{display:block}
#bulk-images-card,#editor-subnav,#layout-choices,#unified-entry{display:none}
body[data-wizard=details] #editor-subnav,body[data-wizard=cover] #editor-subnav,body[data-wizard=dedication] #editor-subnav,body[data-wizard=ending] #editor-subnav,body[data-wizard=backcover] #editor-subnav{display:block;margin-bottom:12px}
body[data-wizard=arrange] #layout-choices{display:block}
body[data-wizard=arrange] #unified-entry,body[data-wizard=arrange] #open-spread-studio,body[data-wizard=arrange] #lay-style-tools,body[data-wizard=arrange] #lay-background-tools,body[data-wizard=arrange] #lay-block-tools,body[data-wizard=arrange] #lay-tools{display:none!important}
body[data-wizard=layout] #unified-entry{display:block}
.bulk-image-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.bulk-image-card{min-width:0;border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px}.bulk-image-card img{height:140px;width:100%;object-fit:contain}.bulk-image-card p{overflow-wrap:anywhere}.bulk-image-card select{max-width:100%}
#layout-choices{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}body[data-wizard=arrange] #layout-choices{display:grid}#layout-choices h2{grid-column:1/-1}.layout-choice{min-height:0!important}@media(max-width:430px){body[data-wizard=arrange] #layout-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}
#unified-entry .row{flex-wrap:wrap}#unified-entry .row button{flex:1 1 140px}
body[data-wizard=layout] #layout>.lay-head,body[data-wizard=layout] #layout>.lay-tpl{display:none}
#book-studio .studio-workspace::after{content:'';pointer-events:none}
#book-studio[data-focus=text] .studio-workspace::after{content:'מבט מוגדל · הזזת מבט לגלילה';position:absolute;bottom:5px;left:5px;right:5px;padding:5px;background:#ffffffea;font-size:10px;text-align:center;color:#40554e;border-radius:6px}
body[data-wizard=edit] #images-card{display:none!important}
body[data-wizard=edit] .wizard-edit>.nav,body[data-wizard=edit] .wizard-edit>#stage,body[data-wizard=edit] .wizard-edit>.row:has(#open-layout),body[data-wizard=edit] .wizard-edit>.modes,body[data-wizard=edit] .wizard-edit>#editor,body[data-wizard=edit] .wizard-edit>#pair-row{display:none}
body[data-wizard=images] #images-card{display:none!important}
#wizard-actions{position:static!important;bottom:auto!important}
body[data-wizard=arrange] #layout>#lay-stage,body[data-wizard=arrange] #layout>.lay-nav,body[data-wizard=arrange] #layout>#layout-more,body[data-wizard=arrange] #layout>#lay-full-preview,body[data-wizard=arrange] #layout>#lay-close-preview{display:none!important}
@media(max-width:799px){#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 104px 48px}#book-studio #studio-tray{width:104px;padding:4px}#studio-rail button{width:44px}#book-studio .studio-workspace{padding:4px}#book-studio #studio-controls .card{border:0;padding:0;border-radius:0}#book-studio #studio-controls .small{display:none}#book-studio #studio-controls #lay-lock{font-size:10px}#book-studio #studio-controls label{font-size:11px}}
@media(max-width:359px){#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 92px 44px}#book-studio #studio-tray{width:92px}#studio-rail button{width:40px}}
@media(max-width:799px){#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 80px 40px}#book-studio #studio-tray{width:80px;padding:3px}#studio-rail{padding:4px 0}#studio-rail button{width:38px;font-size:10px}#book-studio #studio-controls label{font-size:10px}#book-studio #studio-controls select{font-size:10px;padding:2px}#book-studio #studio-controls h3{font-size:10px}#book-studio #studio-close-tray{width:24px;min-width:24px}#book-studio .studio-tray-head{font-size:11px}#book-studio #studio-controls button{font-size:10px}#book-studio #studio-controls .cover-selected{font-size:10px}}
#studio-view-tools{padding-top:5px;gap:1px}#studio-view-tools button{min-height:36px;font-size:10px}
#book-studio #studio-controls #lay-tools.locked{display:none!important}
#book-studio #studio-controls .cover-global-tools>strong{font-size:11px}
#book-studio #studio-stage>img{display:block;width:100%;height:auto;max-height:100%;object-fit:contain}
#book-studio #studio-stage>#back-preview{aspect-ratio:1}
#book-studio #studio-controls .studio-panel-group>p{font-size:11px;line-height:1.5;overflow-wrap:anywhere}
#book-studio.matter-focus #studio-stage{display:block;overflow:auto;direction:ltr;max-height:100%}
#book-studio.matter-focus #studio-stage>img{width:calc(var(--studio-zoomwidth)*2);min-width:calc(var(--studio-zoomwidth)*2);max-width:none;height:var(--studio-zoomwidth);max-height:none;object-fit:fill;transform:translateX(var(--studio-matter-offset));margin-right:calc(var(--studio-zoomwidth)*-1)}
#book-studio[data-mode=backcover].matter-focus #studio-stage>img{width:var(--studio-zoomwidth);min-width:var(--studio-zoomwidth);transform:none;margin-right:0}

#book-studio #studio-stage>img[hidden]{display:none!important}

#book-studio.studio-pan #studio-stage{touch-action:none;cursor:grab}#book-studio.studio-pan #studio-stage *{touch-action:none}

.layout-choice{display:grid;justify-items:center;align-content:start;gap:4px;padding:10px;line-height:1.5;white-space:normal;font-size:14px;text-align:center}
.layout-mini{display:block;position:relative;width:120px;height:60px;background:#fff;border:1px solid #c3d0ca;border-radius:3px;overflow:hidden}
.layout-mini::after{content:'';position:absolute;left:50%;top:0;bottom:0;border-left:1px solid #7e93884d}
.layout-mini i{position:absolute;display:block}.mini-art{background:#9dc6b8;border-radius:3px}.mini-art::after{content:'';position:absolute;left:20%;bottom:0;width:70%;height:75%;background:#609880;clip-path:polygon(0 100%,40% 20%,65% 55%,80% 40%,100% 100%)}.mini-text{background:repeating-linear-gradient(to bottom,#4b5a53 0 2px,transparent 2px 6px);height:14px}.layout-mini .second{display:none}
.layout-mini-full .mini-art{inset:3px}.layout-mini-full .mini-text{bottom:7px;right:7px;width:40px;background-color:#ffffffb8}
.layout-mini-facing .mini-art{left:4px;top:4px;bottom:4px;width:50px}.layout-mini-facing .mini-text{right:7px;top:22px;width:44px}
.layout-mini-above .mini-art{left:4px;right:4px;bottom:4px;top:23px}.layout-mini-above .mini-text{left:8px;right:8px;top:5px}
.layout-mini-below .mini-art{left:4px;right:4px;top:4px;bottom:23px}.layout-mini-below .mini-text{left:8px;right:8px;bottom:5px}
.layout-mini-both .mini-art{left:4px;right:4px;top:20px;bottom:20px}.layout-mini-both .mini-text{left:8px;right:8px;top:4px}.layout-mini-both .second{display:block;top:auto;bottom:4px}

/* Phone working surface: one readable side dock, not two narrow columns. */
#studio-view-tools{margin-top:0;flex-direction:row;flex-wrap:wrap;padding:4px 0;gap:3px;justify-content:center;flex-shrink:0;direction:rtl}#studio-view-tools button{min-height:36px;padding:4px 6px;font-size:11px;border:1px solid #c9d6d0;border-radius:7px;color:#40554e;background:white;flex:1 0 auto}#studio-view-tools button[aria-pressed=true]{color:white;background:#0F766E}#studio-stage{flex:1;min-height:0}
@media(max-width:799px){
 #book-studio.tray-open{grid-template-columns:minmax(0,1fr) 112px}
 #book-studio.tray-open #studio-rail{grid-column:2;grid-row:2;align-self:start;display:grid;grid-template-columns:1fr 1fr;width:112px;height:164px;gap:2px;padding:4px;background:white;border-bottom:1px solid #DDE3E0}
 #book-studio.tray-open #studio-rail>button{width:100%;min-height:48px;height:48px;padding:3px;font-size:11px}
 #book-studio.tray-open #studio-rail>button[data-tool=remove]{grid-column:1/-1;min-height:44px;height:44px;flex-direction:row;justify-content:center}
 #book-studio.tray-open #studio-tray{grid-column:2;width:112px;padding:170px 6px 6px}
 #book-studio #studio-controls label{font-size:12px;line-height:1.5}
 #book-studio #studio-controls input:not([type=checkbox]),#book-studio #studio-controls select,#book-studio #studio-controls textarea{font-size:12px;padding:4px}
 #book-studio #studio-controls button,#book-studio #studio-controls h3,#book-studio #studio-controls strong{font-size:12px}
 #book-studio #studio-tray .studio-tray-head{font-size:12px;position:sticky;top:0;background:#FBFCFB}
 #book-studio[data-mode=spread] #studio-view-tools [data-view=right],#book-studio[data-mode=spread] #studio-view-tools [data-view=left]{display:none}
 #studio-view-tools button{flex:1 1 38%;min-height:36px;font-size:11px}
}
@media(max-width:799px){#book-studio.tray-open #studio-rail{z-index:20}#book-studio.tray-open #studio-tray{z-index:1}}

#book-studio .studio-workspace::after{display:none!important}
#studio-view-tools{width:100%}
#book-studio[data-mode=cover][data-focus=text] #studio-stage,#book-studio[data-mode=cover][data-focus=selection] #studio-stage,#book-studio[data-mode=cover][data-focus=page] #studio-stage{display:block;overflow:auto;direction:ltr}
#book-studio[data-mode=cover][data-focus=text] .cover-canvas,#book-studio[data-mode=cover][data-focus=selection] .cover-canvas,#book-studio[data-mode=cover][data-focus=page] .cover-canvas{width:var(--studio-zoomwidth);height:var(--studio-zoomwidth);min-width:var(--studio-zoomwidth);max-width:none;max-height:none;margin:0}

#book-studio[data-mode=cover][data-focus=overview] .cover-canvas{width:var(--studio-zoomwidth);height:var(--studio-zoomwidth);min-width:var(--studio-zoomwidth);max-width:none;max-height:none;flex-shrink:0}

#studio-view-state{display:block;flex:1 0 100%;font-size:11px;line-height:18px;color:#54666B;text-align:center}#studio-view-state:empty{display:none}

#book-studio[data-focus=selection] #lay-stage,#book-studio[data-focus=page] #lay-stage,#book-studio[data-focus=text] #lay-stage{margin-top:var(--studio-viewtop,0px)}
#book-studio[data-mode=cover][data-focus=selection] .cover-canvas,#book-studio[data-mode=cover][data-focus=page] .cover-canvas,#book-studio[data-mode=cover][data-focus=text] .cover-canvas{margin-top:var(--studio-viewtop,0px)}

#studio-fit-keyboard{display:none}
@media(max-width:799px){
 #book-studio.studio-keyboard{grid-template-rows:44px 44px minmax(0,1fr) 44px}
 #book-studio.studio-keyboard .studio-header{height:44px;min-height:44px}
 #book-studio.studio-keyboard .studio-header h2{font-size:12px;max-width:70px}
 #book-studio.studio-keyboard #studio-fit-keyboard{display:block;font-size:11px}
 #book-studio.studio-keyboard #studio-rail,#book-studio.studio-keyboard.tray-open #studio-rail{grid-column:1/-1;grid-row:2;display:flex;flex-direction:row;width:100%;height:44px;align-self:stretch;padding:0 4px;gap:3px;overflow:hidden}
 #book-studio.studio-keyboard #studio-rail>button,#book-studio.studio-keyboard.tray-open #studio-rail>button{flex:1;min-width:44px;width:auto;height:44px;min-height:44px;flex-direction:row;justify-content:center;font-size:10px;gap:3px;padding:2px}
 #book-studio.studio-keyboard .studio-workspace{grid-row:3}
 #book-studio.studio-keyboard #studio-tray,#book-studio.studio-keyboard.tray-open #studio-tray{grid-row:3;padding:4px 6px}
 #book-studio.studio-keyboard #studio-footer{grid-row:4;height:44px;padding:2px 6px}
 #book-studio.studio-keyboard #studio-footer .studio-picks{flex-wrap:nowrap}
 #book-studio.studio-keyboard #studio-footer .studio-picks button{min-width:64px;flex:0 0 auto;font-size:11px}
 #book-studio.studio-keyboard #studio-view-tools{display:none!important}
}
#book-studio #studio-story-editor{border-bottom:1px solid #DDE3E0;padding-bottom:10px;margin-bottom:10px}#book-studio #studio-story-editor .studio-story-note{font-size:11px;line-height:1.5;color:#54666B;margin:6px 0}#book-studio #studio-story-save{background:#0F766E;color:white;border:0}#book-studio #studio-story-editor textarea{min-height:94px;resize:vertical}
/* Small-screen side dock: readable fields with a shorter tool header. */
@media(max-width:799px){
 #book-studio.tray-open{grid-template-columns:minmax(0,1fr) 128px}
 #book-studio.tray-open #studio-rail{width:128px;height:108px;grid-template-columns:repeat(3,minmax(0,1fr));padding:3px;gap:2px}
 #book-studio.tray-open #studio-rail>button{min-width:0;min-height:48px;height:48px;padding:2px;font-size:10px}
 #book-studio.tray-open #studio-rail>button[data-tool=remove]{grid-column:2/-1;min-height:48px;height:48px}
 #book-studio.tray-open #studio-tray{width:128px;padding:114px 6px 6px}
 #book-studio.studio-keyboard.tray-open #studio-rail{width:100%;height:44px;display:flex;padding:0 4px}
 #book-studio.studio-keyboard.tray-open #studio-tray{padding:4px 6px}
}
/* The tool grid owns its space; scrolled properties never run underneath it. */
@media(max-width:799px){
 #book-studio.tray-open #studio-tray{margin-top:108px;padding:6px;min-height:0}
 #book-studio.studio-keyboard.tray-open #studio-tray{margin-top:0;padding:4px 6px}
 #book-studio #studio-tray .studio-tray-head{position:static}
}

@media(max-width:799px){
 #book-studio.tray-open{grid-template-columns:minmax(0,1fr) 144px}
 #book-studio.tray-open #studio-rail{width:144px}
 #book-studio.tray-open #studio-rail>button{min-width:44px;font-size:12px}
 #book-studio.tray-open #studio-tray{width:144px}
 #book-studio.studio-keyboard.tray-open #studio-rail{width:100%;font-size:10px}
}

/* Ordered book navigation stays outside the editing canvas. */
#studio-book-nav{display:flex;align-items:center;gap:5px;min-width:100%;direction:rtl}#studio-book-nav select{width:150px;flex:0 0 150px;font-size:12px;min-height:40px}#studio-book-nav button{white-space:nowrap;font-size:12px;padding:5px 10px}#studio-original-cover,#studio-stage [data-flow-preview]{max-width:100%;max-height:100%;object-fit:contain}#book-studio #studio-save{display:block;font-size:10px;white-space:normal;max-width:40vw}#studio-footer>.studio-picks{display:none!important}
@media(max-width:799px){#book-studio .studio-header h2{font-size:12px}#book-studio .studio-header{height:58px;min-height:58px}#book-studio{grid-template-rows:58px minmax(0,1fr) 64px}}

#studio-book-nav{display:grid;grid-template-columns:1fr auto auto;gap:4px;min-width:100%;width:100%}#studio-book-nav select:first-child{width:100%;min-width:0;grid-column:1}#studio-book-nav select[aria-label="הוספת עמוד לספר"]{grid-column:1;width:100%;min-width:0}#studio-book-nav button:last-child{grid-column:2/4;white-space:normal;font-size:11px}#book-studio #studio-footer{height:100%;overflow:hidden}#book-studio{grid-template-rows:58px minmax(0,1fr) 96px}#studio-book-nav button,#studio-book-nav select{min-height:36px;height:36px}#book-studio[data-mode=backcover] #studio-stage img{max-height:100%;width:auto;max-width:100%;object-fit:contain}#book-studio[data-mode=backcover] #studio-stage{align-items:center}
@media(orientation:landscape){#studio-book-nav{display:flex;width:100%;min-width:0}#studio-book-nav select{flex:1 1 130px;min-width:80px;width:130px}#book-studio{grid-template-rows:52px minmax(0,1fr) 54px}#studio-book-nav button{flex:0 0 auto}#book-studio .studio-header{height:52px;min-height:52px}}
/* Voice cards stay readable without squeezing Hebrew labels into narrow columns. */
#voice-summary .voice-management-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 0;border-top:1px solid var(--line);grid-template-columns:none}
#voice-summary .voice-management-row>strong,#voice-summary .voice-management-row>span{flex:1 1 100%;width:100%;text-align:right}
#voice-summary .voice-management-row>button{flex:1 1 120px;min-height:44px;white-space:normal}

/* Compact grouped book picker and optional secondary explanations. */
#existing-sources{max-width:860px;margin:14px auto;padding:12px;background:#fff;border:1px solid #dde3e0;border-radius:14px}
#existing-sources .gallery{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:8px;margin:8px 0}
#existing-sources .story-card{display:flex!important;flex-direction:row!important;align-items:center;text-align:right;gap:10px;padding:8px;min-height:76px;width:100%;border-radius:10px}
#existing-sources .story-card img{width:68px!important;height:68px!important;max-width:68px!important;object-fit:contain;flex-shrink:0;margin:0!important}
#existing-sources .story-card .info{padding:0!important;display:block;min-width:0}
#existing-sources .story-card .t{font-size:14px;line-height:1.4}
#existing-sources .story-card .note,#existing-sources .story-card .lic,#existing-sources .story-card .ages{font-size:11px;line-height:1.4}
#existing-sources .story-card .lic,#existing-sources .story-card .note:last-child{display:none}
#existing-sources h2,#existing-sources h3{font-size:15px;margin:10px 0 6px}
#existing-sources #editor-ready-sources{padding:0;border:0;box-shadow:none;margin:10px 0}
#existing-sources #editor-ready-sources>p:not([role=status]){font-size:11px;margin:2px 0}
#existing-sources>.gallery>a{min-height:48px;font-size:14px;text-align:right}
#private-copies{padding:0;border:0;box-shadow:none}#private-copies>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px}#private-copies button{min-height:48px;text-align:right}#private-copies small{display:block;font-size:10px}
.editor-help{font-size:12px;margin:8px 0}.editor-help summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.editor-help p{font-size:12px!important}
#auto-pagination{background:#f5f8f6;border:1px solid #d9e4df;border-radius:12px;padding:10px;margin:10px 0}#auto-pagination summary{min-height:44px;cursor:pointer;font-weight:600}#auto-pagination select,#auto-pagination input{min-height:44px;max-width:100%}#auto-pagination label{display:block;margin:6px 0}.pagination-preview{max-height:280px;overflow:auto;padding-right:26px}.pagination-preview li{padding:8px;border-bottom:1px solid #dde3e0}.pagination-preview li div{white-space:pre-wrap;font-size:14px;line-height:1.6}.playback-voice-choice{display:flex;align-items:center;gap:8px}.playback-voice-choice select{min-height:44px}
@media(max-width:500px){#existing-sources .gallery{grid-template-columns:1fr}#existing-sources{padding:8px}}
#existing-sources .story-card{min-height:86px!important;max-height:none!important}
#existing-sources .story-card img{height:68px!important;min-height:68px!important;max-height:68px!important;aspect-ratio:auto!important;background:transparent}
#existing-sources .story-card .info{display:flex!important;flex-direction:column!important;gap:2px;flex:1;width:auto!important}
#existing-sources .story-card .t,#existing-sources .story-card .ages,#existing-sources .story-card .note{display:block!important;margin:0!important}
#existing-sources .story-card .note:last-child{display:none!important}
body[data-start-choice=existing] #h-start,body[data-start-choice=existing] #h-start+.muted,body[data-start-choice=existing] .site-eyebrow{display:none}
#voice-manager #voice-remove{font-size:12px;min-height:44px}
.layout-mini-span-right .mini-art,.layout-mini-span-left .mini-art{inset:0;width:100%;height:100%;background:#b9cdc3}
.layout-mini-span-right .mini-text{left:auto;right:4%;top:8%;width:40%;height:30%}.layout-mini-span-left .mini-text{right:auto;left:4%;top:8%;width:40%;height:30%}

.assignment-page{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #dde6e2}.assignment-page img{width:70px;height:70px;object-fit:contain}.assignment-page p{font-size:14px;margin:3px 0}.assignment-page>span{min-width:70px}.assignment-overview{margin-top:14px}

.page-prompt-panel{padding-top:12px;border-top:1px solid #d4e0dc}.page-prompt-panel textarea,.page-prompt-panel input{width:100%;max-width:100%;box-sizing:border-box}.page-prompt-panel label{display:block;margin:7px 0}.page-prompt-panel h3{font-size:16px}

#ai-prompt-workshop .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#ai-prompt-workshop label{margin:0;font-size:14px}#ai-prompt-workshop input,#ai-prompt-workshop select{min-width:0;width:100%;padding:8px;margin:4px 0 0}#ai-prompt-workshop input[type=checkbox]{width:auto}#ai-prompt-workshop .ap-actor{padding:2px 0 8px;margin:0;border-radius:0;background:transparent;border:0;border-top:1px solid #e7dfd2}#ai-prompt-workshop #ap-actor-list .ap-actor:first-child{border-top:0}#ai-prompt-workshop .ap-actor .ap-actions{display:flex;gap:8px;align-items:center}#ai-prompt-workshop .ap-actor .ap-actions .btn{margin:6px 0 2px;width:auto;min-height:40px;padding:6px 18px}#ai-prompt-workshop .ap-del{margin:6px 0 2px;width:40px;min-width:40px;min-height:40px;padding:0;border:1px solid #d9cfc0;background:#fff;border-radius:10px;font-size:16px;color:#7a4a3a}#ai-prompt-workshop #ap-add-actor{width:auto;min-height:38px;padding:4px 14px;font-size:13px}#ai-prompt-workshop .interview-part{margin:8px 0;padding:4px 0}#ai-prompt-workshop summary{font-weight:700;padding:8px 0;cursor:pointer}#ai-prompt-workshop textarea{margin:4px 0 10px}#ai-prompt-workshop .btn{margin:8px 0}@media(min-width:800px){#ai-prompt-workshop .grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Keep detailed inline tools out of the main editing route, without removing them. */
#inline-layout-tools{display:none;margin:16px 0;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--card)}
body[data-wizard=layout] #inline-layout-tools{display:none}
#inline-layout-tools>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:500}
#unified-entry>#open-spread-studio{display:block;width:100%;margin:12px 0 16px;min-height:48px;font-size:14px}

/* Fit the whole page into the available work area, including short landscape phones. */
#book-studio[data-mode=spread][data-focus=overview] #lay-stage,#book-studio[data-mode=spread][data-focus=overview] .lspread{width:var(--studio-fitspread,100%);max-width:100%;max-height:none;margin:auto}
#book-studio #studio-story-editor>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600}
#book-studio #studio-story-editor:not([open])>*:not(summary){display:none}
#book-studio #studio-controls #lay-tools.locked{display:block!important}
@media(orientation:landscape) and (max-height:500px){
 #book-studio{grid-template-rows:40px minmax(0,1fr) 48px}
 #book-studio .studio-header{height:40px;min-height:40px;padding:2px 8px}
 #book-studio .studio-header span{display:none}
 #book-studio #studio-footer{height:48px;padding:2px 6px}
 #book-studio .studio-workspace{padding:4px}
 #studio-view-tools{padding:2px;gap:2px}#studio-view-tools button{min-height:28px;font-size:10px}
}
#studio-error{pointer-events:none}
@media(orientation:landscape) and (max-width:799px) and (max-height:500px){
 #book-studio.tray-open{grid-template-columns:minmax(0,1fr) 168px 44px}
 #book-studio.tray-open #studio-rail{grid-column:3;grid-row:2;display:flex;flex-direction:column;width:44px;height:100%;padding:0;overflow-y:auto;border:0}
 #book-studio.tray-open #studio-rail>button{min-height:44px;height:44px;width:44px;flex-shrink:0;font-size:10px}
 #book-studio.tray-open #studio-rail>button[data-tool=remove]{flex-direction:column}
 #book-studio.tray-open #studio-tray{grid-column:2;width:168px;padding:6px}
}

#book-studio .ltext p{min-width:0;max-width:100%;overflow-wrap:break-word}

/* Six page tools fit the existing two-row mobile rail without covering controls. */
@media(max-width:799px){#book-studio[data-mode=spread].tray-open #studio-rail>button[data-tool=remove]{grid-column:auto;flex-direction:column}}

#book-studio #studio-rail>button[aria-pressed=true]{color:#284C59!important}
@media(max-width:799px){#book-studio[data-mode=spread].tray-open #studio-rail{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px}#book-studio[data-mode=spread].tray-open #studio-rail>button{width:100%;min-width:0;flex-direction:column;justify-content:center;padding:2px;font-size:10px;overflow:hidden}#book-studio[data-mode=spread].tray-open #studio-rail>button[data-tool=remove]{grid-column:auto;flex-direction:column}}
/* Narrow phones (<=430px, e.g. 390): a slimmer side dock gives the page more width; same tools, same order. */
@media(max-width:430px){
 #book-studio.tray-open:not(.studio-keyboard){grid-template-columns:minmax(0,1fr) 114px}
 #book-studio.tray-open:not(.studio-keyboard) #studio-rail{width:114px;padding:2px;gap:2px}
 #book-studio.tray-open:not(.studio-keyboard) #studio-tray{width:114px;padding:6px 4px}
 #book-studio.tray-open:not(.studio-keyboard) .studio-workspace{padding:2px}
 #book-studio.tray-open:not(.studio-keyboard) #studio-controls .card{padding:0}
 #book-studio #studio-controls #lay-apply-text-all{font-size:11px;line-height:1.25;padding:4px 3px}
}

/* portrait 3:4 books in the studio (frames only, see styles.css) */
body[data-page-shape="portrait34"] #book-studio .cover-canvas{aspect-ratio:3/4}
body[data-page-shape="portrait34"] #book-studio[data-focus=selection] .studio-focus-target,body[data-page-shape="portrait34"] #book-studio[data-focus=page] .studio-focus-target,body[data-page-shape="portrait34"] #book-studio[data-focus=text] .studio-focus-target{aspect-ratio:3/4}
body[data-page-shape="portrait34"] #book-studio #studio-stage>#back-preview{aspect-ratio:3/4}
body[data-page-shape="portrait34"] #book-studio.matter-focus #studio-stage>img{width:calc(var(--studio-zoomwidth)*1.5);min-width:calc(var(--studio-zoomwidth)*1.5)}
@media(min-width:800px){body[data-page-shape="portrait34"] #book-studio .lspread{max-width:calc((100dvh - 150px)*1.5)}}
/* Horizontal bottom controls on portrait phones (Yohay, WhatsApp 2026-11-15): the tool rail and the
   tray move from the side of the screen to horizontal strips under the workspace, so the page keeps
   its full width and the empty side space is used. Landscape phones and >=800px keep the side dock;
   the on-screen-keyboard mode already has its own horizontal rows. */
@media(max-width:799px) and (orientation:portrait){
 #book-studio:not(.studio-keyboard),#book-studio.tray-open:not(.studio-keyboard){grid-template-columns:minmax(0,1fr)}
 #book-studio:not(.studio-keyboard){grid-template-rows:58px minmax(0,1fr) auto auto 96px}
 #book-studio:not(.studio-keyboard) .studio-workspace{grid-column:1/-1;grid-row:2}
 #book-studio:not(.studio-keyboard) #studio-tray,#book-studio.tray-open:not(.studio-keyboard) #studio-tray{grid-column:1/-1;grid-row:3;width:100%;max-height:44dvh;border-inline-start:0;border-top:1px solid #DDE3E0;padding:6px 8px;margin-top:0;overflow-y:auto}
 #book-studio:not(.studio-keyboard) #studio-rail,#book-studio.tray-open:not(.studio-keyboard) #studio-rail{grid-column:1/-1;grid-row:4;display:flex;flex-direction:row;width:100%;height:auto;max-height:62px;padding:2px 6px;gap:4px;overflow-x:auto;overflow-y:hidden;border-left:0;border-top:1px solid #DDE3E0;align-self:stretch}
 #book-studio:not(.studio-keyboard) #studio-rail>button,#book-studio.tray-open:not(.studio-keyboard) #studio-rail>button{flex:0 0 auto;width:auto;min-width:46px;min-height:52px;height:52px;flex-direction:column;justify-content:center;grid-column:auto;padding:2px 4px;font-size:10px}
 #book-studio:not(.studio-keyboard) #studio-view-tools{flex-direction:row;flex-wrap:nowrap;margin-top:0;padding-top:0}
 #book-studio:not(.studio-keyboard) #studio-footer{grid-column:1/-1;grid-row:5}
}
#layout>#lay-full-preview{margin:4px 0 12px}
/* Spread image/text tools live inside the page editor (book-studio); outside it the stage shows the spread preview only. */
#lay-stage>:not(.lspread){display:none}

/* A single page-editing surface. Existing controls are moved, never cloned. */
#layout #lay-reset{display:none}
#book-studio #layout-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0;margin:0;border:0;gap:8px}
#book-studio #layout-choices h2{font-size:15px;margin:4px 0}
#book-studio #layout-choices .layout-choice{min-width:0;padding:8px;font-size:12px}
#book-studio [data-panel=layout]>.lay-tpl{display:none}
#book-studio #lay-reset{display:block;width:100%;margin-top:12px}

#book-studio #bulk-images-card{display:block;padding:0;margin:8px 0;border:0}
#book-studio .studio-bulk-images{margin:10px 0}
#book-studio .studio-bulk-images>summary{min-height:44px;cursor:pointer;line-height:1.6;padding:8px 0}

/* Optional preparation: upload a pool before designing, assign it inside the editor. */
body[data-wizard=images] #bulk-images-card{display:block}
body[data-wizard=images] .bulk-image-card>select,body[data-wizard=images] .bulk-image-card>.btn,body[data-wizard=images] .bulk-image-card>small,body[data-wizard=images] .assignment-overview{display:none}
#book-studio [data-panel=layout]>.lay-tpl{display:none!important}
#layout-choices .ws-pic{width:100%;height:64px;flex:none}#layout-choices .ws-pic .pg{max-width:42px}#layout-choices .ws-pic .pg.wide{max-width:84px}

#pair-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}#pair-row .btn{width:auto;min-height:40px;padding:6px 14px;font-size:13px;margin:0}#pair-row .pair-label{font-size:13px;font-weight:600;color:#345b55}#pair-row #page-count{margin-inline-start:auto}

#ai-prompt-workshop .ap-del::before{margin-inline-end:0;width:22px;height:22px}

/* One page surface, one compact recording rail, settings hold book-level fields. */
#studio-page-audio{display:flex;gap:8px;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:6px 12px}
#studio-page-audio:empty{display:none}#studio-page-audio .btn{font-size:13px;min-height:44px;flex:1;max-width:260px}
#studio-settings{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink);font:inherit;font-size:12px}
#studio-controls .studio-settings-panel{display:grid;gap:16px}#studio-controls .studio-settings-panel[hidden]{display:none}
#studio-settings-panel .grid{grid-template-columns:1fr}#studio-controls .wizard-details{border:0;padding:0}
body[data-screen=layout]:not(.studio-open) #layout>*,body[data-screen=layout]:not(.studio-open) #wizard,body[data-screen=layout]:not(.studio-open) #wizard-actions{visibility:hidden}
#review-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#review-actions .btn{width:100%;font-size:13px;min-height:44px;margin:0}#review-actions>small{grid-column:1/-1;font-size:11px}
#wp-audio{display:flex;gap:8px;flex-wrap:wrap}#wp-audio .btn{font-size:13px;min-height:44px;flex:1}
#studio-footer #studio-book-nav{gap:6px}#studio-footer #studio-book-nav>button{font-size:12px;min-height:44px}
@media(max-width:600px){.studio-header{gap:6px;padding:6px}.studio-header h2{font-size:14px}.studio-header #studio-save{display:none}.studio-history button{min-width:36px}.studio-header #studio-fit-keyboard{display:none}#studio-book-nav{grid-template-columns:1fr 1fr}#studio-part{grid-column:1/-1}#studio-book-nav select[aria-label="הוספת עמוד לספר"]{grid-column:1/-1}#studio-page-audio{padding:4px 8px}#studio-page-audio .btn{padding:5px 9px;font-size:12px}}

#book-studio.studio-recording>#reader{position:absolute;inset:0;z-index:50;background:var(--bg,#f6f6f1);overflow:auto;max-height:100dvh;box-sizing:border-box}
#book-studio.studio-recording>.studio-header,#book-studio.studio-recording>.studio-workspace,#book-studio.studio-recording>#studio-footer,#book-studio.studio-recording>#studio-rail,#book-studio.studio-recording>#studio-tray{visibility:hidden}

#studio-controls .studio-settings-panel #voice-manager{display:block!important;margin:0;padding:0;border:0;background:none}#studio-controls .studio-settings-panel #voice-manager h2{font-size:16px}#studio-controls .studio-settings-panel .grid{grid-template-columns:1fr}#studio-controls .studio-settings-panel>p{font-size:12px}
/* Footer is a single vertical stack; page picker and recording never compete for width. */
#book-studio:not(.studio-keyboard){grid-template-rows:58px minmax(0,1fr) auto 56px auto}
#book-studio #studio-footer{display:flex;flex-direction:column;gap:6px;padding:6px 8px;min-height:0;max-height:none;overflow:visible;align-items:stretch;justify-content:initial}
#book-studio #studio-book-nav{display:grid;width:100%;min-width:0;grid-template-columns:44px minmax(0,1fr) 44px;grid-template-rows:44px;gap:6px;align-items:stretch;padding:0}
#book-studio #studio-book-nav>select#studio-part{grid-column:2;grid-row:1;width:100%;min-width:0;height:44px}
#book-studio #studio-book-nav>button{width:44px;min-width:44px;padding:0;font-size:0;height:44px;min-height:44px}
#book-studio #studio-book-nav>button:nth-child(2){grid-column:1;grid-row:1}#book-studio #studio-book-nav>button:nth-child(2):before{content:'→';font-size:22px}
#book-studio #studio-book-nav>button:nth-child(3){grid-column:3;grid-row:1}#book-studio #studio-book-nav>button:nth-child(3):before{content:'←';font-size:22px}
#book-studio #studio-book-nav>select[aria-label="הוספת עמוד לספר"]{grid-column:1/-1;height:44px;width:100%;min-width:0;grid-row:2}
#book-studio #studio-page-audio{width:100%;padding:0;min-width:0;flex:none}#book-studio #studio-page-audio>.btn{max-width:none;height:44px;min-height:44px}
#book-studio .studio-header button{min-height:44px;height:44px;min-width:44px}

#book-studio #studio-book-nav>#studio-part{grid-column:2!important;grid-row:1;width:100%;min-width:0}#book-studio #studio-footer #studio-page-audio{order:2}#book-studio #studio-footer #studio-book-nav{order:1}
#book-studio .studio-history{display:flex;gap:4px}#book-studio .studio-history button{padding:0}#book-studio .studio-header{grid-template-columns:auto minmax(0,1fr) auto auto;display:grid}#book-studio .studio-header h2{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#book-studio .studio-header>div:not(.studio-history){min-width:0}#book-studio .studio-header #studio-save{display:none}

#book-studio.studio-recording #reader-page{width:100%;min-width:0;padding:8px;overflow:auto}#book-studio.studio-recording #reader-page>.rspread{flex:none;width:100%!important;min-width:100%;aspect-ratio:var(--spread-ratio,2);height:auto;max-width:none}#book-studio.studio-recording #reader-page>.credits-record-copy{width:100%;font-size:20px;line-height:1.8}#book-studio.studio-recording #reader-page>img{width:100%;height:auto;max-height:100%}

/* One recorded leaf at a time, just like the page being edited. */
.reader-page>.recording-single{display:block!important;width:min(100%,62vh)!important;min-width:0!important;aspect-ratio:auto!important;flex:none!important}.reader-page>.recording-single>.lleaf{display:block;width:100%!important;min-width:0!important;aspect-ratio:var(--page-ratio,1);flex:none!important}
body:not(.studio-open) #voice-manager{display:none!important}
body[data-wizard=review] #wizard-help{display:none}body[data-wizard=review] #wizard{margin:12px 0}body[data-wizard=review] #session-only-notice{font-size:12px;padding:8px;line-height:1.5;margin:6px 0}
body[data-wizard=review] #status{font-size:12px;line-height:1.5;padding:8px;margin:8px 0}body[data-wizard=review] #wizard-step{font-size:20px}
body[data-screen=book]:not([data-wizard=edit]) .android-install-link{display:none}

body[data-page-shape=portrait34] .reader-page>.recording-single>.lleaf{aspect-ratio:3/4}body[data-page-shape=square] .reader-page>.recording-single>.lleaf{aspect-ratio:1}

#session-only-notice{font-size:12px;padding:8px;line-height:1.5;margin:8px 0}#status{font-size:13px;padding:8px;line-height:1.5;margin:8px 0}body[data-wizard=edit] #wizard-help{display:none}body[data-wizard=edit] #wizard{margin:12px 0}#app-download{width:100%;font-size:12px;white-space:normal;line-height:1.5}#whole-source{margin-top:12px}#whole-text{margin-top:8px}

#book-studio #studio-error:not(:empty){display:block;flex:none;width:100%;box-sizing:border-box;font-size:13px;line-height:1.5;background:#fff2f2;color:#8a2020;border:1px solid #bd5454;border-radius:8px;padding:10px;margin:6px 0;max-height:30dvh;overflow:auto}

#book-studio #studio-error:has(> [hidden]):not(:has(> :not([hidden]))){display:none}

/* Compact editor controls, 2026-11-17: one toolbar and one current recording action. */
#book-studio .studio-header{display:flex;direction:rtl;justify-content:space-between;gap:8px;position:relative}
#book-studio .studio-header .studio-heading{min-width:0;flex:1}
#book-studio .studio-header h2{font-size:12px;max-width:none}
#book-studio .studio-header-actions{display:flex;gap:5px;flex:0 0 auto;align-items:center;direction:rtl}
#book-studio .studio-header .studio-header-actions>button,#book-studio .studio-header #studio-done{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:0!important;background:var(--book-action-paper);color:var(--book-action-ink);border:1px solid var(--book-action-outline);border-radius:10px}
#book-studio .studio-header-actions>button::before,#book-studio .studio-header #studio-done::before{display:block;width:28px;height:28px;margin:0;background-size:contain}
#book-studio #studio-toolbar-tip{position:absolute;top:56px;inset-inline:8px;z-index:65;background:#193a40;color:white;padding:8px 12px;border-radius:8px;width:max-content;max-width:calc(100% - 16px);font-size:13px;direction:rtl;box-shadow:0 3px 12px #0003;pointer-events:none}
#book-studio #studio-controls .studio-settings-panel{gap:10px}
#book-studio #studio-controls .studio-settings-panel>.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:start}
#book-studio #studio-controls .studio-settings-panel>.grid label{font-size:11px;line-height:1.45}
#book-studio #studio-controls .studio-settings-panel input,#book-studio #studio-controls .studio-settings-panel select{font-size:12px;padding:5px 7px;height:44px;min-height:44px}
#book-studio .studio-settings-panel>p{margin:0;font-size:11px}
#book-studio #studio-controls .studio-voice-help{font-size:12px;line-height:1.6;margin:5px 0 10px}
#book-studio #studio-controls .studio-voice-extra{margin-top:10px;border-top:1px solid var(--line);padding-top:4px}
#book-studio .studio-voice-extra>summary{padding:10px 0;min-height:44px;cursor:pointer}
#book-studio .studio-voice-extra:not([open])>:not(summary){display:none}
#book-studio #studio-page-audio .studio-current-record{background:var(--book-action-primary);font-weight:700}
#book-studio .studio-recording-hint{flex-basis:100%;font-size:10px;text-align:center;line-height:1.3;color:var(--muted)}
@media(min-width:800px),(orientation:landscape){#book-studio[data-tool=settings].tray-open{grid-template-columns:minmax(0,1fr) 290px 60px}#book-studio[data-tool=settings].tray-open #studio-tray{width:290px}}
#book-studio .studio-header .studio-header-actions>button{width:44px!important;min-width:44px!important;max-width:44px!important;flex:0 0 44px!important;background:var(--book-action-paper)!important}
#book-studio .studio-header .studio-header-actions>button::before{width:28px!important;height:28px!important;margin:0!important}
#book-studio #studio-controls .studio-settings-panel>.studio-book-help{font-size:11px;line-height:1.5}
#book-studio .studio-book-help>summary{min-height:36px;padding:8px 0;cursor:pointer}
#book-studio #studio-controls .studio-voice-extra:not([open])>:not(summary){display:none!important}

/* Page image actions belong to the selected page; the reusable pool belongs to book settings. */
#book-studio #studio-controls .studio-page-image{display:grid;grid-template-columns:repeat(3,44px);justify-content:start;align-items:center;gap:8px;padding:4px 0 10px}
#book-studio .studio-page-image>h3,#book-studio .studio-page-image>select{grid-column:1/-1;margin:0}
#book-studio #studio-controls .studio-image-action{display:inline-flex;align-items:center;justify-content:center;width:44px!important;min-width:44px!important;max-width:44px!important;min-height:44px!important;height:44px!important;padding:0!important;font-size:0!important;margin:0;cursor:pointer;border-radius:10px;background:var(--book-action-paper);border:1px solid var(--book-action-outline)}
#book-studio .studio-image-action::before{width:28px;height:28px;margin:0!important}
#book-studio .studio-image-action[aria-pressed=true]{background:var(--book-action-primary)!important;border-color:var(--book-action-ink)!important}
#book-studio #studio-image-locks{display:contents}
#book-studio .studio-page-image>.row{display:contents}
#book-studio .studio-spread-image,#book-studio .studio-source-images{margin:4px 0;border-top:1px solid var(--line)}
#book-studio .studio-spread-image>summary,#book-studio .studio-source-images>summary,#book-studio .studio-book-images>summary{padding:10px 0;min-height:44px;cursor:pointer}
#book-studio details.studio-spread-image:not([open])>:not(summary),#book-studio .studio-source-images:not([open])>:not(summary),#book-studio .studio-book-images:not([open])>:not(summary){display:none!important}
#book-studio #studio-controls .studio-book-images #bulk-images-card{margin:0}
#book-studio #studio-controls .studio-book-images>p{font-size:12px;line-height:1.5}
#book-studio #studio-controls .page-prompt-panel{border-top:1px solid var(--line);padding-top:8px;margin-top:4px}
#book-studio #studio-controls .page-prompt-panel h3{font-size:13px;margin:4px 0}
#book-studio #studio-controls .page-prompt-panel>p{font-size:11px;line-height:1.5;margin:5px 0}
#book-studio #studio-controls .prompt-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0}
#book-studio #studio-controls .page-prompt-panel>button{margin:6px 0;min-height:44px;font-size:12px}
#book-studio #studio-controls .prompt-advanced>summary,#book-studio #studio-controls .prompt-style-samples>summary{padding:8px 0;min-height:36px;cursor:pointer}
#book-studio #studio-controls .prompt-advanced:not([open])>:not(summary),#book-studio #studio-controls .prompt-style-samples:not([open])>:not(summary){display:none!important}
#book-studio #studio-controls .prompt-result h4{font-size:13px;margin:6px 0}
#book-studio #studio-controls .prompt-result textarea{font-size:12px;line-height:1.5;max-height:180px;min-height:110px;width:100%}
#book-studio #studio-controls .page-prompt-panel .illustration-style-card img{height:76px;aspect-ratio:auto;object-fit:contain}
#book-studio #studio-controls .page-prompt-panel .illustration-style-picker{margin:5px 0}
#book-studio #studio-controls .page-prompt-panel .illustration-style-status,#book-studio #studio-controls .page-prompt-panel .illustration-style-picker>p{display:none}
#book-studio #studio-error #lay-msg.studio-success{color:#365c43}
#book-studio #studio-controls .prompt-result[hidden]{display:none!important}
html body dialog.reference-package-dialog[open]{position:fixed;inset:12px 0;margin:auto;width:min(680px,calc(100vw - 20px));max-width:calc(100vw - 20px);height:fit-content;max-height:calc(100dvh - 24px);padding:0 16px 14px;overflow:auto;overscroll-behavior:contain;font-size:14px;line-height:1.45;background:#fffdf7}
html body .reference-package-dialog .reference-dialog-header{position:sticky;top:0;z-index:3;background:#fffdf7;padding:10px 0;border-bottom:1px solid #d4dfce;min-height:54px}
html body .reference-package-dialog .reference-dialog-header h2{font-size:19px;margin:0}
html body .reference-package-dialog .btn{width:auto!important;min-width:0!important;max-width:100%!important;min-height:44px!important;font-size:14px!important;padding:8px 12px!important;margin:0!important;line-height:1.3}
html body .reference-package-dialog .btn::before{display:none!important}
html body .reference-package-dialog #reference-close{width:44px!important;height:44px!important;flex:0 0 44px;font:30px/1 Arial,sans-serif!important;border-radius:50%;padding:0!important;display:grid;place-items:center}
html body .reference-package-dialog h3{font-size:14px;color:#647064;margin:12px 0 6px;font-weight:700}
.reference-summary-card{position:relative;border:1px solid #d9d6c8;background:white;border-radius:12px;padding:0 12px}
.reference-summary-row{display:flex;gap:10px;align-items:center;padding:9px 0;min-width:0}
.reference-summary-row+.reference-summary-row{border-top:1px solid #ece8dd}
.reference-summary-row:first-child{padding-inline-end:68px;min-height:56px}
.reference-summary-row img{width:64px;height:44px;object-fit:cover;border-radius:6px;flex:none;pointer-events:none}
.reference-summary-value{min-width:0;flex:1}.reference-summary-label{display:block;color:#6c746a;font-size:12px}
.reference-summary-card p{margin:2px 0;font-size:14px;font-weight:600;overflow-wrap:anywhere}
html body .reference-package-dialog #reference-edit-characters{position:absolute;inset-inline-end:10px;top:12px;padding:7px 9px!important;font-size:12px!important}
.reference-prompt-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}.reference-prompt-heading h3{margin:0!important}
#reference-prompt-tools{display:flex;gap:5px;direction:rtl;flex:none}
html body .reference-package-dialog #reference-prompt-tools .btn{width:44px!important;height:44px!important;min-width:44px!important;flex:0 0 44px;padding:0!important;display:grid!important;place-items:center;position:static!important;inset:auto!important;border-radius:10px!important;box-shadow:none!important;transform:none!important}
html body .reference-package-dialog #reference-prompt-tools svg{display:block;width:20px;height:20px}
html body .reference-package-dialog label{display:block;margin:6px 0 0;font-size:13px}
html body .reference-package-dialog .prompt-copy-field{margin:0;padding:0!important;position:relative}
html body .reference-package-dialog textarea#reference-instructions{box-sizing:border-box;height:116px;min-height:116px;max-height:40dvh;width:100%;padding:10px!important;direction:ltr;text-align:left;font-size:14px;line-height:1.4;unicode-bidi:plaintext;border:1px solid #d9d6c8;border-radius:10px;resize:vertical;background:#fff}
html body .reference-package-dialog.reference-prompt-expanded textarea#reference-instructions{height:300px;max-height:45dvh}
html body .reference-package-dialog #reference-expand{display:block;margin:0 auto!important;min-height:44px!important;color:#926d20;background:transparent;border:0;box-shadow:none;padding:4px 10px!important;font-size:13px!important}
html body .reference-package-dialog .reference-package-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:10px}
html body .reference-package-dialog .reference-package-actions .btn{display:block;width:100%!important;min-height:46px!important;font-size:15px!important;font-weight:700}
html body .reference-package-dialog #reference-share{background:#eee8d8}
html body .reference-package-dialog .reference-share-hint{font-size:11px;color:#647064;line-height:1.4;margin:8px 0 0}
html body .reference-package-dialog .reference-license{font-size:11px;text-align:center;margin:10px 0 0}
html body .reference-package-dialog #reference-package-status,html body .reference-package-dialog .prompt-share-status{font-size:12px;line-height:1.4;margin:6px 0 0;overflow-wrap:anywhere}
html body .reference-package-dialog #reference-package-status:empty,html body .reference-package-dialog .prompt-share-status:empty{display:none}
html body .reference-package-dialog .reference-intro,html body .reference-package-dialog .reference-photo-tools{display:none!important}
#book-studio #studio-error:has(#lay-msg.studio-success){border-color:#b6cbb9;background:#f0f6ee;color:#365c43}
@media(max-width:360px){html body dialog.reference-package-dialog[open]{padding:0 10px 10px}.reference-summary-row img{width:48px;height:38px}.reference-summary-card{padding:0 9px}.reference-summary-card p{font-size:12px}html body .reference-package-dialog .reference-dialog-header h2{font-size:17px}.reference-prompt-heading h3{font-size:12px!important}#reference-prompt-tools{gap:3px}}
body[data-wizard=review] #wizard-preview{padding:12px;max-width:1040px;margin-inline:auto}
body[data-wizard=review] #wizard-preview h2{font-size:18px;margin:0 0 8px}
body[data-wizard=review] #wizard-preview>.nav{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;align-items:center}
body[data-wizard=review] #wizard-preview>.nav button{font-size:12px;min-height:44px;padding:6px;margin:0}
body[data-wizard=review] #wp-stage{min-height:240px;margin:10px 0;width:100%;overflow:hidden}
body[data-wizard=review] #wp-stage>img{display:block;width:100%;height:min(52vh,540px);max-height:none;object-fit:contain}
body[data-wizard=review] #wp-stage>.lspread{width:100%;max-height:55vh}
body[data-wizard=review] #wp-credits>summary{font-size:12px;padding:8px 0}
body[data-wizard=review] #review-actions{display:flex;flex-direction:column;gap:10px;align-items:stretch;margin-top:8px}
body[data-wizard=review] #review-actions .review-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body[data-wizard=review] #review-actions .review-secondary button{width:100%;min-height:44px;height:44px;padding:6px;font-size:12px;margin:0}
body[data-wizard=review] #review-actions .review-secondary button::before{width:18px;height:18px;margin-inline-end:4px;display:inline-block;vertical-align:middle}
body[data-wizard=review] #review-actions .review-download-primary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;border-top:1px solid var(--line);padding-top:10px}
body[data-wizard=review] #review-actions .review-copy-choice{font-size:12px;display:grid;gap:4px;margin:0;min-width:0}
body[data-wizard=review] #review-actions .review-copy-choice select{min-width:0;width:100%;height:44px;font-size:12px;padding:6px}
body[data-wizard=review] #review-actions #review-download{width:auto;min-height:44px;height:44px;padding:8px 12px;font-size:13px;margin:0;white-space:nowrap}
body[data-wizard=review] #review-actions #review-download::before{width:18px;height:18px;margin-inline-end:4px;vertical-align:middle}
body[data-wizard=review] #review-reading-only[hidden]{display:none!important}
body[data-wizard=review] #review-actions>small{font-size:11px;line-height:1.5}
body[data-wizard=review] #wp-audio{gap:8px}
body[data-wizard=review] #wp-audio .btn{min-height:40px;font-size:12px;padding:6px 10px;margin:0}
body[data-wizard=review] #wp-audio select{font-size:12px;min-height:40px}
body[data-wizard=review] #wizard-next{display:none}
html body dialog.illustration-style-preview{box-sizing:border-box;max-height:calc(100dvh - 24px);max-width:calc(100vw - 20px);width:min(700px,calc(100vw - 20px));padding:12px;overflow:auto}
html body .illustration-style-preview .illustration-preview-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
html body .illustration-style-preview .illustration-preview-header h3{font-size:16px;margin:0}
html body .illustration-style-preview .illustration-preview-header button{font-size:24px!important;line-height:1!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important}
html body .illustration-style-preview button::before{display:none!important}
html body .illustration-style-preview>img{max-height:48dvh;object-fit:contain;width:100%;display:block}
html body .illustration-style-preview>p{font-size:13px;margin:8px 0}
html body .illustration-style-preview .illustration-preview-actions{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px}
html body .illustration-style-preview .illustration-preview-actions button{font-size:13px!important;height:44px!important;min-height:44px!important;min-width:0!important;padding:6px!important;margin:0!important}
html body dialog#book-share-dialog{direction:rtl;box-sizing:border-box;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:14px;border:1px solid #cbd6c9;border-radius:14px;background:#fffdf7;color:#293d32}
#book-share-dialog::backdrop{background:#15291bd9}
#book-share-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:-14px;background:#fffdf7;padding:10px 0;z-index:2}
#book-share-dialog h2{font-size:18px;margin:0}
#book-share-dialog>header button{height:44px;width:44px;padding:0;font-size:24px;border:1px solid #bbc9c0;border-radius:9px;background:#f1ebda}
#book-share-dialog p{font-size:13px;line-height:1.5;margin:8px 0}
#book-share-dialog input{width:100%;box-sizing:border-box;min-height:44px;font-size:16px}
#book-share-dialog .btn{min-height:44px;font-size:13px;padding:8px 12px;margin:6px 0;max-width:100%}
#book-share-dialog .btn::before{width:18px;height:18px}
#book-share-dialog label{font-size:13px;display:grid;gap:4px}
#book-share-dialog .share-technical{font-size:12px;border-top:1px solid #d4dfce;margin-top:8px;padding-top:8px}
#book-share-dialog .share-technical>summary{min-height:36px;cursor:pointer}
#book-share-dialog .share-technical:not([open])>:not(summary){display:none!important}
body[data-screen=book]:not(.studio-open)>.top{min-height:52px;gap:8px;margin-bottom:8px;padding:6px 0;flex-wrap:nowrap}
body[data-screen=book]:not(.studio-open)>.top h1{font-size:16px;margin:0}
body[data-screen=book]:not(.studio-open)>.top .actions{gap:6px;flex-wrap:nowrap}
body[data-screen=book]:not(.studio-open)>.top .btn,body[data-screen=book]:not(.studio-open)>.top .site-file-menu>summary{min-height:44px;font-size:11px;padding:6px 8px;margin:0}
body[data-screen=book]:not(.studio-open)>.status{font-size:11px;padding:7px 10px;margin:6px 0;line-height:1.45}
body[data-screen=book]:not(.studio-open)>#book>#wizard{margin:12px 0 10px}
body[data-screen=book] #wizard-step{font-size:18px;margin:8px 0}
body[data-screen=book] .site-notice{font-size:11px;margin-bottom:8px}
body[data-wizard=review] #wp-stage>img{height:min(43vh,480px)}
@media(max-width:600px){body[data-screen=book]:not(.studio-open)>.top .site-mark{display:none}body[data-wizard=review] #wizard-preview{padding:10px}body[data-wizard=review] #wp-stage{min-height:180px}}
#book-studio.book-settings-open{grid-template-columns:1fr!important;grid-template-rows:52px minmax(0,1fr)!important}
#book-studio.book-settings-open .studio-workspace,#book-studio.book-settings-open #studio-footer,#book-studio.book-settings-open #studio-rail{display:none!important}
#book-studio.book-settings-open #studio-tray{grid-column:1/-1!important;grid-row:2/-1!important;width:100%!important;max-width:none!important;padding:12px clamp(12px,4vw,44px)!important;box-sizing:border-box!important}
#book-studio.book-settings-open .studio-tray-head{position:sticky;top:0;z-index:3;background:#fbfcfb;min-height:44px;padding-bottom:8px;justify-content:space-between}
#book-studio.book-settings-open #studio-close-tray{width:44px;min-width:44px;height:44px;min-height:44px}
#book-studio.book-settings-open #studio-controls{max-width:850px;margin-inline:auto}
#book-studio #bulk-images-card>label.btn{display:inline-flex;width:auto!important;min-height:44px!important;font-size:12px!important;padding:8px 12px!important;margin:6px 0}
.assignment-page .assignment-preview{width:100px;min-width:100px;height:100px;position:relative;overflow:hidden;container-type:inline-size}
.assignment-page .assignment-preview.lspread{width:180px;min-width:180px;height:90px;display:flex;direction:rtl}
.assignment-preview>.lleaf{width:100%;height:100%;position:relative;overflow:hidden;container-type:inline-size}
.assignment-preview.lspread>.lleaf{width:50%;height:100%;flex:0 0 50%}
.assignment-page small{display:block;font-size:11px}
#book-studio.book-settings-open #studio-tray{height:100%!important;max-height:none!important;align-self:stretch!important}
#book-studio #studio-save-dialog{direction:rtl;width:min(480px,calc(100vw - 28px));box-sizing:border-box;border:1px solid #b7c9c0;border-radius:14px;padding:16px;background:#fffdf7;color:#293d32;max-height:90dvh;overflow:auto}
#studio-save-dialog h2{font-size:18px;margin:0 0 10px}#studio-save-dialog p{font-size:13px;line-height:1.6;margin:8px 0}
#studio-save-dialog>div{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
#studio-save-dialog button{height:44px;min-height:44px;min-width:64px;padding:8px 12px;border:1px solid #b7c9c0;border-radius:9px;font-size:13px;background:#f1ebda;color:#293d32}
#studio-save-dialog [data-save-download]{background:#f2dfa5}#studio-save-dialog button::before{display:none}
#book-studio.book-settings-open #studio-context{visibility:hidden}
#book-studio #studio-save-copy::before{content:'💾';background-image:none!important;font-size:26px;line-height:1;display:grid;place-items:center}
#book-studio.book-settings-open #studio-context{visibility:hidden}
#book-studio #studio-save-copy::before{--book-action-icon:url('action-icons/action_save.png');background-image:url('action-icons/action_save.png')}

/* Compact human-facing text tools and explicit book-wide changes. */
.editor-action-dialog{box-sizing:border-box;direction:rtl;width:min(360px,calc(100vw - 28px));max-height:calc(100dvh - 48px);overflow:auto;border:1px solid #cbd5e1;border-radius:16px;padding:18px;box-shadow:0 18px 60px #0004;color:#17283d;background:#fff;}
.editor-action-dialog::backdrop{background:#14203366}.editor-action-dialog h2{font-size:1.1rem;margin:0 0 10px}.editor-action-dialog p{font-size:.9rem;line-height:1.5;margin:10px 0}.editor-action-dialog .row{justify-content:flex-end;gap:8px;margin-top:14px}.editor-action-dialog button,.editor-action-dialog select{min-height:44px}.editor-action-dialog select{width:100%;font-size:.9rem}.editor-action-dialog .compact-check{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:.9rem}.editor-action-dialog input[type=checkbox]{width:20px;height:20px}
#book-studio #lay-style-tools h3,#book-studio #lay-background-tools h3{font-size:.85rem;margin:6px 0}#book-studio #lay-style-tools p,#book-studio #lay-background-tools p{display:none}#book-studio #lay-style-tools .row{gap:8px;align-items:center}#book-studio #lay-style-tools label{font-size:.8rem}#book-studio #lay-style-tools input[type=color],#book-studio #lay-background-tools input[type=color]{height:38px;width:44px;padding:3px}#book-studio #lay-tools{padding:8px 0}#book-studio #lay-tools label{font-size:.82rem}#book-studio #lay-background-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#book-studio #lay-background-tools h3{width:100%}#book-studio #lay-background-tools label{font-size:.8rem;display:flex;align-items:center;gap:5px}#book-studio #lay-background-tools input[type=range]{max-width:108px}#book-studio .studio-text-groups{margin-top:10px;font-size:.85rem}#book-studio .studio-text-groups summary{padding:10px 0;cursor:pointer}.text-position-numbers[hidden]{display:none!important}#book-studio .studio-book-template{padding:0 0 12px}#book-studio .studio-book-template h3{margin:4px 0}#book-studio .studio-book-template .lay-tpl{display:flex;flex-wrap:wrap;gap:8px}

#book-studio .editor-action-dialog label.compact-check{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start;gap:8px;font-weight:400;font-size:14px;min-height:44px;margin:8px 0}#book-studio .editor-action-dialog label.compact-check input{display:inline-block;flex:0 0 20px;width:20px!important;height:20px!important;margin:0}.editor-undo-bar{position:fixed;z-index:1000;bottom:115px;left:12px;right:12px;max-width:470px;margin:auto;background:#fff;border:1px solid #9caca8;border-radius:12px;padding:8px;box-shadow:0 4px 20px #0003;display:flex;align-items:center;gap:8px;direction:rtl;font-size:14px}.editor-undo-bar button{min-height:44px}.editor-undo-bar button:last-child{margin-inline-start:auto}

#book-studio [data-panel=remove]{gap:8px}#book-studio [data-panel=remove]:not([hidden]){display:grid}#book-studio [data-panel=remove] button{min-height:44px;text-align:right}

#book-studio #studio-controls [data-panel=pages] .studio-page-actions{display:flex;gap:8px;flex-wrap:wrap}#book-studio #studio-controls [data-panel=pages] .studio-page-actions button{width:auto;min-height:44px;padding:8px 10px;flex:0 1 auto;font-size:13px}#book-studio #studio-controls [data-panel=pages] h3{font-size:16px;margin:0 0 6px}#book-studio .studio-page-transfer{margin-top:12px;font-size:13px}#book-studio .studio-page-transfer summary{min-height:44px;padding:10px 0;cursor:pointer}#book-studio .studio-remove-local{font-size:12px!important;width:auto!important;align-self:flex-start;min-height:44px;margin-top:10px}
/* Override generic stacked drawer rows only within compact text controls. */
#book-studio #studio-controls #lay-style-tools .row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px}#book-studio #studio-controls #lay-style-tools .row label{display:flex;align-items:center;gap:4px;font-size:12px}#book-studio #studio-controls #lay-style-tools input[type=color],#book-studio #studio-controls #lay-background-tools input[type=color]{width:40px;min-width:40px;height:36px;min-height:36px;padding:2px}#book-studio #studio-controls #lay-style-tools .row select{width:auto;flex:1;min-width:105px;min-height:40px}#book-studio #studio-controls #lay-style-tools h3{display:none}#book-studio #studio-controls #lay-apply-text-all{font-size:12px;width:auto;min-height:40px;padding:6px 10px;margin:4px 0}#book-studio #studio-controls #lay-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#book-studio #studio-controls #lay-tools[hidden]{display:none}#book-studio #studio-controls #lay-tools #lay-font{width:100%;height:40px}#book-studio #studio-controls #lay-tools .lay-size{display:flex;align-items:center;gap:6px;flex:1;min-width:140px}#book-studio #studio-controls #lay-tools .lay-size input{min-height:32px}#book-studio #studio-controls #lay-size-val{display:none}#book-studio #studio-controls #lay-tools button{font-size:12px;min-height:40px;width:auto;padding:6px 10px}#book-studio #studio-controls #lay-background-tools label{display:flex;align-items:center;gap:5px;font-size:12px}#book-studio #studio-controls #lay-background-tools input[type=range]{width:90px;min-height:32px}#book-studio #studio-controls .studio-book-template .lay-tpl{display:flex;flex-direction:row;gap:8px;align-items:center}#book-studio .editor-action-dialog button::before{display:none!important}

.illustration-selected-preview>button{display:flex!important;align-items:center;gap:10px;font-size:12px;min-height:56px;padding:5px 8px;width:auto!important;text-align:start}.illustration-selected-preview>button img{width:72px!important;height:48px!important;min-width:72px;object-fit:cover;border-radius:5px;margin:0}.illustration-selected-preview>button::before{display:none!important}.illustration-selected-preview>div[hidden]{display:none!important}#book-studio #studio-controls .illustration-selected-preview>button{font-size:12px;min-height:56px;padding:5px 8px}#book-studio #studio-controls .illustration-selected-preview{margin:6px 0}

#book-studio #studio-controls .studio-image-framing{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}#book-studio #studio-controls .studio-image-framing button{width:auto;font-size:12px;min-height:44px;padding:6px 10px}#book-studio #studio-controls .studio-image-framing p{margin:0;font-size:11px;line-height:1.45;width:100%}

#book-studio #studio-controls .studio-spread-toggle{display:flex!important;align-items:center;gap:8px;min-height:44px;font-size:13px;font-weight:600}#book-studio #studio-controls .studio-spread-toggle input{appearance:none;width:42px;height:24px;min-width:42px;min-height:24px;border-radius:20px;background:#c6ceca;position:relative;cursor:pointer;padding:0;direction:ltr}#book-studio #studio-controls .studio-spread-toggle input:checked{background:#346c60}#book-studio #studio-controls .studio-spread-toggle input::before{content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:white;box-shadow:0 1px 3px #0005}#book-studio #studio-controls .studio-spread-toggle input:checked::before{left:21px}#book-studio #studio-controls .studio-shared-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}#book-studio #studio-controls .studio-shared-tools label.btn{font-size:12px;min-height:44px;padding:6px 10px;width:auto}#book-studio #studio-controls .studio-shared-tools [hidden]{display:none!important}
#book-studio #studio-controls label.studio-spread-toggle{flex-direction:row!important;white-space:nowrap;font-size:12px;line-height:1.4;margin:0;padding:0;gap:6px}#book-studio #studio-controls .studio-spread-toggle input{flex:0 0 42px;margin:0}

#book-studio #studio-controls .studio-image-framing [data-image-scope]{display:block;font-size:12px;line-height:1.45;padding:6px 0;color:#244f4c}

/* Feedback takes its own space; it must not cover the page/view controls or tools. */
#book-studio .studio-workspace>.editor-undo-bar{position:static;inset:auto;flex:0 0 auto;width:100%;max-width:none;box-sizing:border-box;margin:4px 0;padding:4px 6px;box-shadow:none;z-index:auto;min-width:0;font-size:12px}
#book-studio .studio-workspace>.editor-undo-bar>span{min-width:0;overflow-wrap:anywhere}
#book-studio .studio-workspace>.editor-undo-bar button{flex:0 0 auto;min-height:44px;padding:4px 8px;font-size:12px}
#book-studio #studio-error{position:static;inset:auto;flex:0 0 auto;pointer-events:auto}
#book-studio .studio-header .studio-header-actions>button:is(#studio-undo,#studio-redo):not([data-icon-ready]){font-size:22px!important}
#book-studio #studio-close-tray:not([data-icon-ready]){font-size:22px!important}

/* Header actions share the row with the title, not the full viewport width. */
body[data-screen=book]:not(.studio-open)>.top .actions{width:auto;min-width:0;flex:0 1 auto}
body[data-screen=book]:not(.studio-open)>.top h1{flex:0 0 auto}

@media(max-width:380px){body[data-screen=book]:not(.studio-open)>.top{flex-wrap:wrap}body[data-screen=book]:not(.studio-open)>.top .actions{max-width:100%;flex-wrap:wrap}}

/* Confirmed edit-copy preservation status, visible in cover and spread views. */
#book-studio #studio-error:has([data-studio-message].studio-success){border-color:#b6cbb9;background:#f0f6ee;color:#365c43}

/* Keep the portrait page usable while tool controls scroll in their own drawer. */
#book-studio[data-mode=spread][data-focus=page] #lay-stage{margin-inline:auto}
@media(max-width:799px) and (orientation:portrait){
 #book-studio.tray-open:not(.studio-keyboard):not(.book-settings-open){grid-template-rows:58px minmax(0,3fr) minmax(72px,1fr) 56px auto}
 #book-studio.tray-open:not(.studio-keyboard):not(.book-settings-open) #studio-tray{height:100%;min-height:0;max-height:none;box-sizing:border-box;overflow:auto}
 #book-studio.tray-open:not(.studio-keyboard):not(.book-settings-open) .studio-workspace{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;overflow-anchor:none;justify-content:flex-start}
 #book-studio.tray-open:not(.studio-keyboard):not(.book-settings-open) #studio-stage{flex:1 0 min(240px,32dvh);min-height:min(240px,32dvh)}
}

/* Imported instructions are reachable by target, independently of missing image files. */
#book-studio .input-package-prompts{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px;min-width:0;padding:4px 6px;background:#fff5d8;color:#6b541b;border:1px solid #dfc987;border-radius:8px;font-size:12px;line-height:1.4}
#book-studio .input-package-prompts[hidden]{display:none}
#book-studio .input-package-prompts .btn{width:auto;min-height:44px;margin:0;padding:6px 10px;font-size:12px}
#book-studio #studio-controls #studio-image-prompt{width:100%;min-height:44px;font-size:13px;margin:4px 0 10px}
html body dialog.imported-prompt-dialog{box-sizing:border-box;direction:rtl;width:min(720px,calc(100vw - 20px));max-height:calc(100dvh - 24px);overflow:auto;border:1px solid #b7c9c0;border-radius:14px;padding:14px;background:#fffdf7;color:#293d32}
.imported-prompt-dialog::backdrop{background:#15291b99}
.imported-prompt-dialog header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.imported-prompt-dialog h2{font-size:18px;margin:0}
.imported-prompt-dialog label{display:block;font-size:13px;margin:10px 0}
.imported-prompt-dialog select{box-sizing:border-box;width:100%;min-height:44px;font:inherit;margin-top:6px}
.imported-prompt-dialog textarea{box-sizing:border-box;width:100%;min-height:220px;max-height:45dvh;resize:vertical;font:14px/1.6 system-ui,sans-serif;padding:48px 12px 12px;margin-top:6px;background:#fff}
.imported-prompt-dialog .btn{min-height:44px;margin:4px 0;font-size:13px}
.imported-prompt-dialog #imported-prompts-copy-all{width:100%;white-space:normal}

/* Approved compact page controls. The original controllers live in an options dialog. */
#book-studio .studio-legacy{display:none}
#book-studio .studio-compact-bar{padding:8px;display:grid;gap:6px;min-width:0;background:#fff;color:#294237}
#book-studio .studio-compact-row,#book-studio .studio-compact-image-row{display:grid;grid-template-columns:minmax(0,1fr) 132px 44px;gap:5px;align-items:center;min-width:0}
#book-studio .studio-compact-bar[data-compact=image]>.studio-compact-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px}
#book-studio .studio-compact-bar select{min-width:0;width:100%;height:44px;min-height:44px;margin:0;padding:0 7px;border:1px solid #c4d2c9;border-radius:7px;background:#fff;font-size:13px;color:inherit}
#book-studio .studio-compact-stepper{display:grid;grid-template-columns:44px 44px 44px;height:44px;border-radius:7px;overflow:hidden;box-shadow:inset 0 0 0 1px #ccd5cf}
#book-studio #studio-controls .studio-compact-bar button{min-height:44px;height:44px;min-width:44px;margin:0;border:1px solid transparent;border-radius:6px;padding:3px;color:inherit;font-size:13px;line-height:1.1;background:#fff}
#book-studio #studio-controls .studio-compact-stepper button{width:44px;max-width:44px;font-size:19px;background:#f4f6f3;border-radius:0;padding:0}
#book-studio .studio-compact-stepper output{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:12px;border-inline:1px solid #dde3dd;line-height:15px}
#book-studio .studio-compact-stepper output small{font-size:10px;line-height:12px;color:#5c6f61}
#book-studio .studio-compact-stepper output span{direction:ltr}
#book-studio .studio-compact-actions{display:flex;align-items:center;justify-content:space-between;gap:2px}
#book-studio #studio-controls .studio-compact-actions button{display:flex;width:auto;flex:0 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding-inline:4px;font-size:20px}
#book-studio .studio-compact-action small{font:11px/13px system-ui,sans-serif;white-space:nowrap}
#book-studio .studio-compact-action>span{display:block;min-height:22px;line-height:23px;font-family:Arial,sans-serif;position:relative}
#book-studio .compact-color-a{font-weight:700;width:25px;color:var(--compact-text-color)}
#book-studio .compact-color-a:after{content:'';position:absolute;bottom:0;inset-inline:0;height:3px;border-radius:2px;background:var(--compact-text-color)}
#book-studio .compact-outline-a{color:transparent;-webkit-text-stroke:1.2px var(--compact-outline-color);width:25px}
#book-studio .compact-no-outline .compact-outline-a:after{content:'∅';position:absolute;inset-inline-end:-4px;top:-4px;font:10px/12px sans-serif;color:#54665a;-webkit-text-stroke:0;background:#fff;border-radius:3px}
#book-studio .compact-background-a{width:26px;border:1px solid #cdd4cc;border-radius:3px;background-color:var(--compact-background-color)}
#book-studio .compact-no-background .compact-background-a{background-image:linear-gradient(45deg,#e0e6df 25%,transparent 25%),linear-gradient(-45deg,#e0e6df 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e0e6df 75%),linear-gradient(-45deg,transparent 75%,#e0e6df 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0}
#book-studio .compact-lines{font-size:30px;font-weight:400}
#book-studio .compact-pencil{font-size:25px}
#book-studio .compact-more{font-size:19px;letter-spacing:1px}
#book-studio #studio-controls .studio-compact-pick{display:flex;align-items:center;justify-content:center;gap:4px;background:#f2e6c3;border-color:#d6c590;font-size:13px}
#book-studio .studio-compact-pick>span:first-child{font-size:21px}
#book-studio .studio-compact-prompt-slot{display:block;min-width:0}
#book-studio #studio-controls .studio-compact-prompt-slot #studio-image-prompt{width:100%;min-height:44px;height:44px;margin:0;padding:3px 4px;border:1px solid #bfcfc3;background:#f6faf5;font-size:12px;line-height:1.25}
#book-studio .studio-compact-scope{font-size:12px;line-height:18px;padding:2px 4px;color:#5a675c}
#book-studio .studio-compact-scope:empty{display:none}
#book-studio.compact-tools-active #studio-tray{position:relative;background:white;padding:0;overflow:visible}
#book-studio.compact-tools-active #studio-tray .studio-tray-head{position:absolute;top:8px;inset-inline-end:8px;z-index:2;margin:0;padding:0;width:44px;height:44px;min-height:44px;border:0;background:transparent}
#book-studio.compact-tools-active #studio-context{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
#book-studio.compact-tools-active #studio-close-tray{width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;font-size:25px;background:#f4f6f3;border:1px solid #cbd4cd;border-radius:7px}
#book-studio.compact-tools-active #studio-controls{padding:0;overflow:visible}
#book-studio .studio-header-actions #studio-undo{transform:scaleX(-1)}
#book-studio .studio-header-actions #studio-redo{transform:scaleX(-1)}
@media(max-width:799px) and (orientation:portrait){
 #book-studio.compact-tools-active.tray-open:not(.studio-keyboard):not(.book-settings-open){grid-template-rows:58px minmax(0,1fr) auto 56px auto}
 #book-studio.compact-tools-active #studio-tray{height:auto;max-height:none;min-height:112px}
 #book-studio.compact-tools-active #studio-controls>.studio-panel-group{margin:0;padding:0;border:0}
}
@media(min-width:800px),(orientation:landscape){
 #book-studio .studio-compact-row{grid-template-columns:minmax(0,1fr) 44px}
 #book-studio .studio-compact-bar[data-compact=text] .studio-compact-row>select{grid-column:1/-1;padding-inline-end:48px}
 #book-studio .studio-compact-bar[data-compact=text] .studio-compact-stepper{grid-column:1/-1;justify-self:center}
 #book-studio .studio-compact-bar[data-compact=text] .studio-compact-row>span:last-child{display:none}
 #book-studio .studio-compact-actions{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:4px}
 #book-studio .studio-compact-bar[data-compact=image]>.studio-compact-row{grid-template-columns:minmax(0,1fr);padding-top:48px}
 #book-studio .studio-compact-bar[data-compact=image]>.studio-compact-row>span:last-child{display:none}
 #book-studio .studio-compact-image-row{grid-template-columns:minmax(0,1fr) 44px}
 #book-studio .studio-compact-image-row>select{grid-column:1/-1}
 #book-studio .studio-compact-image-row>.studio-compact-stepper{grid-column:1/-1;justify-self:center}
}
html body dialog.studio-tool-options[open]{position:fixed;inset:12px 0;margin:auto;box-sizing:border-box;width:min(620px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:auto;max-height:calc(100dvh - 24px);padding:14px;background:#fffdf8;color:#294237;border:1px solid #b9cbbd;border-radius:14px;overflow:auto;direction:rtl}
.studio-tool-options::backdrop{background:#15291b99}
#studio-tool-options>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
#studio-tool-options h2{font-size:18px;line-height:1.4;margin:0}
#studio-tool-options header button{min-width:44px;min-height:44px;border:1px solid #ccd4c9;border-radius:7px;background:#f0eadb;font-size:24px}
#book-studio #studio-tool-options .studio-legacy{display:block}
#studio-tool-options .studio-legacy input:not([type=checkbox]),#studio-tool-options .studio-legacy select,#studio-tool-options .studio-legacy button{min-height:44px;max-width:100%;box-sizing:border-box}
#studio-tool-options .studio-legacy input[type=color]{width:64px;min-width:44px;padding:3px}
#studio-tool-options .studio-legacy input[type=checkbox]{width:24px;height:24px;margin:10px}
#studio-tool-options .studio-legacy label{display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-height:44px;margin:8px 0;font-size:14px}
#studio-tool-options textarea{box-sizing:border-box;width:100%;min-height:180px;font:16px/1.6 system-ui,sans-serif}
#studio-tool-options .studio-legacy .row{gap:12px;flex-wrap:wrap}
#studio-tool-options:not([data-kind=more]):not([data-kind=image]) .studio-legacy>*{display:none!important}
#studio-tool-options[data-kind=color] #lay-style-tools,#studio-tool-options[data-kind=outline] #lay-style-tools,#studio-tool-options[data-kind=background] #lay-background-tools,#studio-tool-options[data-kind=align] #lay-tools,#studio-tool-options[data-kind=edit] #studio-story-editor{display:block!important}
#studio-tool-options[data-kind=color] #lay-style-tools>*,#studio-tool-options[data-kind=outline] #lay-style-tools>*{display:none!important}
#studio-tool-options[data-kind=color] #lay-style-tools>.row,#studio-tool-options[data-kind=outline] #lay-style-tools>.row{display:flex!important}
#studio-tool-options[data-kind=color] #lay-style-tools>.row>*,#studio-tool-options[data-kind=outline] #lay-style-tools>.row>*{display:none!important}
#studio-tool-options[data-kind=color] #lay-style-tools>.row>label:has(input[aria-label="צבע הטקסט"]),#studio-tool-options[data-kind=outline] #lay-style-tools>.row>label:has(input[aria-label="צבע קו מתאר"]),#studio-tool-options[data-kind=outline] #lay-style-tools>.row>select[aria-label="עובי קו מתאר"]{display:flex!important}
#studio-tool-options[data-kind=align] #lay-tools>*{display:none!important}
#studio-tool-options[data-kind=align] #lay-tools>.lay-align{display:flex!important;gap:10px}
#studio-tool-options[data-kind=background] #lay-background-tools>h3{display:none}
#studio-tool-options .studio-story-note{font-size:13px;line-height:1.5}
#book-studio #studio-controls .studio-compact-action[data-book-action]::before{display:none}
#studio-tool-options .studio-legacy summary{min-height:44px;padding-block:10px;box-sizing:border-box}
#book-studio #studio-controls .studio-compact-bar select{font-size:14px}

html body dialog.studio-tool-options[open]{inset:0;margin:auto;height:fit-content}
#book-studio #studio-tool-options #lay-background-tools{display:block;padding:12px}
#book-studio #studio-tool-options #lay-background-tools label{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:9px;margin:8px 0;min-height:44px}
#book-studio #studio-tool-options #lay-background-tools input[type=range]{flex:1;min-width:60px;width:auto}
#book-studio #studio-save-copy::before{display:none!important}
#book-studio #studio-save-copy svg{display:block;width:28px;height:28px;color:var(--book-action-ink)}
@media(min-width:800px){#book-studio #studio-controls .studio-compact-bar #studio-font-family{grid-column:1;padding-inline-end:7px}}
/* Side-docked screens need three grid rows, not the five-row portrait-phone stack. */
@media(min-width:800px),(orientation:landscape){#book-studio:not(.studio-keyboard):not(.book-settings-open){grid-template-rows:58px minmax(0,1fr) auto}}
@media(orientation:landscape) and (max-height:500px){
 #book-studio:not(.studio-keyboard):not(.book-settings-open) #studio-footer{flex-direction:row;align-items:flex-start}
 #book-studio #studio-footer #studio-book-nav,#book-studio #studio-footer #studio-page-audio{flex:1;width:auto;min-width:0}
 #book-studio:not(.studio-keyboard):not(.book-settings-open) .studio-workspace{overflow-y:auto;justify-content:flex-start;overscroll-behavior:contain}
 #book-studio:not(.studio-keyboard):not(.book-settings-open) #studio-stage{flex:1 0 200px;min-height:200px}
}
/* Alignment is a choice, so its current state stays visible in focused and More views. */
#book-studio #studio-tool-options .lay-align .btn[aria-pressed="true"]{background:var(--book-action-primary,#f4dfa6)!important;color:var(--book-action-ink,#294237)!important;border:2px solid var(--book-action-ink,#294237);box-shadow:inset 0 0 0 1px #fff}
#book-studio #studio-tool-options .lay-align .btn[aria-pressed="false"]{background:#fff;color:#294237;border:1px solid #c4d2c9}

html body .reference-package-dialog #reference-prompt-tools .btn{background:#eee8d8;border:1px solid #d9d6c8;color:#293d32}

/* Compact cover and special-page tools, with the original controllers kept intact. */
#book-studio.studio-secondary-compact[data-tool=text] #studio-controls>:not(.studio-secondary-bar),
#book-studio.studio-secondary-compact[data-tool=image] #studio-controls>:not(.studio-secondary-bar){display:none!important}
#book-studio .studio-secondary-bar .studio-compact-scope{display:block;font-size:11px;line-height:1.3;text-align:center;margin:0}
#book-studio .studio-secondary-bar[data-compact=image]>.studio-compact-row{grid-template-columns:minmax(0,1fr) auto 44px}
#book-studio .studio-secondary-image-actions{display:flex;justify-content:flex-end;gap:6px}
#book-studio .studio-secondary-image-actions>button{flex:1;max-width:96px}
#book-studio .studio-secondary-image-actions small{display:block}
#book-studio .studio-secondary-bar output{font-size:12px;min-width:40px;text-align:center}
#book-studio #studio-secondary-options label{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:44px;margin:10px 0;font-size:14px}
#book-studio #studio-secondary-options input:not([type=checkbox]),#book-studio #studio-secondary-options select,#book-studio #studio-secondary-options textarea{min-height:44px;max-width:100%;box-sizing:border-box}
#book-studio #studio-secondary-options input[type=range]{width:100%;min-width:0}
#book-studio #studio-secondary-options input[type=color]{width:64px;padding:3px}
#book-studio #studio-secondary-options input[type=checkbox]{width:24px;height:24px;margin:10px}
#book-studio #studio-secondary-options textarea{width:100%;min-height:120px}
#book-studio #studio-secondary-options .studio-compact-action{min-height:44px}

#book-studio .studio-secondary-bar .studio-compact-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:2px}
#book-studio .studio-secondary-static{font-size:13px;text-align:center}
@media(min-width:800px) and (max-height:500px){
 #book-studio .studio-secondary-bar .studio-compact-actions{grid-template-columns:repeat(3,minmax(44px,1fr))}
 #book-studio .studio-secondary-bar[data-compact=image]>.studio-compact-row{grid-template-columns:minmax(0,1fr);padding-top:48px}
 #book-studio .studio-secondary-bar[data-compact=image]>.studio-compact-row>span:last-child{display:none}
}

#studio-secondary-options>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
#studio-secondary-options h2{font-size:18px;line-height:1.4;margin:0}
#studio-secondary-options header button{min-width:44px;min-height:44px;border:1px solid #ccd4c9;border-radius:7px;background:#f0eadb;font-size:24px}

/* Keep all editing tabs compact. Native fields remain the source of truth. */
#book-studio.studio-native-compact #studio-controls>:not(.studio-native-bar){display:none!important}
#book-studio .studio-native-bar{padding:8px 48px 8px 8px;box-sizing:border-box}
#book-studio .studio-native-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
#book-studio .studio-native-row>button{width:auto;min-height:44px;margin:0;padding:8px 12px;font-size:14px}
#book-studio .studio-native-row .studio-panel-field{display:flex;align-items:center;gap:6px;margin:0;font-size:12px;min-width:0}
#book-studio .studio-native-row input[type=color]{width:44px;min-width:44px;height:44px;padding:3px;box-sizing:border-box}
#book-studio .studio-native-bar .studio-compact-scope{font-size:11px;margin:6px 0 0;line-height:1.4}
html body #book-studio dialog:is(#studio-secondary-options,#studio-panel-options)[open]{padding:12px;min-height:0;height:fit-content;max-height:calc(100dvh - 24px);overflow:auto}
html body #book-studio dialog:is(#studio-secondary-options,#studio-panel-options)>header{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px;margin:0 0 10px;padding:0;min-height:44px;height:auto}
html body #book-studio dialog:is(#studio-secondary-options,#studio-panel-options)>header h2{font-size:17px;line-height:1.35;margin:0;padding:0}
html body #book-studio dialog:is(#studio-secondary-options,#studio-panel-options)>header button{display:grid;place-items:center;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;margin:0;position:static;font-size:24px;box-sizing:border-box;box-shadow:none}
html body #book-studio #studio-secondary-options .studio-tool-options-body,html body #book-studio #studio-panel-options .studio-tool-options-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px;margin:0;padding:0}
html body #book-studio #studio-secondary-options .studio-tool-options-body>label,html body #book-studio #studio-panel-options .studio-tool-options-body>label{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;grid-column:1/-1;margin:0;padding:4px 0;min-height:44px;font-size:13px}
html body #book-studio #studio-secondary-options input[type=range],html body #book-studio #studio-panel-options input[type=range]{grid-column:1/-1;min-height:32px;height:32px;margin:0;width:100%;min-width:0}
html body #book-studio #studio-panel-options select{width:100%;min-height:44px;grid-column:1/-1}
html body #book-studio #studio-panel-options output{font-size:12px;font-variant-numeric:tabular-nums;grid-column:2;grid-row:1}
html body #book-studio #studio-panel-options label:has(output)>span{grid-column:1;grid-row:1}
html body #book-studio #studio-panel-options input[type=number]{width:80px;min-height:44px}
html body #book-studio #studio-secondary-options .studio-tool-options-body>button,html body #book-studio #studio-panel-options .studio-tool-options-body>button{width:100%;margin:0;padding:10px 6px;min-height:44px;height:auto;font-size:13px;box-shadow:none}
#book-studio .studio-paste-slot{display:flex;justify-content:flex-start;margin-top:4px}
#book-studio .studio-paste-slot .clipboard-image-button{min-height:44px;padding:6px 10px;font-size:13px;margin:0}
#book-studio .studio-paste-slot .clipboard-image-status{font-size:12px;max-width:100%;line-height:1.4}
#book-studio [data-panel=remove] label{display:flex;align-items:center;gap:8px;margin:0;font-size:14px}
#book-studio [data-panel=remove] input[type=checkbox]{width:24px;height:24px;margin:8px}
#book-studio [data-panel=text] #named-credits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media(min-width:800px),(orientation:landscape){#book-studio .studio-native-bar{padding:48px 8px 8px}}

#book-studio .studio-native-row>button{flex:0 1 auto;width:auto!important;min-width:44px!important;max-width:100%;box-shadow:none}
#book-studio .studio-native-row .studio-panel-field{flex:0 1 auto}
#book-studio .studio-paste-slot .clipboard-image-status:not(:empty){display:block!important;margin:4px 0 0}

/* Formatting and text segments are separate tasks, never one expanding menu. */
#book-studio #studio-tool-options[data-kind=more] .studio-text-groups{display:none!important}
#book-studio #studio-tool-options[data-kind=more] #studio-legacy-text{grid-template-columns:minmax(0,1fr);gap:var(--books-ui-gap-small)}
#book-studio #studio-tool-options[data-kind=more] .studio-segments-open{order:15;width:100%;min-height:44px;padding:8px;margin:0}
#book-studio #studio-tool-options[data-kind=more] #lay-apply-text-all,#book-studio #studio-tool-options[data-kind=more] .studio-remove-local{min-height:44px;height:auto;padding:8px}
#book-studio #studio-tool-options[data-kind=blocks] .studio-text-groups{display:block!important;margin:0}
#book-studio #studio-tool-options[data-kind=blocks] .studio-text-groups>summary,#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools>h3{display:none}
#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools .row{gap:8px;margin:8px 0;align-items:center}
#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools textarea{min-height:140px;max-height:35dvh;resize:vertical}
#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools button{min-height:44px;flex:1;padding:8px;margin:0}
#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools select{min-height:44px;width:auto;flex:1}
#book-studio #studio-tool-options[data-kind=blocks] #lay-block-tools label{margin:0}
/* Recording is a primary tool tab; the footer only changes pages. */
#book-studio #studio-controls>.studio-recording-panel{padding:8px 48px 8px 8px;margin:0}
#book-studio .studio-recording-panel #studio-page-audio{display:flex;gap:8px;flex-wrap:wrap;width:100%;padding:0}
#book-studio .studio-recording-panel #studio-page-audio>.btn{height:auto;min-height:44px;flex:1;min-width:96px;padding:6px;font-size:13px}
#book-studio .studio-recording-panel .studio-recording-hint{width:100%;text-align:center;font-size:12px;line-height:1.4}
#book-studio #studio-rail>[data-tool=recording]>span{font-size:20px;color:#ae352c}
@media(min-width:800px),(orientation:landscape){#book-studio #studio-controls>.studio-recording-panel{padding:48px 8px 8px}}
#book-studio #studio-tool-options.studio-focused-text-v2[data-kind=more] #studio-legacy-text{grid-template-columns:minmax(0,1fr);gap:var(--books-ui-gap-small)}
#book-studio #studio-tool-options.studio-focused-text-v2[data-kind=more] #lay-apply-text-all,#book-studio #studio-tool-options.studio-focused-text-v2[data-kind=more] .studio-remove-local{min-height:44px;height:auto;padding:8px}
#book-studio #studio-tool-options.studio-focused-text-v2[data-kind=more] .studio-segments-open{min-height:44px;height:auto;font-size:14px}
#book-studio.studio-flat-image-active[data-tool=image] #studio-controls>:not(.studio-flat-image-bar){display:none!important}
#book-studio .studio-flat-image-bar{padding:8px 48px 8px 8px}
#book-studio .studio-flat-image-actions{display:flex;gap:6px;align-items:flex-start;flex-wrap:wrap}
#book-studio .studio-flat-image-actions>button,#book-studio .studio-flat-image-actions>.clipboard-image-control,#book-studio .studio-flat-image-actions>.studio-compact-prompt-slot{flex:1;min-width:64px}
#book-studio .studio-flat-image-actions button{width:100%;min-height:44px;margin:0;padding:6px;font-size:12px}
#book-studio .studio-flat-image-actions small{display:block}
#book-studio .studio-image-import-row{display:flex;gap:8px;align-items:flex-start;justify-content:flex-end;margin-top:4px}
#book-studio .studio-image-import-row>span,#book-studio .studio-image-import-row>.studio-paste-slot{flex:1;min-width:0;margin:0}
#book-studio .studio-image-import-row button{width:auto;min-height:44px;font-size:12px;margin:0;padding:6px 10px}
#book-studio .studio-flat-image-actions .clipboard-image-status:not(:empty){display:block!important;white-space:normal;font-size:12px}
@media(min-width:800px),(orientation:landscape){#book-studio .studio-flat-image-bar{padding:48px 8px 8px}}
#book-studio.compact-tools-active #studio-controls>.studio-recording-panel{padding:8px 8px 8px 48px}
#book-studio .studio-native-bar,#book-studio .studio-flat-image-bar{padding:8px 8px 8px 48px}
#book-studio .studio-flat-image-actions>button,#book-studio .studio-flat-image-actions>.clipboard-image-control,#book-studio .studio-flat-image-actions>.studio-compact-prompt-slot{min-width:44px}
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active #studio-controls>.studio-recording-panel,#book-studio .studio-native-bar,#book-studio .studio-flat-image-bar{padding:48px 8px 8px}}
#book-studio .studio-compact-scope:empty{display:none}
#book-studio .studio-native-bar[data-panel=layout] .studio-native-row{display:grid;grid-template-columns:minmax(0,1fr) 62px;align-items:stretch}
#book-studio .studio-layout-target{min-width:0;min-height:44px;width:100%;grid-column:1;grid-row:1}
#book-studio .studio-layout-actions{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
#book-studio .studio-layout-actions button{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:5px;padding:4px;font-size:18px}
#book-studio .studio-layout-actions small{font-size:12px;white-space:normal}
#book-studio .studio-native-bar[data-panel=layout] .studio-native-row>.studio-compact-action{grid-column:2;grid-row:1;min-width:44px;display:flex;flex-direction:column;align-items:center;justify-content:center}
#book-studio .studio-flat-image-actions small{font-size:13px}
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active #studio-controls>.studio-recording-panel,#book-studio .studio-native-bar,#book-studio .studio-flat-image-bar{padding-top:58px}}




/* Shared toolbar control tokens */





/* One neutral action surface. Selection, danger and disabled remain states, not new button families. */
#book-studio{--studio-toolbar-surface:var(--book-action-paper);--studio-toolbar-border:var(--book-action-outline);--studio-toolbar-radius:8px;--studio-toolbar-action-height:52px;--studio-toolbar-font:12px;--studio-toolbar-icon-size:20px}
#book-studio.compact-tools-active :is(#studio-controls button:not(dialog button),#studio-close-tray){box-sizing:border-box;min-height:44px;height:auto;min-width:44px;margin:0;border:1px solid var(--studio-toolbar-border);border-radius:var(--studio-toolbar-radius);background:var(--studio-toolbar-surface);color:var(--book-action-ink);box-shadow:none;font-family:inherit;font-size:var(--studio-toolbar-font);font-weight:600;line-height:1.3;text-align:center}
#book-studio.compact-tools-active #studio-controls :is(.studio-compact-bar,.studio-native-bar,.studio-recording-panel) button{min-height:var(--studio-toolbar-action-height);height:auto;align-self:stretch;padding:5px;display:flex;align-items:center;justify-content:center;gap:3px;white-space:normal}
#book-studio.compact-tools-active #studio-controls :is(.studio-compact-bar,.studio-native-bar) button{flex-direction:column}
#book-studio.compact-tools-active #studio-controls .studio-compact-stepper button{min-height:44px;height:44px;border-radius:var(--studio-toolbar-radius);padding:0;font-size:18px}
#book-studio.compact-tools-active #studio-controls .studio-compact-stepper{border-radius:var(--studio-toolbar-radius);overflow:visible;box-shadow:none}
#book-studio.compact-tools-active #studio-controls :is(.studio-compact-prompt-slot,.clipboard-image-control){display:flex;align-self:stretch;flex-direction:column;min-width:0}
#book-studio.compact-tools-active #studio-controls :is(.studio-compact-prompt-slot,.clipboard-image-control)>button{flex:1;width:100%;height:auto;min-height:var(--studio-toolbar-action-height);background:var(--studio-toolbar-surface);border:1px solid var(--studio-toolbar-border);font-size:var(--studio-toolbar-font);line-height:1.3;padding:5px}
#book-studio.compact-tools-active #studio-controls .studio-flat-image-actions{align-items:stretch}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions{gap:4px;align-items:stretch}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions>button{min-height:var(--studio-toolbar-action-height)}
#book-studio.compact-tools-active #studio-close-tray{width:44px;height:var(--studio-toolbar-action-height);min-height:var(--studio-toolbar-action-height);background:var(--studio-toolbar-surface);border:1px solid var(--studio-toolbar-border);border-radius:var(--studio-toolbar-radius)}
#book-studio.compact-tools-active #studio-controls button:not(dialog button) small{font:inherit;white-space:normal;line-height:1.3}
#book-studio.compact-tools-active #studio-controls .studio-recording-panel #studio-page-audio>.btn{min-height:var(--studio-toolbar-action-height);height:auto;background:var(--studio-toolbar-surface)}
#book-studio.compact-tools-active :is(#studio-controls,#studio-tray>.studio-tray-head,#studio-rail) button[data-toolbar-icon]::before{content:'';display:block;flex:0 0 var(--studio-toolbar-icon-size);width:var(--studio-toolbar-icon-size);height:var(--studio-toolbar-icon-size);min-height:0;margin:0;background:var(--studio-toolbar-icon) center/contain no-repeat;border-radius:0;transform:none}
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon]>span[aria-hidden=true]{display:none}
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon=more]{font-size:0}
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon=more] small{font-size:var(--studio-toolbar-font)}
#book-studio.compact-tools-active #studio-rail>button{border:1px solid var(--studio-toolbar-border);border-radius:var(--studio-toolbar-radius);box-shadow:none}
#book-studio.compact-tools-active #studio-controls button[aria-pressed=true],#book-studio.compact-tools-active #studio-rail>button[aria-pressed=true]{background:var(--book-action-primary);border-color:var(--book-action-ink)}
#book-studio.compact-tools-active :is(#studio-controls button:not(dialog button),#studio-close-tray):focus-visible{outline:2px solid var(--book-action-ink);outline-offset:2px}
#book-studio.compact-tools-active #studio-controls button:disabled{opacity:.45}
#book-studio.compact-tools-active #studio-close-tray{font-size:0!important;display:grid;place-items:center;padding:0}
#book-studio.compact-tools-active #studio-close-tray::before{width:var(--studio-toolbar-icon-size);height:var(--studio-toolbar-icon-size);margin:0}
#book-studio.compact-tools-active #studio-controls .studio-recording-panel #studio-page-audio>.btn{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:6px;direction:rtl;text-align:center}
#book-studio.compact-tools-active #studio-controls .studio-recording-panel .studio-recording-label{display:block;text-align:center;line-height:1.4;font-size:var(--studio-toolbar-font);min-width:0}
.studio-text-object{position:absolute;box-sizing:border-box!important;z-index:5;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-height:0!important;min-width:0!important;display:block!important;white-space:pre-wrap;overflow-wrap:normal;font-weight:600;cursor:text;direction:rtl}.studio-text-object:focus-visible{outline:2px solid #155e63}.studio-text-object-tools{display:flex;flex-wrap:wrap;gap:8px;padding-top:8px}.studio-text-object-tools select{max-width:100%;min-height:44px}.studio-text-object-dialog{box-sizing:border-box;width:min(94vw,480px);max-height:88dvh;overflow:auto;border:1px solid #bdcbc6;border-radius:12px;padding:16px;background:#fff;color:#243040;direction:rtl}.studio-text-object-dialog::backdrop{background:#142e3866}.studio-text-object-dialog h2{font-size:18px;margin:0 0 12px}.studio-text-object-dialog label{display:flex;flex-direction:column;gap:4px;margin:8px 0}.studio-text-object-dialog textarea{min-height:100px;width:100%;box-sizing:border-box}.studio-text-object-dialog button,.studio-text-object-dialog input,.studio-text-object-dialog select{min-height:44px}.studio-text-object-dialog .row{gap:8px;flex-wrap:wrap}
#book-studio:is(.studio-native-compact,.studio-secondary-compact,.studio-flat-image-active) #studio-controls>.studio-text-object-tools,#book-studio.studio-flat-image-active[data-tool=image] #studio-controls>.studio-flat-transforms{display:flex!important;flex-wrap:wrap;gap:6px;padding:8px;box-sizing:border-box}#book-studio #studio-controls>.studio-text-object-tools[hidden],#book-studio #studio-controls>.studio-flat-transforms[hidden]{display:none!important}.studio-flat-transforms>button{flex:1 0 42%;min-height:52px}
#book-studio .studio-text-object-hit{min-width:0!important;min-height:0!important;box-shadow:none!important;border:1px dashed #155e6340!important;background:transparent!important;border-radius:0!important;color:transparent!important}#book-studio .studio-text-object-hit::before,#book-studio .studio-text-object-hit::after{content:none!important;display:none!important}.studio-text-object-layer{z-index:6}
#book-studio.studio-secondary-compact[data-tool=text] #studio-controls>.studio-text-object-tools:not([hidden]),#book-studio.studio-native-compact[data-tool=text] #studio-controls>.studio-text-object-tools:not([hidden]){display:flex!important}#book-studio.studio-flat-image-active[data-tool=image] #studio-controls>.studio-flat-transforms:not([hidden]){display:flex!important}
.lleaf .lart{z-index:0}.lleaf .studio-text-object{z-index:1}.lleaf .ltext{z-index:2}
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon]>.compact-pencil,#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon=more]>.compact-more{display:none!important}.studio-text-object-dialog [role=status]:empty{display:none}.studio-text-object-dialog details{margin:8px 0}.studio-text-object-dialog summary{min-height:44px;padding:8px;box-sizing:border-box}
#book-studio.studio-secondary-compact[data-tool=text] #studio-controls>.studio-object-style-bar,#book-studio.studio-native-compact[data-tool=text] #studio-controls>.studio-object-style-bar{display:flex!important;flex-wrap:wrap;gap:6px;padding:8px 48px 8px 8px;box-sizing:border-box}#book-studio .studio-object-style-bar>select{flex:1 0 60%;min-width:0;max-width:100%;min-height:44px}#book-studio .studio-object-style-bar>button{flex:1 0 24%;font-size:12px;min-height:52px}#book-studio #studio-controls [data-object-hidden]{display:none!important}#book-studio.studio-secondary-compact[data-tool=text] #studio-controls>.studio-secondary-bar[data-object-hidden]{display:none!important}#book-studio .studio-object-style-bar button[data-toolbar-icon]::before{margin:0}
#book-studio[data-tool=text] #studio-controls.studio-custom-text-selected .studio-compact-bar[data-compact=text],#book-studio[data-tool=text] #studio-controls.studio-custom-text-selected>.studio-secondary-bar[data-panel=text]{display:none!important}#book-studio.compact-tools-active[data-tool=text] #studio-controls.studio-custom-text-selected>.studio-object-style-bar{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px 48px 8px 8px;gap:6px}#book-studio .studio-object-style-bar>select{grid-column:1/-1}#book-studio .studio-object-style-bar button{min-height:52px}
#book-studio.compact-tools-active #studio-close-tray{background-image:none!important;box-shadow:none!important}#book-studio.compact-tools-active #studio-close-tray::before{display:block!important;background:var(--studio-toolbar-icon) center/contain no-repeat!important;content:''!important;width:20px!important;height:20px!important}
#book-studio.compact-tools-active #studio-controls button#studio-image-prompt,#book-studio.compact-tools-active #studio-controls .clipboard-image-control>button{background:var(--studio-toolbar-surface)!important;border:1px solid var(--studio-toolbar-border)!important;border-radius:var(--studio-toolbar-radius)!important;box-shadow:none!important;color:var(--book-action-ink)!important;font-family:inherit!important;font-size:var(--studio-toolbar-font)!important;font-weight:600!important}
@media(min-width:800px) and (max-height:500px){#book-studio .studio-native-bar[data-panel=layout]{padding:48px 6px 6px}#book-studio .studio-native-bar[data-panel=layout] .studio-native-row{grid-template-columns:minmax(0,1fr) 48px;gap:4px}#book-studio .studio-native-bar[data-panel=layout] .studio-layout-actions{gap:3px}#book-studio .studio-native-bar[data-panel=layout] .studio-layout-actions button{min-height:44px;padding:3px;font-size:11px}#book-studio .studio-native-bar[data-panel=layout] .studio-layout-target{min-height:44px}#book-studio .studio-native-bar[data-panel=layout] .studio-native-row>.studio-compact-action{min-height:44px;padding:3px;font-size:11px}}
@media(min-width:800px) and (max-height:500px){#book-studio .studio-native-bar[data-panel=layout]{padding-top:42px;padding-bottom:2px}#book-studio .studio-native-bar[data-panel=layout] .studio-layout-actions small{font-size:11px;line-height:1.2}}
#book-studio.compact-tools-active #studio-close-tray:not([data-icon-ready]){font-size:22px!important}#book-studio.compact-tools-active #studio-close-tray:not([data-icon-ready])::before{display:none!important}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr))}#book-studio.compact-tools-active #studio-controls .studio-compact-actions>button{width:100%;min-width:0}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions{grid-auto-rows:1fr}
/* Keep every text control reachable in the app's shorter embedded viewport. */
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active.tray-open:not(.book-settings-open) #studio-tray{overflow-y:auto;overflow-x:hidden;min-height:0;max-height:100%}}

/* Reserve the overlaid close action; long field labels must stay outside it. */
#book-studio #studio-controls .studio-text-object-tools>select{width:100%;min-width:0;padding-inline-end:48px!important;box-sizing:border-box;text-overflow:ellipsis}
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active #studio-rail{min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain}}

/* Compact acquisition entry; labels stay in its accessible popup. */
#book-studio .studio-image-sources{max-width:min(94vw,460px);max-height:88dvh;overflow:auto;box-sizing:border-box}
#book-studio .studio-image-sources-body{display:grid;gap:10px;padding:8px}
#book-studio .studio-image-sources-body .studio-compact-prompt-slot:empty{display:none}
#book-studio .studio-image-sources-body :is(button,.studio-compact-prompt-slot,.studio-paste-slot,.clipboard-image-control){width:100%;box-sizing:border-box}
#book-studio .studio-image-sources-body button{min-height:48px;font-size:14px}
#book-studio .studio-image-sources-open{width:44px;min-width:44px;height:44px;min-height:44px!important;flex:0 0 44px}
#book-studio .studio-image-import-row:empty,#book-studio .studio-flat-image-actions:empty{display:none}
#book-studio .editor-undo-bar .editor-undo-action{font-size:0;min-width:44px;min-height:44px}
#book-studio .editor-undo-bar .editor-undo-action::before{content:'↶';font-size:24px}
#book-studio.compact-tools-active #studio-controls button.studio-image-sources-open{display:grid;place-items:center;width:44px!important;min-width:44px!important;max-width:44px;height:44px!important;min-height:44px!important;padding:6px;font-size:0;flex:0 0 44px}
#book-studio .studio-image-sources>header{display:flex;align-items:center;justify-content:space-between;gap:8px}
#book-studio .studio-image-sources>header h2{font-size:17px;margin:0}
#book-studio .studio-image-sources>header button{width:44px;min-width:44px;max-width:44px;min-height:44px;font-size:22px;flex:0 0 44px}
#book-studio .studio-image-sources-body .studio-compact-pick{background:var(--studio-toolbar-surface);border:1px solid var(--studio-toolbar-border);border-radius:var(--studio-toolbar-radius);box-shadow:none;color:var(--book-action-ink)}

#book-studio.compact-tools-active #studio-controls .studio-image-sources .studio-compact-pick{display:flex!important;align-items:center;justify-content:center;gap:8px;width:100%;max-width:none;background:var(--studio-toolbar-surface)!important;border:1px solid var(--studio-toolbar-border)!important;border-radius:var(--studio-toolbar-radius)!important;box-shadow:none!important;color:var(--book-action-ink)!important;min-height:48px}

/* Toolbar actions are icons. Dialog commands keep their visible labels. */
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon]:not(dialog button){font-size:0!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;padding:6px!important;flex:0 0 44px!important;display:flex!important;align-items:center;justify-content:center}
#book-studio.compact-tools-active #studio-controls button[data-toolbar-icon]:not(dialog button)>:not(svg){display:none!important}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions{display:flex;flex-wrap:wrap;gap:6px}
#book-studio.compact-tools-active #studio-controls.studio-custom-text-selected>.studio-object-style-bar{display:flex!important;flex-wrap:wrap}
#book-studio #studio-controls>.studio-text-object-tools>button{flex:0 0 44px}
#book-studio.compact-tools-active #studio-controls .studio-image-sources button{font-size:14px!important}

#book-studio.compact-tools-active #studio-controls .studio-compact-actions{grid-template-columns:none;grid-auto-rows:auto}
#book-studio.compact-tools-active #studio-controls .studio-compact-actions>button:not([data-toolbar-icon]){width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px}
#book-studio .editor-undo-bar button.editor-undo-action{font-size:0!important;width:44px;min-width:44px;max-width:44px;height:44px;padding:6px;display:grid;place-items:center}
#book-studio .editor-undo-bar button.editor-undo-action::before{font-size:24px;line-height:1}

#book-studio.compact-tools-active #studio-controls>.studio-flat-transforms:not([hidden]){display:flex!important;flex-wrap:wrap;gap:6px}

/* Empty semantic panels have one full-width sentence, never a narrow grid column. */
#book-studio .studio-native-bar .studio-native-row>span{grid-column:1/-1;min-width:0;width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:normal}
#book-studio .studio-native-bar .studio-native-row>span:only-child{font-size:14px;line-height:1.5;text-align:start}
/* Flat-image controls share one wrapping toolbar, not stacked source rows. */
#book-studio.studio-flat-image-active #studio-controls{display:flex!important;flex-wrap:wrap;align-content:flex-start;align-items:center;gap:6px;padding:8px 8px 8px 58px;box-sizing:border-box}
#book-studio.studio-flat-image-active #studio-controls>.studio-flat-image-bar,#book-studio.studio-flat-image-active #studio-controls>.studio-flat-transforms:not([hidden]),#book-studio.studio-flat-image-active .studio-flat-image-actions{display:contents!important;padding:0!important}
#book-studio.studio-flat-image-active .studio-flat-image-bar>.studio-image-sources:not([open]){display:none!important}
#book-studio .studio-image-sources .studio-compact-pick::before{content:'';display:block;width:24px;height:24px;background:var(--studio-toolbar-icon) center/contain no-repeat;flex:0 0 24px}
#book-studio .studio-image-sources .studio-compact-pick>span[aria-hidden=true]{display:none!important}
#book-studio.studio-flat-image-active #studio-controls{display:grid!important;grid-template-columns:repeat(auto-fit,44px);justify-content:start;grid-auto-flow:row;gap:6px}
#book-studio.studio-flat-image-active #studio-controls>.studio-flat-image-bar .studio-flat-image-actions{display:contents!important}
#book-studio .studio-image-sources .studio-compact-pick::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23293f42' stroke-width='1.8'%3E%3Cpath d='M3 4h18v16H3z M5 17l5-6 4 4 3-3 4 5 M8 8h.01'/%3E%3C/svg%3E")!important}
#book-studio.compact-tools-active.studio-flat-image-active #studio-controls>.studio-flat-transforms:not([hidden]){display:contents!important}

/* One page toolbar, independent of cover/story/matter kind. */
#book-studio #studio-rail{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}
#book-studio #studio-rail>button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;font-size:0;flex:0 0 44px}
#book-studio #studio-rail>button::before{content:'';display:block;width:24px;height:24px;margin:auto;background-image:var(--studio-toolbar-icon);background-size:contain;background-repeat:no-repeat}
#book-studio #studio-rail>button>span{display:none}

#book-studio .studio-shared-text-tools{display:flex;gap:6px;align-items:center;margin:0!important;padding:0!important}
#book-studio .studio-shared-text-tools select{width:100%;min-height:44px;min-width:0}
#book-studio .studio-shared-style-bar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0!important;padding:6px 0 0!important}
#book-studio .studio-shared-style-bar>select{width:120px;min-height:44px;min-width:0}
#book-studio .studio-shared-style-bar>output{min-width:28px;text-align:center;font-size:14px}
#book-studio .studio-shared-style-bar>button{width:44px;min-width:44px;height:44px;min-height:44px!important;padding:0;font-size:0;flex:0 0 44px}
#book-studio .studio-shared-text-active> :not(.studio-shared-text-tools):not(.studio-shared-style-bar){display:none!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-text-tools{display:flex!important;width:100%!important;max-width:none!important;flex:0 0 100%!important;grid-column:1/-1!important;padding:0!important;gap:4px!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-style-bar{display:flex!important;width:100%!important;max-width:none!important;flex:0 0 100%!important;grid-column:1/-1!important;justify-content:flex-start!important;align-content:flex-start!important;gap:4px!important;padding:4px 0 0!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-style-bar>select{width:118px!important;min-width:100px!important;flex:0 0 118px!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-style-bar>button{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;flex:0 0 44px!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-style-bar>output{width:26px!important;min-width:26px!important;flex:0 0 26px!important}
#book-studio.compact-tools-active[data-tool=text] #studio-controls.studio-custom-text-selected.studio-shared-text-active>.studio-object-style-bar.studio-shared-style-bar{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:4px!important;padding:4px 0 0!important;width:100%!important}
#book-studio.compact-tools-active[data-tool=text] #studio-controls.studio-custom-text-selected.studio-shared-text-active{display:flex!important;flex-wrap:wrap!important;padding:8px 8px 8px 56px!important;gap:0!important}
#book-studio.compact-tools-active[data-tool=text] #studio-controls.studio-custom-text-selected.studio-shared-text-active>.studio-object-style-bar.studio-shared-style-bar>select{grid-column:auto!important;flex:0 0 118px!important;width:118px!important}
#book-studio #studio-controls.studio-shared-text-active>.studio-shared-style-bar>[hidden]{display:none!important}
#book-studio #studio-controls>.studio-shared-image-tools{display:flex!important;flex-wrap:wrap;gap:4px;grid-column:1/-1;width:100%;box-sizing:border-box;padding:4px 0}
#book-studio .studio-shared-image-tools>select{width:100%;min-height:44px}
#book-studio #studio-controls.studio-shared-image-selected>:not(.studio-shared-image-tools){display:none!important}
#book-studio .studio-shared-image-tools>[hidden]{display:none!important}
#book-studio .studio-shared-image-tools>button{width:44px;min-width:44px;height:44px;min-height:44px}
#book-studio .studio-shared-image-tools::before{content:none!important}
#book-studio.compact-tools-active[data-tool=image] #studio-controls>.studio-shared-image-tools{display:flex!important;flex-wrap:wrap!important;grid-column:1/-1!important;flex:0 0 100%!important;width:100%!important;max-width:none!important;padding:4px 0!important}
/* Shared image-object surface reserves the close control in every page adapter. */
#book-studio.compact-tools-active[data-tool=image] #studio-controls:has(>.studio-shared-image-tools){padding:8px 8px 8px 56px!important;display:flex!important;flex-wrap:wrap!important;gap:0!important}
#book-studio.compact-tools-active[data-tool=image] #studio-controls>.studio-shared-image-tools{gap:4px!important;align-content:flex-start!important;justify-content:flex-start!important}
#book-studio.compact-tools-active[data-tool=image] #studio-controls>.studio-shared-image-tools>select{flex:0 0 100%;width:100%!important;min-width:0!important;padding-inline-end:12px!important}
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active[data-tool=image] #studio-controls:has(>.studio-shared-image-tools){padding:8px!important}#book-studio.compact-tools-active[data-tool=image] #studio-controls>.studio-shared-image-tools{padding-top:44px!important}}
#book-studio .studio-common-image-more{width:min(94vw,460px);max-height:86dvh;overflow:auto;box-sizing:border-box}
#book-studio .studio-common-image-more>h2{font-size:18px;padding-inline-end:48px}
#book-studio .studio-common-image-more>button{box-shadow:none!important;position:absolute;top:8px;left:8px;width:44px;height:44px;min-height:44px;font-size:24px}
#book-studio .studio-common-image-more button{box-shadow:none!important}
#book-studio .studio-common-image-more [hidden]{display:none!important}
#book-studio.compact-tools-active[data-tool=layout] #studio-controls.studio-shared-layout-active{display:flex!important;flex-wrap:wrap;padding:8px 8px 8px 56px!important}
#book-studio.compact-tools-active[data-tool=layout] #studio-controls.studio-shared-layout-active>:not(.studio-shared-layout-tools){display:none!important}
#book-studio.compact-tools-active[data-tool=layout] #studio-controls>.studio-shared-layout-tools{display:flex!important;flex-wrap:wrap!important;gap:4px;width:100%;box-sizing:border-box}
#book-studio .studio-shared-layout-tools>select{width:100%;min-height:44px;min-width:0}
#book-studio .studio-common-layout-actions{display:flex;flex-wrap:wrap;gap:4px}
#book-studio .studio-common-layout-actions>button{width:44px;min-width:44px;height:44px;min-height:44px}
@media(min-width:800px),(orientation:landscape){#book-studio.compact-tools-active[data-tool=layout] #studio-controls.studio-shared-layout-active{padding:52px 8px 8px!important}}
#book-studio.compact-tools-active[data-tool=image] #studio-controls.studio-shared-image-selected>:not(.studio-shared-image-tools){display:none!important}
#book-studio [data-shared-object-surface] #studio-image-prompt,#book-studio .studio-shared-image-tools>#studio-image-prompt{display:none!important}
#book-studio.compact-tools-active[data-tool=image] #studio-controls>.studio-shared-image-tools{align-items:flex-start!important}

.studio-shared-background-active>[data-panel=background]:not(.studio-shared-background-tools){display:none!important}
.studio-shared-background-tools label{display:flex;align-items:center;gap:12px}.studio-shared-background-tools input{min-width:44px;min-height:44px}
#book-studio[data-tool=background] #studio-controls>.studio-shared-background-tools{display:flex!important;gap:8px;align-items:center;min-height:52px}
#book-studio #studio-controls>.studio-shared-background-tools label{display:flex!important;gap:8px;align-items:center}

/* Reconciled shared controls: one selector and two six-action rows. */
#book-studio#book-studio [data-book-action="zoomIn"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%226%22%2F%3E%3Cpath%20d%3D%22m15%2015%206%206M7%2010h6M10%207v6%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="zoomOut"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%226%22%2F%3E%3Cpath%20d%3D%22m15%2015%206%206M7%2010h6%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="geometry"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%223%22%20width%3D%2220%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Ctext%20x%3D%224%22%20y%3D%2215%22%20stroke%3D%22none%22%20fill%3D%22%23293f42%22%20font-size%3D%227%22%3Ex%2Cy%20%25%3C%2Ftext%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="rotateLeft"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%205%202%209l4%204M2%209h11a7%207%200%200%201%207%207%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2221%22%20stroke%3D%22none%22%20fill%3D%22%23293f42%22%20font-size%3D%228%22%3E90%C2%B0%3C%2Ftext%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="rotateRight"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m18%205%204%204-4%204M22%209H11a7%207%200%200%200-7%207%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2221%22%20stroke%3D%22none%22%20fill%3D%22%23293f42%22%20font-size%3D%228%22%3E90%C2%B0%3C%2Ftext%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="reset"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%203%202%207l4%204M2%207h10a9%209%200%201%201-7%2015%22%2F%3E%3Ctext%20x%3D%226%22%20y%3D%2217%22%20stroke%3D%22none%22%20fill%3D%22%23293f42%22%20font-size%3D%228%22%3E1%3A1%3C%2Ftext%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="target"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%227%22%2F%3E%3Cpath%20d%3D%22M12%201v7M12%2016v7M1%2012h7M16%2012h7%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-left"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%202v20M7%206h14M7%2012h9M7%2018h14%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-right"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%202v20M3%206h14M8%2012h9M3%2018h14%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-center-x"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%202v20M3%206h18M6%2012h12M3%2018h18%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-top"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2%203h20M6%207v14M12%207v9M18%207v14%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-bottom"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2%2021h20M6%203v14M12%208v9M18%203v14%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio [data-book-action="align-center-y"]::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23293f42%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2%2012h20M6%203v18M12%206v12M18%203v18%22%2F%3E%3C%2Fsvg%3E")!important}
#book-studio#book-studio[data-tool=image] #studio-controls:has(>.studio-shared-image-tools){padding:8px!important;position:relative}
#book-studio#book-studio[data-tool=image] #studio-controls>.studio-shared-image-tools{position:relative;display:grid!important;grid-template-columns:repeat(6,44px)!important;grid-auto-rows:44px;gap:4px!important;justify-content:end!important;padding:0!important;padding-top:0!important}
#book-studio#book-studio[data-tool=image] #studio-controls>.studio-shared-image-tools>select{grid-column:1/-1;grid-row:1;width:calc(100% - 96px)!important;min-width:0!important;margin:0 48px!important;flex:none!important}
#book-studio#book-studio .studio-shared-image-tools>button{font-size:0!important;padding:0!important}
#book-studio#book-studio .studio-shared-image-tools>button::before{margin:0!important;width:25px;height:25px}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=more]{position:absolute;top:0;right:0}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=image]{grid-column:1;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=fit]{grid-column:2;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=fill]{grid-column:3;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=zoomOut]{grid-column:4;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=zoomIn]{grid-column:5;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=geometry]{grid-column:6;grid-row:2}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=rotateLeft]{grid-column:1;grid-row:3}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=rotateRight]{grid-column:2;grid-row:3}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=target]{grid-column:3;grid-row:3}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=lock] ,#book-studio#book-studio .studio-shared-image-tools>[data-book-action=unlock]{grid-column:4;grid-row:3}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=reset]{grid-column:5;grid-row:3}
#book-studio#book-studio .studio-shared-image-tools>[data-book-action=delete]{grid-column:6;grid-row:3}
#book-studio#book-studio #studio-close-tray{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
#book-studio#book-studio #studio-rail>button[aria-pressed=true]{background:var(--book-action-primary)!important;border:2px solid var(--book-action-ink)!important}
#book-studio#book-studio .studio-shared-text-tools{min-width:0!important}
#book-studio#book-studio .studio-shared-text-tools>select{min-width:0!important;max-width:none!important;flex:1 1 0!important}
#book-studio#book-studio .studio-text-object-dialog{font-size:16px}
#book-studio#book-studio .studio-text-object-dialog button,#book-studio#book-studio .studio-tool-options button{min-height:44px;min-width:44px}
#book-studio#book-studio .studio-header #studio-title{min-width:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}

@media(min-width:800px){#book-studio#book-studio.tray-open{grid-template-columns:minmax(0,1fr) 310px 60px!important}#book-studio#book-studio #studio-tray{width:auto!important;min-width:0!important}}

#book-studio#book-studio .studio-common-layout-actions{display:grid!important;grid-template-columns:repeat(3,44px);gap:4px!important}
#book-studio#book-studio .studio-common-layout-actions>button{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;font-size:0!important;padding:0!important}
#book-studio#book-studio .studio-common-layout-actions>button::before{margin:0!important}
#book-studio#book-studio[data-tool=pages] #studio-controls>.studio-page-reorder>p,#book-studio#book-studio[data-tool=layout] #studio-controls>.studio-shared-layout-tools>p{display:none}

#book-studio#book-studio[data-tool=remove] #studio-controls>[data-panel=remove]{display:flex;gap:4px;flex-wrap:wrap}
#book-studio#book-studio[data-tool=remove] #studio-controls>[data-panel=remove]>button,#book-studio#book-studio #studio-reorder-page,#book-studio#book-studio .studio-page-actions>button{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;font-size:0!important;padding:0!important}
#book-studio#book-studio[data-tool=remove] #studio-controls>[data-panel=remove]>button::before,#book-studio#book-studio #studio-reorder-page::before,#book-studio#book-studio .studio-page-actions>button::before{margin:0!important}
#book-studio#book-studio .studio-page-action-hint{display:none}
#book-studio#book-studio[data-tool=remove] #studio-close-tray,#book-studio#book-studio[data-tool=pages] #studio-close-tray{font-size:0!important}
#book-studio#book-studio[data-tool=remove] #studio-close-tray::before,#book-studio#book-studio[data-tool=pages] #studio-close-tray::before{background:var(--studio-toolbar-icon) center/20px no-repeat!important;display:block!important;content:''!important}
#book-studio#book-studio [data-book-action=reorder]::before{background-image:url("action-icons/action_refresh.png")}

#book-studio#book-studio #studio-reorder-page::before{content:'↕';display:block;width:28px;height:28px;font-size:26px;line-height:28px;background:none!important}
#book-studio#book-studio [data-book-action=removeText]::before{content:'T×';display:block;width:28px;height:28px;font:20px/28px sans-serif;background:none!important}
#book-studio#book-studio [data-book-action=removeImage]::before{content:'▧×';display:block;width:28px;height:28px;font:20px/28px sans-serif;background:none!important}

/* Recording panel: keep per-part actions labeled and distinct in compact mode; fit the recording page to the viewport. */
#book-studio.studio-recording #reader-page{max-width:calc(100dvh - 280px);margin-inline:auto}
#book-studio.compact-tools-active #studio-controls .studio-recording-panel #studio-page-audio>button[data-toolbar-icon]:not(dialog button){font-size:var(--studio-toolbar-font)!important;width:auto!important;min-width:96px!important;max-width:none!important;height:auto!important;min-height:var(--studio-toolbar-action-height)!important;padding:6px!important;flex:1 1 96px!important;display:grid!important;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:6px}
#book-studio.compact-tools-active #studio-controls .studio-recording-panel #studio-page-audio .studio-recording-label{display:block!important;text-align:center;line-height:1.4;font-size:var(--studio-toolbar-font)!important;min-width:0}


/* action-icons.css */
/* Shared soft blue/gold actions. Typography and book canvases are unchanged. */
:root{--book-action-paper:#f0e8d7;--book-action-primary:#f3dca6;--book-action-ink:#293f42;--book-action-outline:#c6c4b7;--book-action-error:#a33832}
button.btn,label.btn,#studio-dialog button,#editor-options>summary{background:var(--book-action-paper);color:var(--book-action-ink);border:1px solid var(--book-action-outline);border-radius:12px;box-shadow:0 2px 2px #293f4210;min-height:44px}
button.btn:not(.secondary):not(.danger),#studio-done{background:var(--book-action-primary);color:var(--book-action-ink)}
button.btn.danger{color:var(--book-action-error)}
[data-book-action]::before{content:'';display:inline-block;flex:none;width:28px;height:28px;vertical-align:middle;margin-inline-end:7px;background:var(--book-action-icon) center/contain no-repeat}
button[data-book-action],label.btn[data-book-action],summary[data-book-action]{align-items:center;justify-content:center}
button:disabled[data-book-action]::before{opacity:.4}
#studio-rail button[data-book-action]>span[aria-hidden=true]{display:none}
#studio-rail button[data-book-action]{display:flex;flex-direction:column;gap:3px;background:var(--book-action-paper);color:var(--book-action-ink)}
#studio-rail button[data-book-action]::before{margin:0;width:30px;height:30px}
#studio-rail button[aria-pressed=true]{background:var(--book-action-primary);border-color:var(--book-action-ink)}
#studio-undo,#studio-redo,#studio-close-tray{font-size:22px}
#studio-undo:not([data-icon-ready])::before,#studio-redo:not([data-icon-ready])::before,#studio-close-tray:not([data-icon-ready])::before{display:none}
#studio-undo[data-icon-ready],#studio-redo[data-icon-ready],#studio-close-tray[data-icon-ready]{font-size:0}
#studio-undo::before,#studio-redo::before,#studio-close-tray::before{margin:0}
#studio-redo::before{transform:scaleX(-1)}
#editor-options{z-index:60}
#editor-options .site-file-actions{width:275px;max-width:calc(100vw - 32px)}
#editor-options .site-file-actions>.btn{font-size:13px;max-width:none;min-height:48px;width:100%;justify-content:flex-start;text-align:start;display:flex}
#editor-options>summary{display:flex;min-width:108px}
#editor-options>summary>span{margin-inline-start:auto}
.top .actions>#go-start{max-width:none}
@media(max-width:600px){.top .actions{gap:8px}.top .actions>#go-start{font-size:11px;padding:6px;min-width:80px}.top .actions>#go-start::before{width:22px;height:22px}.top .actions{flex-wrap:wrap}#editor-options>summary{font-size:12px}}
[data-book-action="save"]{--book-action-icon:url("action-icons/action_save.png")}
[data-book-action="close"]{--book-action-icon:url("action-icons/reader_close.png")}
[data-book-action="search"]{--book-action-icon:url("action-icons/action_search.png")}
[data-book-action="filter"]{--book-action-icon:url("action-icons/action_filter.png")}
[data-book-action="child_shield_soft"]{--book-action-icon:url("action-icons/reader_child_shield_soft.png")}
[data-book-action="add"]{--book-action-icon:url("action-icons/action_add.png")}
[data-book-action="text"]{--book-action-icon:url("action-icons/action_text.png")}
[data-book-action="open_book"]{--book-action-icon:url("action-icons/action_open_book.png")}
[data-book-action="edit"]{--book-action-icon:url("action-icons/action_edit.png")}
[data-book-action="share"]{--book-action-icon:url("action-icons/action_share.png")}
[data-book-action="refresh"]{--book-action-icon:url("action-icons/action_refresh.png")}
[data-book-action="pause"]{--book-action-icon:url("action-icons/reader_pause.png")}
[data-book-action="copy"]{--book-action-icon:url("action-icons/action_copy.png")}
[data-book-action="close"]{--book-action-icon:url("action-icons/action_close.png")}
[data-book-action="info"]{--book-action-icon:url("action-icons/reader_info.png")}
[data-book-action="settings"]{--book-action-icon:url("action-icons/action_settings.png")}
[data-book-action="background"]{--book-action-icon:url("action-icons/action_background.png")}
[data-book-action="image"]{--book-action-icon:url("action-icons/action_image.png")}
[data-book-action="start"]{--book-action-icon:url("action-icons/reader_start.png")}
[data-book-action="download"]{--book-action-icon:url("action-icons/action_download.png")}
[data-book-action="delete"]{--book-action-icon:url("action-icons/action_delete.png")}
[data-book-action="back"]{--book-action-icon:url("action-icons/action_back.png")}
[data-book-action="info"]{--book-action-icon:url("action-icons/action_info.png")}
[data-book-action="library_books_soft"]{--book-action-icon:url("action-icons/reader_library_books_soft.png")}
[data-book-action="microphone"]{--book-action-icon:url("action-icons/action_microphone.png")}
[data-book-action="layout"]{--book-action-icon:url("action-icons/action_layout.png")}
[data-book-action="more"]{--book-action-icon:url("action-icons/action_more.png")}
[data-book-action="favorite"]{--book-action-icon:url("action-icons/action_favorite.png")}
[data-book-action="stop"]{--book-action-icon:url("action-icons/action_stop.png")}
[data-book-action="settings"]{--book-action-icon:url("action-icons/reader_settings.png")}
[data-book-action="undo"]{--book-action-icon:url("action-icons/action_undo.png")}
[data-book-action="folder"]{--book-action-icon:url("action-icons/action_folder.png")}
[data-book-action="play"]{--book-action-icon:url("action-icons/reader_play.png")}
[data-book-action="play"]{--book-action-icon:url("action-icons/reader_play.png")}
[data-book-action="pause"]{--book-action-icon:url("action-icons/reader_pause.png")}
[data-book-action="settings"]{--book-action-icon:url("action-icons/reader_settings.png")}
[data-book-action="info"]{--book-action-icon:url("action-icons/reader_info.png")}
[data-book-action="close"]{--book-action-icon:url("action-icons/reader_close.png")}
#book-studio button:not(.cover-hit){background:var(--book-action-paper);color:var(--book-action-ink);border-color:var(--book-action-outline);border-radius:10px;box-shadow:0 2px 2px #293f4210}
#book-studio #studio-done{background:var(--book-action-primary);color:var(--book-action-ink)}
#book-studio #studio-undo,#book-studio #studio-redo,#book-studio #studio-close-tray{font-size:0!important}
#book-studio #studio-undo::before,#book-studio #studio-redo::before,#book-studio #studio-close-tray::before{display:block;width:28px;height:28px;margin:auto}
body .btn.secondary{background:var(--book-action-paper);color:var(--book-action-ink);border-color:var(--book-action-outline)}
#book-studio .studio-header #studio-done{background:var(--book-action-primary);color:var(--book-action-ink)}
#book-studio #studio-close-tray{flex:0 0 36px;width:36px;min-width:36px;height:36px;padding:4px}
#editor-options .site-file-actions>.btn{background:var(--book-action-paper);color:var(--book-action-ink)}
#book-studio #studio-view-tools button[aria-pressed=true]{background:var(--book-action-primary);color:var(--book-action-ink);border-color:var(--book-action-ink)}
[data-book-action=close]{--book-action-icon:url("action-icons/action_close.png")}
[data-book-action=play]::before,[data-book-action=pause]::before{background-color:#0d2a4c;border-radius:9px;background-size:82%}
body[data-screen] .top .actions>#save-draft{display:flex;max-width:none;min-width:130px;font-size:12px;line-height:1.3;padding:8px 10px;white-space:normal}
.top .actions{flex-wrap:wrap;justify-content:flex-start}
#book-studio .studio-header #studio-done{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;font-size:12px;flex:0 0 auto;padding:4px 8px;min-width:96px}
#book-studio .studio-header #studio-done::before{width:22px;height:22px;margin-inline-end:5px}
.pageseg{display:inline-flex;gap:4px}.pageseg button[aria-pressed=true]{background:var(--book-action-primary);border-color:var(--book-action-ink)}


/* illustration-styles.css */
.illustration-style-picker{border:0;padding:0;margin:12px 0 20px;min-width:0;max-width:100%;text-align:start}.illustration-style-picker legend{font-size:1.1rem;font-weight:700;padding:0}.illustration-style-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.illustration-style-card{position:relative;min-width:0;background:#fffdf8;border:2px solid #deded3;border-radius:12px;overflow:hidden;transition:border-color .15s,box-shadow .15s}.illustration-style-card.is-selected{border-color:#326b52;box-shadow:0 0 0 2px #326b5220}.illustration-style-card:focus-within{outline:3px solid #b58942;outline-offset:2px}.illustration-style-card label{display:grid;gap:5px;margin:0;padding:0 0 10px;cursor:pointer}.illustration-style-card input[type=radio]{position:absolute;top:10px;inset-inline-start:10px;z-index:1;width:22px;height:22px;margin:0;accent-color:#326b52;background:white}.illustration-style-card img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;background:#f1ebdc;grid-row:1}.illustration-style-card strong,.illustration-style-caption{display:block;padding-inline:10px}.illustration-style-caption{font-size:.8rem;line-height:1.4;color:#555c54}.illustration-style-zoom{display:block;width:100%;padding:10px 6px;min-height:44px;border:0;border-top:1px solid #e6e4d8;border-radius:0;background:#f5f4eb;color:#315c48;font:inherit;font-size:.82rem;cursor:pointer}.illustration-style-zoom:hover{background:#e9eee4}.illustration-style-status{font-size:.9rem;font-weight:600;color:#315c48;margin:10px 0}.illustration-style-preview{width:min(920px,94vw);max-width:94vw;max-height:94dvh;padding:16px;border:1px solid #d6dacd;border-radius:16px;background:#fffdf7;color:#23382d;overflow:auto;box-sizing:border-box;direction:rtl}.illustration-style-preview::backdrop{background:#15291bd9}.illustration-preview-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.illustration-preview-header h3{font-size:1.05rem;margin:0}.illustration-preview-header button{min-height:44px}.illustration-style-preview>img{display:block;width:100%;height:auto;max-height:65dvh;object-fit:contain;border-radius:8px}.illustration-style-preview>p{margin:12px 0}.illustration-preview-actions{display:flex;justify-content:space-between;align-items:center;gap:8px}.illustration-preview-actions button{min-height:44px}.page-prompt-panel .illustration-style-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-prompt-panel .illustration-style-caption{font-size:.75rem}.page-prompt-panel .illustration-style-card strong{font-size:.9rem}@media(max-width:600px){.illustration-style-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.illustration-style-card strong{font-size:.9rem}.illustration-style-card label{gap:6px}.illustration-style-caption{font-size:.75rem}.illustration-style-preview{padding:12px}.illustration-preview-actions{flex-wrap:wrap}.illustration-preview-actions .btn{font-size:.85rem;padding:10px}.illustration-preview-actions .btn:not(.secondary){flex:1}}@media(prefers-reduced-motion:reduce){.illustration-style-card{transition:none}}
/* Keep the editor's generic full-width input rules away from the small radio marker. */
.illustration-style-card input[type=radio],#ai-prompt-workshop .illustration-style-card input[type=radio],#book-studio #studio-controls .illustration-style-card input[type=radio]{width:22px;min-width:22px;max-width:22px;height:22px;min-height:22px;max-height:22px;padding:0;margin:0;top:8px;inset-inline-start:8px;box-sizing:border-box}
#ai-prompt-workshop fieldset.illustration-style-picker{border:0;padding:0;margin:12px 0 20px}
#ai-prompt-workshop .illustration-style-card label,#book-studio #studio-controls .illustration-style-card label{display:grid;margin:0;padding:0 0 10px}
.illustration-style-picker.is-compact .illustration-style-grid{grid-template-columns:minmax(0,1fr)}.illustration-style-picker.is-compact .illustration-style-card:not(.is-visible){display:none}.illustration-style-picker.is-compact .illustration-style-caption,.illustration-style-picker.is-compact>p:last-child{display:none}.illustration-style-picker.is-compact legend{font-size:.95rem}.illustration-style-picker.is-compact .illustration-style-status{font-size:.8rem}.illustration-style-picker.is-compact .illustration-style-card strong{font-size:.85rem}

/* Equal-height cards keep compare controls aligned across differing title lengths. */
.illustration-style-card{display:flex;flex-direction:column}
.illustration-style-card label{flex:1;grid-template-rows:auto auto 1fr;align-content:start}
.illustration-style-card .illustration-style-zoom{flex-shrink:0;margin:0!important;margin-top:auto!important}


/* workshop-art.css */
#ai-prompt-workshop .ws-part{border:1px solid #d9cfc0;border-radius:12px;margin:10px 0;background:#fff}
#ai-prompt-workshop .ws-part>summary{display:flex;align-items:center;gap:8px;min-height:48px;padding:10px 14px;font-size:1.05rem;font-weight:700;cursor:pointer;list-style:none;line-height:1.3}
#ai-prompt-workshop .ws-part>summary::-webkit-details-marker{display:none}
#ai-prompt-workshop .ws-part>summary::after{content:'▾';margin-inline-start:auto;transition:transform .15s}
#ai-prompt-workshop .ws-part[open]>summary::after{transform:rotate(180deg)}
#ai-prompt-workshop .ws-part[open]>summary{border-bottom:1px solid #eadfce;background:#fbf6ec;border-radius:12px 12px 0 0}
#ai-prompt-workshop .ws-part>summary:focus-visible{outline:3px solid #2457c5;outline-offset:2px}
#ai-prompt-workshop .ws-part>:not(summary){margin-inline:14px}
#ai-prompt-workshop .ws-part>:last-child{margin-bottom:14px}
#ai-prompt-workshop .ws-part>summary+*{margin-top:12px}
#ai-prompt-workshop .ws-layout{border:0;padding:0;margin:12px 14px;min-width:0}
#ai-prompt-workshop .ws-layout legend{font-weight:700;padding:0;font-size:1.05rem}
.ws-layout-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
#ai-prompt-workshop .ws-layout-card{position:relative;display:grid;gap:4px;align-content:start;padding:10px;border:2px solid #d9cfc0;border-radius:12px;background:#fff;cursor:pointer;font-size:14px}
#ai-prompt-workshop .ws-layout-card input{position:absolute!important;opacity:0;width:1px!important;min-width:1px!important;height:1px;margin:0!important;padding:0!important;pointer-events:none}
#ai-prompt-workshop .ws-layout-card:has(input:checked){border-color:#2457c5;background:#eef3ff;box-shadow:0 0 0 1px #2457c5}
#ai-prompt-workshop .ws-layout-card:has(input:focus-visible){outline:3px solid #2457c5;outline-offset:2px}
.ws-pic{display:flex;justify-content:center;align-items:flex-start;gap:4px;margin-bottom:4px}
.ws-pic .pg{position:relative;display:block;width:44%;max-width:62px;aspect-ratio:3/4;height:auto;background:#fffdf8;border:1px solid #b9ad9a;border-radius:3px;overflow:hidden;padding:6px 5px;box-sizing:border-box}
.ws-pic .pg.wide{width:90%;max-width:128px;aspect-ratio:3/2}
.ws-pic .art{position:absolute;top:7%;right:7%;bottom:7%;left:7%;background:linear-gradient(135deg,#7fb7e6,#f4c26b);border-radius:2px;display:block}
.ws-pic s{position:absolute;right:6px;left:6px;height:auto;display:block;text-decoration:none}
.ws-pic s.top{top:5px;bottom:auto}.ws-pic s.bot{bottom:5px;top:auto}.ws-pic .pg>s:only-of-type:not(.top):not(.bot){bottom:6px}
.ws-pic .pg>s:not(.top):not(.bot){bottom:6px;top:auto;background:rgba(255,255,255,.8);padding:3px;border-radius:2px}
.ws-pic i{display:block;height:4px;margin:3px 0;background:#6b6256;border-radius:2px}
.ws-pic .pg>i{margin:6px 0}
.ws-pagebox{margin:6px 0 10px}
.ws-pages{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.ws-pages.is-spread{grid-template-columns:repeat(2,minmax(0,1fr))}
.ws-page{background:#fffdf8;border:1px solid #cfc3ae;border-radius:6px;padding:10px;font-size:14px;line-height:1.5;max-height:170px;overflow:auto}
.ws-page p{margin:6px 0 0}
@media(max-width:430px){.ws-layout-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ws-pages.is-spread{grid-template-columns:minmax(0,1fr)}}
.ws-pic .art.fill{top:0;right:0;bottom:0;left:0}.ws-pic .art.top70{top:0;right:0;bottom:30%;left:0}.ws-pic .art.top65{top:0;right:0;bottom:35%;left:0}.ws-pic .art.bot65{top:35%;right:0;bottom:0;left:0}.ws-pic .art.mid{top:30%;right:0;bottom:30%;left:0}

/* Compact controls use the same selected values as the questionnaire and prompt. */
#ai-prompt-workshop .ws-shape{border:0;padding:0;margin:0;min-width:0;grid-column:1/-1}
#ai-prompt-workshop .ws-shape legend{font-size:14px;font-weight:700;margin-bottom:8px}
.ws-shape-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;direction:rtl}
#ai-prompt-workshop .ws-shape-buttons>button{display:flex;align-items:center;justify-content:center;gap:9px;margin:0;min-height:48px;padding:8px 6px;border-radius:0;box-shadow:none;font-size:14px;white-space:nowrap}
#ai-prompt-workshop .ws-shape-buttons>button:first-child{border-radius:0 8px 8px 0}
#ai-prompt-workshop .ws-shape-buttons>button:last-child{border-radius:8px 0 0 8px}
#ai-prompt-workshop .ws-shape-buttons>button[aria-pressed=true]{background:#e5f1ee;border-color:#1b6a6e;color:#14575b;box-shadow:inset 0 0 0 1px #1b6a6e}
.ws-shape-icon{display:block;width:19px;height:19px;border:2px solid currentColor;border-radius:2px;flex-shrink:0;box-sizing:border-box}.ws-shape-icon.portrait34{width:16px;height:22px}
#ai-prompt-workshop .ws-appearance{border:0;border-block:1px solid #e7dfd2;border-radius:0;padding:0;background:transparent;margin-block:12px}
#ai-prompt-workshop .ws-appearance>summary{min-height:44px;padding-block:10px;font-size:14px}
#ai-prompt-workshop .ws-appearance textarea{box-sizing:border-box;width:100%;margin:4px 0 10px}
#ai-prompt-workshop .ws-layout-row #ap-compare-layouts{min-height:44px;margin:4px 0 0;padding:8px 12px;white-space:nowrap}
.ws-layout-dialog{max-height:90dvh;overflow:auto}
.ws-layout-dialog .ws-pic{min-height:min(180px,32dvh);align-items:center;padding:18px 4px;gap:8px}
.ws-layout-dialog .ws-pic .pg{width:55%;max-width:min(180px,32dvh);padding:0;flex-shrink:0}
.ws-layout-dialog .ws-pic[data-layout=facing] .pg{width:43%;max-width:min(160px,30dvh)}
.ws-layout-dialog .ws-pic .pg.wide{width:95%;max-width:min(360px,70dvh)}
.ws-layout-dialog .ws-pic[data-layout=spread] .pg::after{content:'';position:absolute;inset-block:0;left:50%;border-left:1px dashed #6b6256}
.ws-layout-dialog .ws-pic .art{right:auto;bottom:auto;border-radius:0}
.ws-layout-dialog .ws-pic .pg>s{position:absolute;box-sizing:border-box;right:auto;bottom:auto;padding:5px;background:transparent;display:flex;flex-direction:column;justify-content:space-evenly}
.ws-layout-dialog .ws-pic .pg>s i{height:4px;min-height:3px;margin:2px 0;flex-shrink:0}
.ws-layout-dialog .ws-pic[data-layout=full] .pg>s{background:#fffdf8c9;border-radius:3px}


/* reference-package.css */
.reference-package-dialog{width:min(1040px,96vw);max-width:96vw;max-height:94dvh;box-sizing:border-box;overflow:auto;padding:22px;border:1px solid #cbd6c9;border-radius:16px;background:#fffdf7;color:#293d32;direction:rtl}.reference-package-dialog::backdrop{background:#15291bd9}.reference-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.reference-dialog-header h2{font-size:1.25rem;margin:0}.reference-package-dialog input,.reference-package-dialog textarea,.reference-package-dialog select{box-sizing:border-box;max-width:100%;width:100%}.reference-package-dialog textarea{font-size:16px}.reference-package-dialog label{display:block;margin:14px 0}.reference-package-dialog .btn{min-height:44px;margin:6px 0}.reference-package-dialog .row{gap:8px}.reference-privacy{font-size:.85rem;background:#edf3e9;border:1px solid #d4dfce;border-radius:10px;padding:12px;line-height:1.65}.reference-photos{display:grid;gap:18px;margin:16px 0}.reference-photo{border:1px solid #d4dfce;border-radius:12px;padding:16px;min-width:0;background:#fff}.reference-compare{display:grid;grid-template-columns:1fr 1fr;gap:14px}.reference-compare figure{margin:0;min-width:0}.reference-compare figcaption{font-size:.85rem;font-weight:600;margin-bottom:6px}.reference-compare canvas{display:block;width:auto;max-width:100%;height:auto;max-height:330px;object-fit:contain;border:1px solid #d7dfd3;border-radius:8px;background-color:#fff;background-image:linear-gradient(45deg,#e1e5df 25%,transparent 25%),linear-gradient(-45deg,#e1e5df 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e1e5df 75%),linear-gradient(-45deg,transparent 75%,#e1e5df 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.reference-cutout-canvas{touch-action:none;cursor:crosshair}.reference-corrections{margin:12px 0}.reference-corrections summary{min-height:44px;cursor:pointer;padding:10px 0;box-sizing:border-box}.reference-corrections [aria-pressed=true]{background:#d8e8d4;color:#29422f;border-color:#54724c}.reference-package-dialog label.reference-approval{display:flex;flex-direction:row;align-items:flex-start;gap:10px;line-height:1.65;font-size:.9rem}.reference-package-dialog .reference-approval input[type=checkbox]{width:22px;min-width:22px;max-width:22px;height:22px;min-height:22px;max-height:22px;flex:none;padding:0;margin:2px 0 0;accent-color:#326b52}.reference-package-dialog #reference-download{width:100%;font-size:1rem;font-weight:600;padding:14px}.reference-package-open{max-width:100%}@media(max-width:600px){.reference-package-dialog{padding:14px}.reference-dialog-header h2{font-size:1.05rem}.reference-photo{padding:10px}.reference-compare{gap:8px}.reference-compare canvas{max-height:240px}.reference-compare figcaption{font-size:.75rem}.reference-package-dialog .row{display:flex;flex-wrap:wrap}.reference-package-dialog .row .btn{flex:1 1 auto}.reference-package-dialog label{font-size:.9rem}}
/* The first photo action processes a picture, it does not delete it. Keep the generic icon heuristic elsewhere. */
.reference-package-dialog .reference-photo>.row>button:first-child{--book-action-icon:url("action-icons/action_image.png")}
/* The mask eraser edits pixels locally, rather than deleting a photo. Its text and pressed state are clearer without a trash icon. */
.reference-package-dialog .reference-corrections button[aria-pressed]::before{display:none}

/* Reference collection belongs to the character inputs; packaging belongs to the final prompt. */
#ai-prompt-workshop .reference-workshop-inputs{border-top:1px solid #e7dfd2;padding-top:12px;margin-top:18px}
.reference-workshop-inputs h3{font-size:16px;margin:6px 0 12px}
.reference-workshop-inputs input{box-sizing:border-box;max-width:100%;width:100%}
.reference-workshop-inputs .reference-compare canvas{max-height:200px}
.reference-workshop-inputs .reference-photo>.row{display:flex;flex-wrap:wrap;gap:8px}
.reference-workshop-inputs .reference-photo>.row .btn{min-height:44px;flex:1 1 auto}
.reference-workshop-inputs label.reference-approval{display:flex!important;flex-direction:row;align-items:flex-start;gap:8px;font-size:14px;line-height:1.5}
.reference-workshop-inputs .reference-approval input[type=checkbox]{width:22px;min-width:22px;height:22px;flex:none;margin:0}
.reference-workshop-inputs .reference-photo>.row>button:first-child{--book-action-icon:url("action-icons/action_image.png")}
.reference-workshop-inputs .reference-corrections button[aria-pressed]::before{display:none}
#ai-prompt-workshop #ap-download-request{width:calc(100% - 28px);min-height:48px;margin-block:12px}


/* editor-cleanup.css */
/* Shared Android/web editor presentation cleanup. No book or storage behavior changes. */
#session-only-notice{display:none!important}
#status:empty{display:none}
#status.ok{position:fixed;inset-inline:16px;bottom:18px;z-index:200;max-width:720px;margin:0 auto;padding:10px 14px;border:1px solid #c7d9ce;border-radius:12px;background:#edf5ee;color:#1f5144;box-shadow:0 3px 12px #203d2920;font-size:14px;font-weight:500}
body[data-screen]>.top{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;min-height:64px}
body[data-screen]>.top h1{flex:1;min-width:0;margin-block:12px;font-size:17px;white-space:normal}
body[data-screen]>.top .actions{display:flex;flex-wrap:nowrap;flex:0 0 auto;flex-basis:auto;width:auto;align-items:center;gap:4px}
body[data-screen]>.top #editor-options>summary{font-size:14px;min-height:44px;gap:8px;padding:7px 10px;white-space:nowrap}
#start.ai-prompts-open{border:0;border-radius:0;background:transparent;padding:0;box-shadow:none}
#ai-prompt-workshop{border:0;border-radius:0;background:transparent;box-shadow:none;padding:0;margin-top:0}
@media(max-width:380px){body[data-screen]>.top h1{font-size:15px;gap:5px}body[data-screen]>.top .site-mark{width:24px;height:30px;flex-shrink:0}}

.prompt-copy-field{position:relative;display:block;min-width:0}
.prompt-copy-field>textarea{box-sizing:border-box;width:100%;padding-block-start:52px!important}
.prompt-copy-field>.prompt-copy-control{position:absolute;inset-block-start:4px;inset-inline-end:4px;display:grid;place-items:center;min-width:44px;min-height:44px;width:44px;height:44px;padding:0;border:0;border-radius:7px;background:transparent;box-shadow:none;color:#244e53;z-index:1}
.prompt-copy-control:hover{background:#e3eeeb}.prompt-copy-control:focus-visible{outline:2px solid #155e63;outline-offset:1px}.prompt-copy-control:disabled{opacity:.4}
#ap-output-route-hint{line-height:1.55}
.prompt-copy-control::before{display:none!important;content:none!important}
#book-studio .prompt-copy-field>.prompt-copy-control{position:absolute!important;inset-block-start:4px!important;inset-inline-end:4px!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;display:grid!important;place-items:center;background:transparent!important;border:0!important;box-shadow:none!important}

/* Keep the reference dialog theme from shrinking this touch target. */
.prompt-copy-field>button.prompt-copy-control{width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;box-sizing:border-box!important}

/* Character review: one action row, optional headings, no white inset above section titles. */
#ai-prompt-workshop .interview-part.ws-part{padding-block:0}
#ai-prompt-workshop .ap-actor>.ap-actor-title{margin:10px 0 8px;font-size:15px;line-height:1.4}
#ai-prompt-workshop .ap-actor .ap-actions{flex-wrap:wrap}
#ai-prompt-workshop .ap-actor #ap-add-actor{min-height:44px;margin:6px 0 2px}

#ai-prompt-workshop .ap-inline-check{display:flex;flex-direction:row;align-items:center;gap:10px;min-height:44px;line-height:1.5}
#ai-prompt-workshop .ap-inline-check>input[type=checkbox]{flex:0 0 auto;width:22px;height:22px;margin:0;order:-1}

/* Compact number choices and a single, initially closed guidance field. */
#ai-prompt-workshop .ap-number-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-block:12px}
#ai-prompt-workshop .ap-number-row>label{min-width:0;font-size:13px;white-space:nowrap}
#ai-prompt-workshop .ap-number-row select{min-height:44px;padding:8px 4px;font-size:14px}
#ai-prompt-workshop .ap-plot-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
#ai-prompt-workshop .ap-guidance-options{border:0;border-top:1px solid #e7dfd2;border-radius:0;padding:0;background:transparent;margin-block:12px}
#ai-prompt-workshop .ap-guidance-options>summary{min-height:44px;padding-block:10px;font-size:14px}
#ai-prompt-workshop .ap-guidance-options textarea{width:100%;box-sizing:border-box;margin:4px 0 10px}
.ap-number-dialog{max-width:320px;border:1px solid #d9cfc0;border-radius:12px;padding:18px;background:#fff;color:#203536}
.ap-number-dialog input{width:100%;box-sizing:border-box;min-height:44px;font:inherit}
.ap-number-dialog button{min-height:44px}.ap-number-dialog::backdrop{background:#10262566}

#ai-prompt-workshop .ap-style-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;margin-block:12px}
#ai-prompt-workshop .ap-style-row>label{min-width:0}
#ai-prompt-workshop .ap-style-row #ap-compare-styles{min-height:44px;margin:4px 0 0;padding:8px 12px;white-space:nowrap}

/* Expanded interview sections have one visible outer boundary, not nested cards. */
#ai-prompt-workshop>.interview-part.ws-part{border:1px solid transparent;border-radius:12px;margin-block:10px}
#ai-prompt-workshop>.interview-part.ws-part[open]{border-color:#b9c9b9;background:#fffdf6;padding:0 12px 12px;box-shadow:0 1px 3px #243f2910}
#ai-prompt-workshop>.interview-part.ws-part[open]>summary{background:#eaf0e5;border-bottom:1px solid #cbd7c6;border-radius:11px 11px 0 0;margin-inline:-12px;padding:12px}
#ap-page-count-meaning{font-size:12px;line-height:1.5;margin:6px 0 10px}

/* System share stays separate from the retained compact copy control. */
.prompt-share-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-block:6px 12px;min-width:0}
.prompt-share-actions>.prompt-share-text{min-height:44px;flex:0 0 auto}
.prompt-share-actions>.prompt-share-status{flex:1 1 180px;min-width:0;margin:0;overflow-wrap:anywhere}
.prompt-share-status:empty{display:none}
.reference-package-actions{display:flex;flex-wrap:wrap;gap:8px;margin-block:12px}
.reference-package-actions>button{min-height:44px;min-width:0;max-width:100%;white-space:normal}

/* Reference collection is a small entry action, not a full-screen block in the questionnaire. */
#ap-reference-photos{width:auto!important;min-height:44px;margin-block:8px}
.reference-input-dialog{width:min(680px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:88dvh;overflow:auto;box-sizing:border-box;border:1px solid #d4d5c8;border-radius:16px;padding:16px;background:#fffdf5;color:#263735}
.reference-input-dialog::backdrop{background:#162f3a70}
.reference-input-dialog .reference-workshop-inputs{border:0!important;padding:0!important;margin:0!important}
.reference-input-dialog .reference-workshop-inputs>h3{display:none}
.reference-input-dialog .reference-dialog-header h2{font-size:20px;margin:0}
.reference-input-dialog .reference-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.reference-input-dialog .reference-compare figure[hidden]{display:none!important}
.reference-input-dialog .reference-compare:has(figure[hidden]){grid-template-columns:minmax(0,1fr)}
.reference-input-dialog .reference-compare canvas{max-height:240px;object-fit:contain}
.reference-input-dialog .reference-photo{margin-block:12px;padding:10px}
.reference-input-dialog p[role=status]:empty{display:none}
.reference-input-dialog .reference-input-details{margin-top:12px;font-size:13px}
.reference-input-dialog .reference-input-details summary{min-height:36px;cursor:pointer}
.reference-input-dialog [hidden]{display:none!important}

.reference-input-dialog .reference-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
.reference-input-dialog .reference-compare figure{margin:0;min-width:0}
.reference-input-dialog .reference-compare canvas{display:block;width:100%;height:auto;max-width:100%}
.reference-input-dialog .reference-photo>label{display:block;margin-block:6px}
.reference-input-dialog .reference-photo input:not([type=checkbox]):not([type=range]){width:100%;min-width:0;box-sizing:border-box}
.reference-input-dialog .reference-approval{display:flex;align-items:center;gap:8px}
.reference-input-dialog .reference-approval input{width:20px;height:20px;flex:0 0 auto}
.reference-input-dialog .reference-photo .row{flex-wrap:wrap}

#ap-story-ready:empty{display:none}

#ap-input-package-status:empty{display:none}
#ap-chat-result>[hidden]{display:none!important}

/* Brief copy confirmation, never changes field or dialog geometry. */
.editor-copy-toast{position:fixed;inset-inline:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));margin-inline:auto;width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;padding:10px 18px;border:1px solid #9dc6bd;border-radius:999px;background:#184b47;color:#fff;font:600 1rem/1.5 system-ui,sans-serif;text-align:center;direction:rtl;box-shadow:0 4px 18px #0003;z-index:2147483000;pointer-events:none;opacity:0}
.editor-copy-toast[data-visible="true"]{opacity:1}

/* Reference photo dialog: one alignment system, including the live processing state. */
.reference-input-dialog .reference-dialog-header .btn,.reference-input-dialog .reference-workshop-inputs button.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;box-sizing:border-box;margin:0;line-height:1.4;vertical-align:middle}
.reference-input-dialog .reference-dialog-header{align-items:center;margin:0 0 14px}
.reference-input-dialog .reference-workshop-inputs>#reference-add-photos{margin:0 0 12px}
.reference-input-dialog .reference-photos{margin:0;gap:14px}
.reference-input-dialog .reference-photo{margin:0 0 14px;padding:12px}
.reference-input-dialog .reference-photo>label:not(.reference-approval){display:grid;gap:6px;margin:0 0 12px}
.reference-input-dialog .reference-photo input:not([type=checkbox]):not([type=range]){min-height:44px;margin:0}
.reference-input-dialog .reference-photo>.row,.reference-input-dialog .reference-input-actions{display:flex;align-items:stretch;flex-wrap:wrap;gap:8px;margin:12px 0}
.reference-input-dialog .reference-photo>.row>.btn,.reference-input-dialog .reference-input-actions>.btn{flex:1 1 130px;align-self:stretch;white-space:normal}
.reference-input-dialog label.reference-approval{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start;gap:10px;min-height:44px;line-height:1.5;margin:8px 0!important;padding:0}
.reference-input-dialog label.reference-approval>input[type=checkbox]{flex:0 0 22px;width:22px;min-width:22px;max-width:22px;height:22px;min-height:22px;max-height:22px;align-self:center;margin:0!important;padding:0;box-sizing:border-box}
.reference-input-dialog label.reference-approval>span{flex:1;min-width:0}
.reference-input-dialog .reference-photo>p[role=status]{margin:8px 0;line-height:1.5}
.reference-input-dialog .reference-input-details{margin:12px 0 0}
.reference-input-dialog .reference-input-details>summary{display:list-item;min-height:44px;box-sizing:border-box;padding-block:10px}

/* Local image paste controls keep the file picker available. */
.clipboard-image-control{display:inline-flex;flex-direction:column;gap:.35rem;min-width:0;max-width:100%;vertical-align:top}
.clipboard-image-control>.btn{min-height:44px;white-space:normal}
.clipboard-image-status{white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.clipboard-image-status:empty{display:none}
.reference-upload-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;margin-bottom:12px}
.reference-upload-actions>.btn,.reference-upload-actions>.clipboard-image-control{flex:1 1 135px;min-width:0}
.reference-upload-actions .clipboard-image-control>.btn{width:100%}

#bulk-images-card>.clipboard-image-control{margin-inline-start:8px;margin-block:4px}

/* Visual outline choices. Samples are drafts until Apply. */
html body #book-studio dialog.studio-outline-picker[open]{inset:0;margin:auto;width:min(420px,calc(100vw - 24px));max-width:calc(100vw - 24px);height:fit-content;max-height:calc(100dvh - 24px);overflow:auto;padding:18px;border:1px solid #d0d4c8;border-radius:20px;background:#fffdf5;color:#263c40;box-sizing:border-box;box-shadow:0 12px 44px #263c4033}
#studio-outline-picker::backdrop{background:#263c4052}
#studio-outline-picker header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
#studio-outline-picker h2{font-size:22px;margin:0;line-height:1.4}
#studio-outline-picker button{font:inherit;color:inherit;border:1px solid #c9c8ba;border-radius:12px;min-height:44px;background:#f0ead9;padding:8px 16px}
#studio-outline-picker [data-outline-close]{font-size:25px;padding:0;width:44px;flex:0 0 44px}
#studio-outline-picker .studio-outline-choices{display:grid;gap:9px}
#studio-outline-picker .studio-outline-choice{border:1px solid #ccd5c8;background:white;border-radius:12px;display:grid;grid-template-columns:26px minmax(0,1fr);gap:10px;align-items:center;padding:10px 12px;min-height:88px;cursor:pointer;margin:0}
#studio-outline-picker .studio-outline-choice:has(input:checked){background:#fff8df;border:2px solid #9a791f;padding:9px 11px}
#studio-outline-picker .studio-outline-choice:has(input:focus-visible){outline:2px solid #176c61;outline-offset:2px}
#studio-outline-picker input[type=radio]{width:22px;height:22px;accent-color:#74602b;margin:0}
#studio-outline-picker .studio-outline-label{display:block;font-size:13px;color:#53666a;margin-bottom:7px}
#studio-outline-picker .studio-outline-sample{display:block;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#studio-outline-picker .studio-outline-color{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:12px 0 0;font-size:14px}
#studio-outline-picker input[type=color]{width:48px;height:44px;min-height:44px;padding:3px;border:1px solid #c9c8ba;border-radius:8px;background:white}
#studio-outline-picker .studio-outline-footer{display:flex;gap:9px;margin-top:12px}
#studio-outline-picker .studio-outline-footer button{flex:1}
#studio-outline-picker [data-outline-apply]{background:#f4dfa3;font-weight:bold}

#book-studio #studio-outline-picker{direction:rtl}
#book-studio #studio-outline-picker header,#book-studio #studio-outline-picker .studio-outline-choice{direction:rtl}
#book-studio #studio-outline-picker label.studio-outline-color{display:flex!important;flex-direction:row;justify-content:space-between;align-items:center;text-align:right}

/* Approved image-options dialog. Shared values are checked by Stylelint. */
:root {
 --books-ui-gap:12px; --books-ui-gap-small:8px;
 --books-ui-control:44px; --books-ui-input-height:50px; --books-ui-action-height:54px;
 --books-ui-radius:12px; --books-ui-thumb-radius:8px;
 --books-ui-surface:#fffdf5; --books-ui-input:#fff; --books-ui-control-fill:#f1ead8;
 --books-ui-ink:#293f3b; --books-ui-rule:#d4d8ce; --books-ui-action:#f2dfa7;
 --books-ui-label-size:15px; --books-ui-text-size:16px; --books-ui-action-size:19px;
 --books-ui-heading-size:24px; --books-ui-note-size:13px;
}
.prompt-style-trigger,.prompt-preview-compact-label,.prompt-local-only { display:none; }
#studio-tool-options[data-kind="image"] {
 width:min(420px,calc(100vw - 24px)); color:var(--books-ui-ink); background:var(--books-ui-surface);
}
#studio-tool-options[data-kind="image"] header h2 { font-size:var(--books-ui-heading-size); }
#studio-tool-options[data-kind="image"] .studio-image-framing,
#studio-tool-options[data-kind="image"] .page-prompt-panel>h3,
#studio-tool-options[data-kind="image"] .prompt-panel-intro,
#studio-tool-options[data-kind="image"] .prompt-style-samples,
#studio-tool-options[data-kind="image"] .prompt-preview-full-label,
#studio-tool-options[data-kind="image"] .prompt-options label:nth-child(2)>select { display:none; }
#studio-tool-options[data-kind="image"] #studio-legacy-image { display:flex; flex-direction:column; }
#studio-tool-options[data-kind="image"] .studio-prompt-host,
#studio-tool-options[data-kind="image"] .page-prompt-panel {
 display:contents; padding:0; margin:0; border:0; background:transparent; min-width:0; text-align:start;
}
#studio-tool-options[data-kind="image"] .prompt-options {
 order:10; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--books-ui-gap); margin:0 0 16px;
}
#studio-tool-options[data-kind="image"] .prompt-options label {
 display:block; min-width:0; font-size:var(--books-ui-label-size); font-weight:700; text-align:start;
}
#studio-tool-options[data-kind="image"] .prompt-options select,
#studio-tool-options[data-kind="image"] .prompt-style-trigger {
 display:block; width:100%; min-height:var(--books-ui-input-height); max-width:100%; margin-top:8px;
 border:1px solid var(--books-ui-rule); border-radius:var(--books-ui-radius); background:var(--books-ui-input);
 color:var(--books-ui-ink); font:inherit; text-align:start; padding:0 var(--books-ui-gap);
}
#studio-tool-options[data-kind="image"] .prompt-style-trigger {
 display:flex; align-items:center; justify-content:space-between; gap:var(--books-ui-gap-small);
}
#studio-tool-options[data-kind="image"] .prompt-style-trigger::after { content:'⌄'; }
#studio-tool-options[data-kind="image"] .illustration-selected-preview {
 order:20; margin:0 0 20px; padding:0; width:100%; max-width:none; align-self:stretch;
}
/* Explicit overrides retire the old thumbnail's forced small image and auto width. */
#studio-tool-options[data-kind="image"] .illustration-selected-preview>button {
 display:flex; width:100%!important; max-width:none!important; flex:1 1 auto; min-height:104px;
 justify-content:space-between; gap:var(--books-ui-gap); padding:10px;
 border:1px solid var(--books-ui-rule); border-radius:var(--books-ui-radius);
 background:var(--books-ui-control-fill); color:var(--books-ui-ink);
}
#studio-tool-options[data-kind="image"] .illustration-selected-preview>button>img {
 max-width:none!important; width:126px!important; height:84px!important; object-fit:contain;
 border-radius:var(--books-ui-thumb-radius); flex-shrink:0;
}
#studio-tool-options[data-kind="image"] .prompt-preview-compact-label {
 display:inline; font-size:var(--books-ui-text-size); font-weight:700;
}
#studio-tool-options[data-kind="image"] .prompt-advanced {
 order:30; border:0; border-block:1px solid var(--books-ui-rule); border-radius:0;
 background:transparent; padding:0; margin:0;
}
#studio-tool-options[data-kind="image"] .prompt-advanced>summary {
 min-height:56px; display:flex; align-items:center; justify-content:space-between;
 padding:var(--books-ui-gap) 0; font-size:var(--books-ui-text-size); font-weight:700;
}
#studio-tool-options[data-kind="image"] .prompt-advanced>summary::after { content:'⌄'; }
#studio-tool-options[data-kind="image"] .prompt-advanced[open]>summary::after { content:'⌃'; }
#studio-tool-options[data-kind="image"] [data-image-extra-controls] {
 order:40; border:0; border-bottom:1px solid var(--books-ui-rule); border-radius:0;
 background:transparent; padding:0; margin:0 0 24px;
}
#studio-tool-options[data-kind="image"] [data-image-extra-controls]>summary {
 min-height:48px; padding:var(--books-ui-gap) 0; font-size:var(--books-ui-label-size);
}
#studio-tool-options[data-kind="image"] [data-prompt-generate] {
 order:50; width:100%; min-height:var(--books-ui-action-height); margin:0;
 border:1px solid var(--books-ui-rule); border-radius:var(--books-ui-radius);
 background:var(--books-ui-action); color:var(--books-ui-ink); font-size:var(--books-ui-action-size); font-weight:700;
}
#studio-tool-options[data-kind="image"] .prompt-local-only {
 order:60; display:block; text-align:center; font-size:var(--books-ui-note-size);
 color:var(--books-ui-ink); margin:11px 0 0;
}
#studio-tool-options[data-kind="image"] .prompt-result { order:70; }
#studio-tool-options[data-kind="image"] .page-prompt-panel>p[role="status"] { order:80; }
#studio-tool-options[data-kind="image"] .page-prompt-panel>p[role="status"]:empty { display:none; }
@media(max-width:340px) {
 #studio-tool-options[data-kind="image"] { width:calc(100vw - 16px); }
 #studio-tool-options[data-kind="image"] .illustration-selected-preview>button>img { width:106px!important; height:72px!important; }
 #studio-tool-options[data-kind="image"] .prompt-preview-compact-label,
 #studio-tool-options[data-kind="image"] .prompt-advanced>summary { font-size:var(--books-ui-label-size); }
}

/* Equal toolbar roles keep equal touch boxes, including wrapped text labels. */
@media(max-width:799px) {
 #book-studio #studio-controls .studio-compact-actions>button {
  flex:1 1 0; min-width:44px; min-height:60px; width:0; align-self:stretch;
 }
}

/* Focused text tools use the same roles without repeating their controls in More. */
:root { --books-ui-menu-height:64px; }
#book-studio #studio-tool-options[data-kind="more"],
#book-studio #studio-tool-options[data-kind="align"] { width:min(420px,calc(100vw - 24px)); }
#book-studio #studio-tool-options[data-kind="more"] #studio-legacy-text {
 display:grid!important; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--books-ui-gap-small);
}
#book-studio #studio-tool-options[data-kind="more"] #lay-tools,
#book-studio #studio-tool-options[data-kind="more"] #lay-background-tools,
#book-studio #studio-tool-options[data-kind="more"] #studio-story-editor,
#book-studio #studio-tool-options[data-kind="more"] #studio-legacy-text>p,
#book-studio #studio-tool-options[data-kind="more"] #lay-style-tools>:not(#lay-apply-text-all) { display:none!important; }
#book-studio #studio-tool-options[data-kind="more"] #lay-style-tools {
 order:10; min-width:0; padding:0; margin:0; border:0; background:transparent;
}
#book-studio #studio-tool-options[data-kind="more"] #lay-apply-text-all,
#book-studio #studio-tool-options[data-kind="more"] .studio-remove-local {
 width:100%; min-width:0; min-height:var(--books-ui-menu-height); height:100%; margin:0; padding:var(--books-ui-gap-small);
 font-size:var(--books-ui-label-size); border-radius:var(--books-ui-radius); box-sizing:border-box;
}
#book-studio #studio-tool-options[data-kind="more"] .studio-remove-local { order:20; }
#book-studio #studio-tool-options[data-kind="more"] .studio-text-groups { order:30; grid-column:1/-1; }
#book-studio #studio-tool-options[data-kind="align"] .lay-align { width:100%; }
#book-studio #studio-tool-options[data-kind="align"] .lay-align>button { flex:1 1 0; min-width:0; min-height:var(--books-ui-control); box-sizing:border-box; border-width:2px!important; }
#book-studio #studio-tool-options[data-kind="edit"] #studio-story-editor>summary { display:none; }
#book-studio #studio-save-dialog>div>button { flex:1 1 0; min-width:0; height:auto; min-height:var(--books-ui-action-height); }

/* Settings' single grid track must shrink below its header's min-content width. */
#book-studio.book-settings-open { grid-template-columns:minmax(0,1fr)!important; }
#book-studio.book-settings-open .studio-header { min-width:0; }
#book-studio.book-settings-open #studio-title { min-width:0; white-space:normal; line-height:1.2; }

/* Complete local text-file sharing supplements, rather than replaces, text/copy. */
.prompt-share-actions.prompt-is-long { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.prompt-share-actions.prompt-is-long>button { min-width:0; min-height:var(--books-ui-action-height); width:100%; white-space:normal; }
.prompt-share-actions.prompt-is-long>.prompt-share-text,
.prompt-share-actions>.prompt-long-hint,
.prompt-share-actions.prompt-is-long>.prompt-share-status { grid-column:1/-1; margin:0; }
#ap-source-hint,#ap-appearance-review { line-height:1.55; }
#ap-appearance-review button { min-height:var(--books-ui-action-height); }

.reference-long-text-actions:not(.prompt-is-long) { display:none!important; }

#studio-pending-edit { flex:0 0 auto; padding:8px; margin:4px; font-size:13px; color:#293d32; background:#fff4cd; border-radius:8px; }
#studio-pending-edit[hidden] { display:none; }

/* Same-role prompt choices share the input height despite generic dialog buttons. */
#book-studio #studio-tool-options[data-kind="image"] .prompt-style-trigger { min-height:var(--books-ui-input-height); }


/* gallery-filter-preview.css */
/* Gallery age filter + text preview (compact, RTL) */
.gallery-filter{display:flex;flex-wrap:wrap;gap:.4rem;margin:.25rem 0 .6rem}
.gallery-filter .chip{border:1px solid #cbbf9f;background:#fffdf6;border-radius:999px;padding:.15rem .8rem;font-size:.85rem;cursor:pointer;color:#4c4634}
.gallery-filter .chip.on{background:#4c4634;color:#fffdf6;border-color:#4c4634}
.gp-overlay{position:fixed;inset:0;background:rgba(40,36,20,.45);display:flex;align-items:center;justify-content:center;z-index:60;padding:1rem}
.gp-panel{background:#fffdf6;border-radius:12px;max-width:34rem;width:100%;max-height:82vh;display:flex;flex-direction:column;padding:1rem 1.2rem;box-shadow:0 8px 30px rgba(0,0,0,.25)}
.gp-title{margin:.1rem 0 .2rem;font-size:1.15rem}
.gp-meta{margin:0 0 .6rem;color:#7a7159;font-size:.85rem}
.gp-text{overflow-y:auto;flex:1;border-top:1px solid #e4dcc4;border-bottom:1px solid #e4dcc4;padding:.5rem .2rem;margin-bottom:.7rem}
.gp-text p{margin:.35rem 0;line-height:1.5}
.gp-actions{display:flex;gap:.5rem;justify-content:flex-start}
#gallery .story-card[hidden]{display:none!important}


/* view-only.css */

/* Read-only catalog preview (?view=<id>): keep the title, status line, and the book-check card only. */
body.view-only header .actions,
body.view-only #session-only-notice,
body.view-only #start,
body.view-only #story-interview,
body.view-only #layout,
body.view-only main#book > section:not(#wizard-preview),
body.view-only #wizard-actions,
body.view-only #review-actions,
body.view-only #wp-credits,
body.view-only footer { display: none !important; }
body.view-only #wizard-preview { border: none; box-shadow: none; }
body.view-only #wizard,
body.view-only #export-options,
body.view-only #site-path,
body.view-only #editor-options,
body.view-only #status-tech,
body.view-only #wizard-preview > p.muted.small { display: none !important; }

