.book-library,.book-pages-panel,.book-export{min-width:0;padding:1.3rem;border:1px solid #dce5ec;border-radius:24px;background:#fffdf8;box-shadow:0 8px 26px #153d660b}
.blank-sheet.has-saved-preview::before{display:none}
.blank-sheet.has-saved-preview{box-shadow:none}
.book-library-heading,.book-pages-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.book-library h2,.book-export h2,.book-pages-panel h2{font-size:clamp(1.35rem,2vw,1.8rem);margin:0;color:#153d66}
.book-library .kicker,.book-export .kicker{margin:0 0 .3rem}
.book-library-choice{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin:1rem 0}
.book-library-choice>img{width:64px;height:90px;object-fit:contain;border-radius:7px}
.book-library-choice>img.is-single-cover{padding:3px}
.thumbnail-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.thumbnail-actions .soft-button{min-height:44px;font-size:.875rem;padding:6px 10px}
.reset-collection{color:#9c3342;border-color:#d7abb3;background:#fffafa}
.template-panel .panel-heading{flex-wrap:wrap}
.single-overview-actions{margin-left:auto}
.studio-reset-dialog{width:min(520px,calc(100% - 32px));max-height:90dvh;overflow:auto;border:1px solid #cedce4;border-radius:22px;padding:26px;background:#fffdf8;color:#20364d;box-shadow:0 18px 70px #153d6633}
.studio-reset-dialog::backdrop{background:#153d6680}
.studio-reset-dialog h2{font-size:1.45rem;line-height:1.3;color:#153d66;margin:0 0 14px}
.studio-reset-dialog p{font-size:1rem;line-height:1.6}
.reset-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:20px}
.reset-dialog-actions button{min-height:44px;font:inherit;font-weight:800;padding:10px 16px}
.book-library-choice>div{flex:1;min-width:min(100%,240px)}
.book-library-choice label,.book-pdf-options label{display:grid;gap:.35rem;font-size:1rem;font-weight:800}
.book-library select,.book-export select{font:inherit;background:#fff;color:#20364d;border:1px solid #bccbd7;border-radius:12px;padding:.65rem 2rem .65rem .7rem;width:100%;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23153d66' stroke-width='2' d='m5 8 5 5 5-5'/%3E%3C/svg%3E");background-position:right .6rem center;background-repeat:no-repeat}
.book-library-choice p,.book-local-note,.book-pages-help{font-size:.875rem;line-height:1.5;margin:.5rem 0;color:#466178}
.studio-save-status{font-size:.875rem;font-weight:800;color:#276449;margin:0}
.studio-save-status[data-state="error"]{color:#a32434}
.studio-save-status[data-state="busy"]{color:#735121}
.book-thumbnails{display:flex;gap:.75rem;overflow-x:auto;overscroll-behavior-inline:contain;padding:.5rem .2rem 1rem;scrollbar-color:#ef615d #e6edf2;scrollbar-width:auto}
.book-thumb{position:relative;flex:0 0 118px;min-width:0;padding:6px;border:2px solid #e0e7ed;border-radius:14px;background:#fff}
.book-thumb.is-current{border-color:#153d66;background:#f0f8fa}
.book-thumb-open{display:block;width:100%;padding:0;border:0;background:transparent;color:#153d66;cursor:pointer;text-align:left;font:inherit}
.book-thumb-open img{display:block;width:100%;height:144px;object-fit:contain;background:white;border-radius:7px}
.book-thumb-open span{display:block;margin-top:.35rem;font-size:.875rem;font-weight:800;line-height:1.25}
.book-thumb-open small{display:block;font-size:.8rem;line-height:1.25;margin-top:.25rem;color:#49667a}
.book-thumb-star,.book-page-star{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:0;background:transparent;color:#fff;cursor:pointer;flex-shrink:0}
.book-thumb-star{position:absolute;right:0;top:0;z-index:1}
.book-thumb-star svg,.book-page-star svg{width:25px;height:25px;fill:currentColor;filter:drop-shadow(0 1px 1.5px #153d6699);pointer-events:none}
.book-thumb-star[aria-pressed="true"],.book-page-star[aria-pressed="true"]{color:#ffc93c}
.book-thumb-star:hover svg,.book-page-star:hover svg{transform:scale(1.08)}
.single-template-item{position:relative;display:grid;min-width:0;scroll-snap-align:start}
.single-template-item>.template-card{width:100%;height:100%}
.single-template-item>.book-thumb-star{right:7px;top:7px}
.book-navigation:not([hidden]){display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.75rem}
.book-navigation>strong{font-size:.9rem;color:#153d66}
.book-export{margin-top:1.5rem}
.book-export p{max-width:800px;font-size:1rem;line-height:1.6}
.book-project-actions,.book-pdf-options{display:flex;align-items:end;flex-wrap:wrap;gap:.8rem;margin-top:1rem}
.book-pdf-options label{min-width:180px}
.book-export button,.book-library button,.book-navigation button{min-height:44px}
.book-library .soft-button,.book-navigation .soft-button,.book-pages-panel .soft-button{font-size:.875rem}
.studio-page [hidden]{display:none!important}
.studio-page button:disabled{cursor:wait;opacity:.55}
.studio-page button:focus-visible,.studio-page select:focus-visible{outline:3px solid #42b9c1;outline-offset:3px}
.canvas-column.is-changing{opacity:.6}
#paint-canvas.is-panning{cursor:grabbing!important}
.canvas-area{display:grid;grid-template-columns:minmax(0,1fr) 56px;gap:12px;align-items:start;width:min(100%,728px);margin:0 auto;min-width:0}
.canvas-area .canvas-viewport{width:100%;min-width:0}
.canvas-area .zoom-control{grid-column:2;grid-row:1;position:sticky;top:86px;align-self:start;display:grid;gap:8px;width:56px;margin:0;padding:0;border:0}
.canvas-area .zoom-heading{display:grid;justify-content:center;gap:3px;text-align:center;font-size:.875rem}
.canvas-area .zoom-buttons{grid-template-columns:1fr;gap:8px}
.canvas-area .zoom-button{display:grid;place-items:center;min-height:48px;width:56px;padding:8px}
.canvas-area .zoom-button svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.canvas-area .zoom-control p{display:none}
.save-row{width:min(100%,728px)}
@media(max-width:600px){.canvas-area{grid-template-columns:minmax(0,1fr) 48px;gap:8px}.canvas-area .zoom-control,.canvas-area .zoom-button{width:48px}.single-template-item>.book-thumb-star{right:5px;top:5px}}
@media(max-width:600px){.book-library,.book-pages-panel,.book-export{padding:1rem;border-radius:18px}.book-library-choice>.button{width:100%}.book-navigation{gap:.4rem}.book-navigation .soft-button{padding:.5rem}.book-thumb{flex-basis:106px}.book-thumb-open img{height:132px}.book-pdf-options label,.book-pdf-options .button{width:100%}.book-project-actions button{flex:1}.book-export{margin-top:1rem}}
@media(min-width:821px){.studio-focus-mode .book-library,.studio-focus-mode .book-pages-panel,.studio-focus-mode .book-export{display:none}.studio-focus-mode .canvas-column{grid-template-rows:auto auto minmax(0,1fr) auto}.studio-focus-mode .book-navigation{grid-row:1}.studio-focus-mode .canvas-heading{grid-row:2}.studio-focus-mode .canvas-area{grid-row:3;display:flex;justify-content:center;align-items:stretch;width:100%;height:100%;min-height:0}.studio-focus-mode .canvas-area .canvas-viewport{width:auto;max-width:calc(100% - 68px);height:100%;min-height:0;margin:0}.studio-focus-mode .canvas-area .zoom-control{position:static;flex:0 0 56px}.studio-focus-mode .save-row{grid-row:4}.studio-focus-mode .book-navigation{margin-bottom:.4rem}}
@media(prefers-reduced-motion:no-preference){.canvas-column{transition:opacity .14s ease}.canvas-frame.is-turning{animation:studio-page-turn .25s ease-out}}
@keyframes studio-page-turn{from{opacity:.6;transform:perspective(900px) rotateY(-4deg) translateX(5px)}to{opacity:1;transform:perspective(900px) rotateY(0) translateX(0)}}
.studio-intro .studio-privacy-intro{font-size:1rem;line-height:1.6;margin:1rem auto;max-width:760px}
.canvas-top-actions,.canvas-history,.canvas-view-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.canvas-top-actions{justify-content:space-between;margin:0 0 8px;min-width:0}
.history-icon,.sheet-view-button{min-height:44px;border:2px solid #d7e0e8;border-radius:12px;background:#fff;color:#153d66;font:inherit;font-size:.875rem;font-weight:800;cursor:pointer}
.history-icon{width:44px;padding:0;font:500 1.65rem/1 sans-serif}
.sheet-view-button{padding:6px 12px}
.sheet-view-button[aria-pressed="true"]{background:#153d66;border-color:#153d66;color:#fff}
.canvas-top-actions .focus-mode-button{min-height:44px}
.book-export-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}
.book-export-card{min-width:0;padding:20px;border:1px solid #d9e5e7;border-radius:18px;background:#f4f9f8}
.book-export-card h3{font-size:1.2rem;line-height:1.35;color:#153d66;margin:0 0 12px}
.book-export-card .book-pdf-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.book-export-card .book-pdf-options label{min-width:0}
.book-export-card .book-pdf-options button{grid-column:1/-1}
.book-export-card .book-project-actions button{font-size:.875rem}
.studio-note>div{grid-template-columns:repeat(3,minmax(0,1fr))}
.studio-note p{text-align:left;font-size:1rem;line-height:1.55}
.studio-wide-sheet .canvas-area{display:grid;width:100%;max-width:none;align-items:start}
.studio-wide-sheet .canvas-area .canvas-viewport{display:block;width:100%;max-width:100%;height:clamp(260px,65dvh,640px);max-height:none;margin:0;overflow:auto;overscroll-behavior:contain;border:1px solid #cbd9e2;border-radius:16px;background:#eaf0f3;scrollbar-width:auto;scrollbar-color:#8ba6b9 #e2ebef;scrollbar-gutter:stable}
.studio-wide-sheet .canvas-area .canvas-frame{width:max(100%,520px);max-width:none;height:auto;max-height:none;margin:0;border-radius:10px}
@media(min-width:821px){
  .studio-focus-mode .canvas-column{grid-template-rows:auto auto auto minmax(0,1fr) auto}
  .studio-focus-mode .canvas-top-actions{grid-row:2}
  .studio-focus-mode .canvas-heading{grid-row:3}
  .studio-focus-mode .canvas-area{grid-row:4}
  .studio-focus-mode .save-row{grid-row:5}
  .studio-focus-mode.studio-wide-sheet .canvas-area{display:grid;grid-template-columns:minmax(0,1fr) 56px;align-items:start}
  .studio-focus-mode.studio-wide-sheet .canvas-area .canvas-viewport{width:100%;height:100%;max-width:100%;min-height:0}
  .studio-focus-mode.studio-wide-sheet .canvas-area .canvas-frame{width:max(100%,520px);height:auto;max-width:none;max-height:none}
}
@media(max-width:900px){.book-export-columns{grid-template-columns:1fr}.studio-note>div{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.canvas-top-actions{align-items:flex-start}.canvas-view-actions{margin-left:auto}.sheet-view-button{font-size:.875rem;padding:6px 8px}.book-export-card{padding:16px}.studio-note>div{grid-template-columns:1fr}.book-export-card .book-pdf-options{grid-template-columns:1fr}}
