.more-tools{position:relative;flex-shrink:0}.more-tools summary{list-style:none;border:1px solid var(--line);background:#fff;padding:8px;border-radius:7px;font-size:12px}.more-tools .menu-panel{position:fixed;inset:auto auto auto auto;width:220px;max-height:65vh;overflow:auto}.more-tools button{display:flex;width:100%;border:0;justify-content:flex-start}.rich-toolbar,.dialog-buttons{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.rich-toolbar label{margin:0;max-width:80px}.rich-toolbar input{width:100%}#richStoryEditor{margin-top:14px;border:1px solid var(--line);border-radius:7px;min-height:260px;max-height:50vh;overflow:auto;padding:10px}#richStoryEditor .ProseMirror{outline:none;min-height:240px;white-space:pre-wrap;overflow-wrap:break-word;line-height:1.5}#richStoryEditor p{margin:0 0 8px;color:inherit}.ProseMirror-selectednode{outline:2px solid var(--accent)}#templateGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.template-choice{display:flex;flex-direction:column;align-items:flex-start;text-align:start;min-height:90px;padding:14px}.template-choice strong{font-size:15px;color:var(--accent)}.template-choice span{font-size:12px;color:var(--muted);line-height:1.5}#masterModeNotice{background:#ffefcf;padding:5px;color:#674513;font-size:11px}.object.master-object{pointer-events:none}.group-selection{position:absolute;pointer-events:none;outline:1pt dashed var(--accent);z-index:40}.group-selection .resize-handle{pointer-events:auto}.drawing-mode .page-surface{cursor:crosshair}.object-table{border-collapse:collapse;width:100%;table-layout:fixed;font:12pt/1.4 Arial}.object-table th,.object-table td{border:.75pt solid #b9b1cd;padding:6pt;overflow-wrap:anywhere;vertical-align:top}.object-table th{background:#ede7fb;color:#34205c;text-align:start}#mastersDialog,#templateDialog{width:min(700px,calc(100vw - 28px))}@media(max-width:600px){#templateGrid{grid-template-columns:1fr}.rich-toolbar button{font-size:11px}}

.shapes-tools summary{display:flex;align-items:center;gap:6px;cursor:pointer}.shapes-tools svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}.layer-row{display:grid;grid-template-columns:minmax(0,1fr) 76px;align-items:center;gap:6px}.layer-row input{width:76px;accent-color:var(--accent)}#transparencyValue{font-size:12px;color:var(--muted)}

#objectContextMenu{position:fixed;z-index:1000;width:230px;max-height:calc(100dvh - 16px);overflow:auto;padding:6px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 10px 35px #34205c33}#objectContextMenu button{display:flex;width:100%;text-align:start;justify-content:flex-start;border:0;border-radius:4px;font-size:12px}.toolbar button[aria-pressed=true]{background:var(--accent);color:#fff}body.preview-mode .preview-pages.facing{display:grid;grid-template-columns:repeat(2,max-content);gap:0 2px}body.preview-mode .preview-pages.facing .publication-page:first-child{grid-column:2}body.preview-mode .preview-pages.facing .publication-page{margin-bottom:20px}@media(max-width:780px){body.preview-mode .preview-pages.facing{display:block}}

#templateLibraryDialog{width:min(1080px,calc(100vw - 24px))}.library-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px}.library-filters label{margin:8px 0;min-width:0}.library-filters input,.library-filters select{min-width:0;max-width:100%}#libraryGrid{height:52vh;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));align-content:start;gap:14px;padding:5px}.library-card{display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:12px;text-align:start;min-height:288px;white-space:normal}.library-card strong{font-size:13px}.library-card>span{font-size:12px;color:var(--muted)}.library-preview{width:178px;height:220px;position:relative;overflow:hidden;background:#f0edf5;pointer-events:none}.library-preview .object-image{object-fit:cover}@media(max-width:600px){.library-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#libraryGrid{grid-template-columns:1fr 1fr}.library-card{padding:6px}.library-preview{width:145px}.library-card strong{font-size:11px}}
