.visual-mode-bar {display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:.6rem 0}
.visual-mode-bar button[aria-pressed="true"] {background:#005bbb;color:white}
#visual-editor[hidden] {display:none}
body.visual-mode .writing-split, body.visual-mode .format-toolbar {display:none!important}
#visual-editor {min-width:0;max-width:100%;overflow:visible;border:1px solid #b9c8d8;border-radius:10px;background:#fff;color:#172b42;padding:12px}
body.focus-mode #visual-editor {flex:1;min-height:0;overflow:auto}
.pv-toolbar, .pv-add, .pv-block-tools {display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.pv-toolbar {position:sticky;top:calc(var(--header-height, 3.5rem) + var(--editor-actions-height, 4rem));background:#f1f5fa;z-index:5;padding:8px;border-radius:6px;border:1px solid #cfdae6}
.pv-toolbar button, .pv-add button, .pv-block-tools button {font-size:.82rem;padding:5px 9px;min-height:34px}
.pv-toolbar select {width:auto;max-width:160px}
.pv-toolbar label {display:flex;align-items:center;gap:4px;font-size:.8rem}
.pv-toolbar input[type="color"] {padding:2px;width:34px;height:32px}
.pv-toolbar input[type="number"] {width:85px;min-width:0;padding:4px}
.pv-block {border:1px solid #ccd7e3;border-radius:8px;margin:12px 0;min-width:0;overflow:hidden}
.pv-block:focus-within {border-color:#005bbb;box-shadow:0 0 0 1px #005bbb}
.pv-block-tools {padding:5px 8px;background:#f5f7fa;border-bottom:1px solid #dde4ec}
.pv-block-tools span {margin-right:auto;font-size:.8rem;color:#465b73}
.pv-content {padding:14px;min-height:70px;outline:none;overflow-wrap:anywhere;overflow-x:auto;line-height:1.65}
.pv-content img {max-width:100%;height:auto;cursor:pointer}
.pv-content table {border-collapse:collapse;width:100%;table-layout:fixed}
.pv-content td, .pv-content th {border:1px solid #b9c8d8;padding:8px;min-width:30px;overflow-wrap:anywhere}
.pv-content a {color:#005bbb;text-decoration:underline}
.pv-content pre {white-space:pre-wrap}
body #visual-editor .pv-source {display:block;box-sizing:border-box;width:100%;height:auto;min-height:140px;max-height:450px;resize:vertical;font:14px/1.5 monospace;border:0;border-radius:0;padding:12px}
.pv-help {font-size:.85rem;color:#465b73;margin:8px 0}
.pv-selected-image {outline:3px solid #005bbb}
@media(max-width:600px){#visual-editor{padding:6px}.pv-content{padding:10px}.pv-toolbar button{padding:5px 7px}}

#visual-editor .pv-resize-handle {position:fixed;z-index:10;padding:0;width:28px;height:28px;min-width:28px;cursor:ew-resize;touch-action:none;border:2px solid white;border-radius:5px;background:#005bbb;color:white}
#visual-editor .pv-resize-handle[hidden] {display:none}
.pv-video{padding:12px}.pv-video figure{margin:0}.pv-video iframe,.pv-video video{width:100%;max-width:100%;aspect-ratio:16/9;height:auto;border:0}
.pv-media-dialog{box-sizing:border-box;width:min(540px,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;border:1px solid #b9c8d8;border-radius:10px;padding:1.25rem;background:#fff;color:#172b42}
.pv-media-dialog::backdrop{background:#10182799}.pv-media-dialog label{display:grid;gap:.4rem;margin:.8rem 0}.pv-media-dialog textarea,.pv-media-dialog input{box-sizing:border-box;width:100%}.pv-media-dialog textarea{min-height:4rem;resize:vertical}.pv-media-dialog p{line-height:1.5}.pv-media-error{color:#9a3109}

/* Follow the page in normal writing and the editor scroll pane in Focus. */
body.focus-mode .pv-toolbar {top:0}
body.fullscreen-mode:not(.focus-mode) .pv-toolbar {top:var(--editor-actions-height, 4rem)}
#visual-editor .pv-toolbar .pv-icon-button {display:inline-flex;align-items:center;justify-content:center;width:34px;min-width:34px;height:34px;padding:6px;background:transparent;color:#172b42;border:1px solid transparent;border-radius:4px}
.pv-icon-button svg {display:block;width:20px;height:20px;pointer-events:none}
#visual-editor .pv-toolbar .pv-icon-button:hover {background:#dfe9f4;border-color:#a8b6c7}
#visual-editor .pv-toolbar .pv-icon-button:focus-visible {outline:2px solid #005bbb;outline-offset:2px}
#visual-editor .pv-toolbar .pv-icon-button:disabled {opacity:.4}
@media(max-width:600px){#visual-editor .pv-toolbar .pv-icon-button{width:36px;min-width:36px;height:36px}.pv-toolbar{gap:4px;padding:6px}}
