/* BookSpace v22.7 writing-first layout: all rules scoped to workshop. */
body.ws .wrap{padding-top:8px;gap:16px;align-items:start}
body.ws #side{position:sticky;top:12px;max-height:calc(100vh - 28px);overflow:auto;scrollbar-width:thin}
body.ws #side .ws-current-book{padding:10px 2px 7px;display:flex;gap:6px;align-items:center;justify-content:space-between;font-size:13px}
body.ws #side .ws-current-book>span{font-weight:700;overflow-wrap:anywhere;max-width:155px}
body.ws #side .ws-current-book>a{font-size:12px;white-space:nowrap}
body.ws .ws-side-tabs{margin-top:12px}
body.ws .ws-book-details{margin-top:16px;border-top:1px solid var(--ln)}
body.ws .ws-publishing{border:1px solid var(--ln);border-radius:9px;margin-top:8px;background:var(--ui)}
body.ws .ws-publishing>summary{cursor:pointer;padding:10px;font-size:12px;font-weight:650}
body.ws .ws-publication-controls{padding:0 9px 10px}
body.ws .ws-publication-controls h5{margin:12px 0 6px}
body.ws #book-publication-actions{display:grid;grid-template-columns:1fr;gap:5px}
body.ws .chapter-schedule{display:grid;gap:7px;padding:8px}
body.ws .chapter-schedule>input{min-width:0;width:100%;box-sizing:border-box}
body.ws .chapter-schedule>small{font-size:12px;white-space:normal;overflow-wrap:anywhere}
body.ws #t-ch .cols{gap:0}
body.ws .chside{width:min(100%,1050px);max-width:1050px;margin:0 auto 4px;display:flex;gap:8px;flex-wrap:nowrap;min-width:0;align-items:center}
body.ws .chside #chl{display:flex;flex:1;flex-wrap:nowrap;gap:5px;min-width:0;overflow:auto hidden;padding-bottom:3px;scrollbar-width:thin}
body.ws .chside .ci{flex:none;min-width:125px;max-width:230px;padding:5px 7px;margin:0;gap:5px}
body.ws .chside .ci b{font-size:12px}
body.ws .chside .ci small{font-size:10px}
body.ws .chside .ci .chapter-scheduled-label{display:none}
body.ws .chside #addch{flex:none;white-space:nowrap}
body.ws #wed>.row{margin-bottom:3px;align-items:center}
body.ws #wed>.row #ct{flex:2;min-width:180px}
body.ws #wed>.row #cs{flex:0 1 225px;width:auto;min-width:190px}
body.ws .ws-editor-head{margin:4px 0 6px;min-height:30px}
body.ws .ws-editor-head .ws-editor-state{display:inline-flex;align-items:center;gap:7px}
body.ws #sv:empty{display:none}
body.ws .ws-editor-actions{gap:4px}
body.ws .ws-editor-actions button{padding:5px 7px}
body.ws #ws-format-toolbar{gap:5px;padding:5px 8px;margin-bottom:4px}
body.ws #ws-format-toolbar button{padding:4px 7px}
body.ws #ws-advanced-toolbar{margin-bottom:6px;padding:10px}
body.ws .ws-paper{margin-top:5px}
body.ws .ws-rich-note{display:none}
body.ws #ws-canvas{min-height:75vh}
body.ws .ws-advanced-settings{display:flex;gap:7px;align-items:center;flex-wrap:wrap;width:100%;padding-bottom:7px;border-bottom:1px solid var(--ln)}
body.ws .ws-advanced-settings label{display:flex;align-items:center;gap:4px}
body.ws #ws-advanced-toolbar .ws-rich-extra{width:100%}
body.ws .ws-side-collapsed #ws-side-content{display:none!important}
@media(max-width:900px){body.ws #side{position:static;max-height:none}body.ws .chside{max-width:100%}body.ws #ws-canvas{min-height:65vh}}
@media(max-width:600px){body.ws .ws-editor-head{align-items:flex-start}body.ws #wed>.row #cs{min-width:140px;flex:1}body.ws .chside .ci{min-width:95px;max-width:160px}}
body.ws #ws-canvas .ws-illustration{display:block;position:relative;max-width:100%;margin:10px auto;min-height:20px;text-align:center;}
body.ws #ws-canvas .ws-illustration img{display:inline-block;width:auto;max-width:100%;height:auto;max-height:500px;object-fit:contain}
#text .ws-rich-reader .ws-illustration{display:block;max-width:100%;margin:8px auto;text-align:center}
#text .ws-rich-reader .ws-illustration img{max-width:100%;height:auto;object-fit:contain}

.ws-illustration-controls{display:grid;gap:10px;margin-top:10px}.ws-illustration-controls details{border:1px solid var(--ln,#4c3553);border-radius:12px;padding:8px 10px;background:#00000012}.ws-illustration-controls summary{cursor:pointer}.ws-illustration-controls .art-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:8px} body.ws #ws-canvas .ws-illustration{display:block;position:relative;max-width:100%;min-height:20px} body.ws #ws-canvas .ws-illustration.ws-ill-block{margin:10px auto;text-align:center;clear:both} body.ws #ws-canvas .ws-illustration.ws-ill-wrap-left{text-align:left} body.ws #ws-canvas .ws-illustration.ws-ill-wrap-right{text-align:right}

/* v22.9: context controls stay accessible while advanced tools are collapsed */
body.ws .ws-illustration-controls:not([hidden]){position:sticky;top:8px;z-index:35;width:min(100%,760px);margin:6px auto 10px;padding:0;background:var(--ui);border:1px solid var(--ln);border-radius:12px;box-shadow:0 8px 28px #0005}
body.ws .ws-illustration-controls[hidden]{display:none!important}
body.ws .ws-illustration-controls details{border:0;background:transparent;margin:0}body.ws .ws-illustration-controls input[type=range]{width:170px}
body.ws #ws-canvas .ws-ill-dragging{opacity:.5;outline:2px dashed var(--ac)}

/* Keep wrapping modes stronger than the editor's generic illustration block rule. */
body.ws #ws-canvas .ws-illustration.ws-ill-wrap-left{display:block!important;float:left!important;clear:none!important;margin:0 16px 12px 0!important}
body.ws #ws-canvas .ws-illustration.ws-ill-wrap-right{display:block!important;float:right!important;clear:none!important;margin:0 0 12px 16px!important}
body.ws #ws-canvas .ws-illustration.ws-ill-block{float:none!important;clear:both!important;margin:12px auto!important}
