.book-toolbar { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:8px 0 24px; flex-wrap:wrap; }
.book-toolbar p { color:var(--muted); margin:9px 0 0; }
.book-toolbar h2 { font-size:2rem; }
.book-actions { display:flex; gap:8px; flex-wrap:wrap; }
#books button { border:1px solid var(--line); background:white; color:var(--ink); border-radius:8px; padding:9px 12px; font:inherit; font-size:13px; }
#books button:hover { background:#eff6ff; border-color:#93b4ec; }
#books button:disabled { opacity:.4; cursor:default; }
#books button.book-primary { background:var(--accent); color:white; border-color:var(--accent); }
#books button:focus-visible, #books a:focus-visible { outline:3px solid #60a5fa; outline-offset:3px; }
.book-layout { display:grid; grid-template-columns:310px minmax(0,1fr); gap:24px; align-items:start; }
.book-sidebar, .book-main { min-width:0; }
.book-panel { background:white; padding:20px; border:1px solid var(--line); border-radius:14px; margin-bottom:18px; }
.book-panel h3 { font-size:16px; margin:0 0 15px; }
.book-panel label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:650; margin:12px 0; }
.book-panel input:not([type=checkbox]), .book-panel select, .book-panel textarea { width:100%; min-width:0; padding:10px; border:1px solid var(--line); border-radius:7px; color:var(--ink); background:white; font:inherit; font-weight:400; }
.book-panel textarea { resize:vertical; min-height:200px; line-height:1.65; }
.book-panel .book-check { flex-direction:row; align-items:center; font-weight:400; }
.book-check input { width:16px; height:16px; }
.book-muted, .book-print-tip { font-size:12px; color:var(--muted); line-height:1.6; margin:8px 0; }
.book-panel-heading, .book-preview-heading { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.book-panel-heading h3 { margin:0; }
.book-outline-row { display:flex; align-items:center; gap:3px; margin:6px 0; border-radius:8px; border:1px solid transparent; }
.book-outline-row.selected { background:#eff6ff; border-color:#bfdbfe; }
#books .book-outline-select { flex:1; min-width:0; text-align:left; border:0; background:transparent; overflow-wrap:anywhere; }
.book-outline-select small { display:block; font-size:11px; color:var(--muted); margin-top:4px; }
#books .book-move { padding:6px; border:0; background:transparent; }
.book-editor-grid { display:grid; grid-template-columns:2fr 1fr 1fr; gap:12px; }
.book-editor-grid label { min-width:0; }
.book-live-badge { border-radius:20px; background:#e8f8f0; color:#15734a; padding:7px 10px; font-size:11px; }
.book-preview-heading h3 { margin:0; }
.book-preview { display:grid; gap:22px; justify-items:center; padding:20px 0; overflow:hidden; }
.book-sheet { position:relative; width:calc(816px * var(--book-scale, 1)); height:calc(1056px * var(--book-scale, 1)); flex:none; }
.book-sheet > article { transform:scale(var(--book-scale,1)); transform-origin:top left; }
.book-page { position:relative; display:block; width:816px; height:1056px; padding:48px; margin:0; color:#172033; background:white; box-shadow:var(--shadow); overflow:hidden; font-family:Arial,sans-serif; }
.book-body { height:880px; overflow:hidden; font-size:16px; line-height:1.65; overflow-wrap:anywhere; }
.book-body h2 { font-size:30px; line-height:1.3; margin:0 0 25px; white-space:pre-wrap; }
.book-body p { margin:0 0 16px; white-space:pre-wrap; }
.book-running-title { display:none; }
.book-page-footer { position:absolute; bottom:25px; left:48px; right:48px; display:flex; justify-content:flex-end; gap:20px; border-top:1px solid #e2e8f0; padding-top:10px; font-size:11px; color:#64748b; }
.book-page-footer span:first-child { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.book-cover .book-body { display:flex; flex-direction:column; justify-content:center; border-top:12px solid #2563eb; }
.book-cover h2 { font-size:48px; }
.book-cover .book-subtitle { font-size:23px; color:#64748b; }
.book-cover .book-author { margin-top:50px; }
.book-toc-row { display:flex; align-items:baseline; gap:10px; padding:8px 0; font-size:16px; line-height:1.4; text-decoration:none; color:inherit; break-inside:avoid; }
.book-toc-row .book-toc-name { max-width:610px; white-space:pre-wrap; }
.book-toc-row .book-dots { flex:1; border-bottom:1px dotted #a0aec0; min-width:12px; }
.book-toc-row strong { min-width:30px; text-align:right; }
.book-toc-row.level-2 { padding-left:20px; }
.book-toc-row.level-3 { padding-left:40px; }
.book-toc.colorful .level-1 { background:#e9f1ff; color:#174b9e; font-weight:bold; border-radius:6px; padding:10px; margin:10px 0 3px; }
.book-toc.colorful .level-1:nth-of-type(3n) { background:#e4f7ef; color:#167451; }
.book-toc.colorful .level-1:nth-of-type(3n+1) { background:#fff3d6; color:#785600; }
.book-measure { position:fixed; left:-20000px; top:0; visibility:hidden; pointer-events:none; }
.book-imported > .worksheet-footer { display:none; }
.book-imported > .book-page-footer { background:white; }
@media(max-width:1150px) { .book-layout { grid-template-columns:270px minmax(0,1fr); gap:16px; } .book-editor-grid { grid-template-columns:1fr; gap:0; } }
@media(max-width:800px) { .book-layout { grid-template-columns:1fr; } .book-live-badge { max-width:150px; } }
@media print {
  .book-toolbar, .book-sidebar, #bookEditor, .book-preview-heading, .book-print-tip, .book-measure { display:none !important; }
  .book-layout, .book-main, .book-preview { display:block; padding:0; margin:0; overflow:visible; }
  .book-sheet { width:8.5in; height:10.98in; margin:0; break-after:page; break-inside:avoid; }
  .book-sheet:last-child { break-after:auto; }
  .book-sheet > article { transform:none !important; box-shadow:none; width:8.5in; height:10.98in; margin:0; break-after:auto; }
  .book-page-footer { bottom:25px; }
}
