:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e2e4e7;
  --text: #1e1e1e;
  --muted: #646970;
  --accent: #3858e9;
  --accent-soft: #eef2ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
body.modal-open { overflow: hidden; }
button { font: inherit; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Rustige bovenbalk: op desktop alleen Nieuw, Ongedaan en HTML. */
.topbar {
  min-height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 20px; margin: 2px 0 0; font-weight: 650; }
.topbar h1 span { color: var(--muted); font-weight: 500; font-size: 14px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
.toolbar button, .modal-actions button, .source-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.toolbar button:hover, .toolbar button.active, .source-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.mobile-blocks-button { display: none; }
#toolbarBlockCount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 5px; background: #f0f0f1; border-radius: 10px; font-size: 11px; color: var(--muted); }

/* Desktop: ongeveer 1/4 blokken en 3/4 tekst, beide blijvend zichtbaar. */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(290px, 25vw, 390px) minmax(0, 1fr);
  align-items: stretch;
}
.workspace.sidebar-closed { grid-template-columns: clamp(290px, 25vw, 390px) minmax(0, 1fr); }
.sidebar {
  min-width: 0;
  height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
  align-self: start;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 12px 10px 20px;
  z-index: 12;
}
.workspace.sidebar-closed .sidebar { display: block; }
.sidebar-backdrop { display: none !important; }
.sidebar-head {
  position: sticky;
  top: -12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -12px -10px 0;
  padding: 12px 12px 9px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.sidebar-head-actions { display: flex; align-items: center; gap: 7px; }
.sidebar-head span { min-width: 24px; height: 24px; border-radius: 12px; background: #f0f0f1; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.icon-button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); }
.icon-button:hover { background: #f0f0f1; color: var(--text); }
#closeBlocks { display: none; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 10px 3px; }
.empty-outline { border: 1px dashed var(--line); border-radius: 6px; padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.block-actions {
  position: sticky;
  top: 48px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.98);
}
.block-actions #selectedCount { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 600; }
.block-actions button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 6px 7px; font-size: 12px; cursor: pointer; }
.block-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.block-actions button:disabled { opacity: .42; cursor: default; }
.block-actions button.danger:hover:not(:disabled) { border-color: #b32d2e; color: #b32d2e; background: #fff5f5; }

.outline { display: flex; flex-direction: column; gap: 2px; }
.outline-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.outline-item:hover { background: #f6f7f7; }
.outline-item.active { border-color: #7386ef; background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.outline-item:focus { outline: 2px solid #a7b3f7; outline-offset: 1px; }
.outline-item.drag-over { box-shadow: inset 0 -2px 0 var(--accent); }
.outline-item.dragging { opacity: .45; }
.selection-box { width: 16px; height: 16px; border: 1px solid #949494; border-radius: 3px; display: grid; place-items: center; font-size: 11px; line-height: 1; background: #fff; }
.outline-item.active .selection-box { border-color: var(--accent); background: var(--accent); color: #fff; }
.outline-item.active .selection-box::after { content: "✓"; font-weight: 700; }
.block-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.block-type { display: block; color: var(--muted); font-size: 9px; line-height: 1.2; text-transform: uppercase; letter-spacing: .07em; }
.block-label { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; line-height: 1.35; }
.drag-handle { width: 20px; text-align: center; color: #8c8f94; font-size: 13px; letter-spacing: -3px; cursor: grab; user-select: none; overflow: visible; }
.drag-handle:active { cursor: grabbing; }

/* Tekstvlak: niet meer als smalle 'kaart', maar breed zoals ChatGPT. */
.canvas-wrap { min-width: 0; padding: 18px 34px 48px; background: #fff; }
.statusbar { margin: 0 0 8px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; min-height: 18px; }
.dot { opacity: .5; }
.editor-content {
  width: 100%;
  min-height: 72vh;
  margin: 0;
  background: #fff;
  padding: 24px 18px 70px;
  border: 0;
  box-shadow: none;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  color: #1f1f1f;
}
.editor-content:focus { outline: none; }
.editor-content > *:first-child { margin-top: 0; }
.editor-content > *:last-child { margin-bottom: 0; }
.editor-content p { margin: 0 0 1.15em; }
.editor-content h1, .editor-content h2, .editor-content h3, .editor-content h4 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: #171717;
}
.editor-content h1 { font-size: 2em; margin: 1.45em 0 .7em; }
.editor-content h2 { font-size: 1.48em; margin: 1.55em 0 .72em; }
.editor-content h3 { font-size: 1.2em; margin: 1.4em 0 .62em; }
.editor-content h4 { font-size: 1.05em; margin: 1.3em 0 .55em; }
.editor-content ul, .editor-content ol { padding-left: 1.55em; margin: .75em 0 1.15em; }
.editor-content li { margin: .2em 0; padding-left: .08em; }
.editor-content ul ul, .editor-content ol ol, .editor-content ul ol, .editor-content ol ul { margin-top: .25em; margin-bottom: .25em; }
.editor-content strong { font-weight: 700; }
.editor-content em { font-style: italic; }
.editor-content blockquote { border-left: 3px solid #949494; margin: 1.2em 0; padding: .2em 0 .2em 1em; color: #3c434a; }
.editor-content a { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; }
.editor-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: #f0f0f1; padding: .08em .28em; border-radius: 3px; }
.editor-content pre { overflow: auto; padding: 16px; background: #1e1e1e; color: #f5f5f5; border-radius: 6px; line-height: 1.45; }
.editor-content pre code { background: transparent; padding: 0; }
.editor-content table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  margin: 1.05em 0 1.55em;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.55;
}
.editor-content thead { border-bottom: 1px solid #cfcfcf; }
.editor-content th, .editor-content td { border: 0; border-bottom: 1px solid #ececec; padding: 10px 20px 10px 0; vertical-align: top; text-align: left; background: transparent; }
.editor-content th { font-weight: 650; color: #111; }
.editor-content th:last-child, .editor-content td:last-child { padding-right: 0; }
.editor-content tbody tr:last-child td { border-bottom: 0; }
.editor-content hr { border: 0; border-top: 1px solid #d7d7d7; margin: 2em 0; }
.editor-content img { max-width: 100%; height: auto; }
.editor-content [data-block-selected="true"] { outline: 2px solid #8ea0ff; outline-offset: 5px; border-radius: 2px; background: rgba(56,88,233,.035); }
.panel { width: 100%; margin: 18px 0 0; }
.preview-content { min-height: 0; }
.footer-note { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; padding: 9px 16px; text-align: center; }

/* HTML-weergave */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-card { position: relative; width: min(1000px, 96vw); max-height: 90vh; background: #fff; border-radius: 8px; box-shadow: 0 20px 70px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 2px 0 0; font-size: 20px; }
.modal-close { border: 0; background: transparent; font-size: 30px; line-height: 1; width: 40px; height: 40px; cursor: pointer; border-radius: 5px; color: var(--muted); }
.modal-close:hover { background: #f0f0f1; color: var(--text); }
.source-tabs { display: flex; gap: 8px; padding: 12px 18px 0; }
.source-hint { margin: 9px 18px 8px; }
#sourceView { margin: 0 18px; white-space: pre-wrap; overflow-wrap: anywhere; background: #111827; color: #e5e7eb; border-radius: 6px; padding: 18px; font-size: 12px; line-height: 1.5; min-height: 180px; flex: 1; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }

/* Tablet/mobiel: blokken wordt weer een lade; knop verschijnt alleen daar. */
@media (max-width: 900px) {
  .topbar { align-items: center; gap: 10px; padding: 10px 12px; }
  .toolbar { margin-left: auto; overflow-x: auto; max-width: 72vw; }
  .mobile-blocks-button { display: inline-flex; align-items: center; }
  .workspace, .workspace.sidebar-closed { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(390px, 92vw);
    height: 100vh;
    min-height: 0;
    padding: 14px 12px 20px;
    z-index: 70;
    box-shadow: 9px 0 30px rgba(0,0,0,.18);
    transform: translateX(0);
    transition: transform .16s ease;
  }
  .workspace.sidebar-closed .sidebar { display: block; transform: translateX(-104%); }
  .sidebar-backdrop { display: block !important; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.22); }
  .sidebar-backdrop.hidden, .workspace.sidebar-closed .sidebar-backdrop { display: none !important; }
  #closeBlocks { display: inline-grid; place-items: center; }
  .canvas-wrap { padding: 12px 12px 28px; }
  .editor-content { padding: 22px 10px 48px; font-size: 16px; line-height: 1.58; overflow-x: auto; }
  .editor-content table { min-width: 720px; font-size: .98em; }
  .editor-content th, .editor-content td { padding: 9px 12px 9px 0; }
  .statusbar { flex-wrap: wrap; }
  .modal { padding: 8px; }
  .modal-card { width: 100%; max-height: 96vh; }
  #sourceView { margin: 0 10px; }
  .source-hint { margin-left: 10px; margin-right: 10px; }
  .source-tabs { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .toolbar { margin-left: 0; max-width: 100%; width: 100%; }
  .toolbar button { padding: 7px 9px; }
  .sidebar { width: 94vw; }
}

/* v0.1.6 — desktop dwingt WP-achtige vaste tweekolomsweergave af.
   De versiequery in index.php voorkomt dat een oude overlay-CSS uit de browsercache blijft hangen. */
@media (min-width: 901px) {
  .workspace,
  .workspace.sidebar-closed {
    display: grid !important;
    grid-template-columns: minmax(300px, 25vw) minmax(0, 1fr) !important;
  }
  .sidebar,
  .workspace.sidebar-closed .sidebar {
    display: block !important;
    position: sticky !important;
    top: 68px !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: calc(100vh - 68px) !important;
    transform: none !important;
    box-shadow: none !important;
  }
  .sidebar-backdrop { display: none !important; }
  .mobile-blocks-button, #closeBlocks { display: none !important; }
}

.insert-panel {
  margin: 10px 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.panel-label,
.clipboard-state {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.insert-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 6px;
  margin-top: 7px;
}
.insert-actions button,
.editbar button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  padding: 6px 8px;
  cursor: pointer;
}
.insert-actions button:hover,
.editbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.block-actions { position: static; top: auto; }
.clipboard-state {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.editbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  position: sticky;
  top: 78px;
  z-index: 8;
}
.editbar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-right: 2px;
}
.editbar-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 2px;
}

@media (max-width: 900px) {
  .editbar { top: 8px; overflow-x: auto; }
}

/* v0.2 documentbestanden */
.brand { flex: 0 0 auto; }
.title-wrap {
  flex: 1 1 360px;
  max-width: 560px;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.title-wrap span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.title-wrap input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
}
.title-wrap input:hover { border-color: var(--line); }
.title-wrap input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 1px var(--accent); }
#saveState.dirty { color: #8a4b08; }
#saveState.saved { color: #2c6e49; }
.editor-content [data-block-selected="true"] { outline: 2px solid #8ea0ff; outline-offset: 5px; border-radius: 2px; background: rgba(56,88,233,.035); }

@media (max-width: 1150px) and (min-width: 901px) {
  .topbar { flex-wrap: wrap; }
  .title-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .sidebar { top: 112px !important; height: calc(100vh - 112px) !important; }
}

@media (max-width: 900px) {
  .title-wrap { width: 100%; max-width: none; }
}

@media print {
  .topbar,
  .sidebar,
  .sidebar-backdrop,
  .statusbar,
  .editbar,
  .modal { display: none !important; }
  html, body, .app-shell, .workspace, .canvas-wrap { display: block !important; width: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .editor-content {
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }
  .editor-content [data-block-selected="true"] { outline: 0 !important; background: transparent !important; }
}

/* v0.2.6: kaderacties in de blokkenkolom */
#addFrameBlocks, #removeFrameBlocks { font-size: 11px; }

/* v0.4 — boek samenstellen */
.compose-card { width: min(980px, 96vw); }
.compose-body { padding: 14px 18px 6px; overflow: auto; }
.compose-top { display: grid; grid-template-columns: auto minmax(240px,1fr); gap: 12px; align-items: end; margin: 8px 0 12px; }
.compose-add-actions button,
.compose-actions button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 11px; cursor: pointer; }
.compose-add-actions { display:flex; flex-wrap:wrap; gap:7px; }
.compose-title-label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.compose-title-label input { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 8px 9px; font: inherit; color: var(--text); }
.compose-options { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; font-size: 12px; color: #3c434a; }
.compose-options label { display: inline-flex; align-items: center; gap: 6px; }
.book-parts-list { display: flex; flex-direction: column; gap: 6px; }
.book-part { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: #fff; }
.book-part.drag-over { box-shadow: inset 0 -3px 0 var(--accent); }
.book-part-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #f0f0f1; color: var(--muted); font-size: 11px; font-weight: 700; }
.book-part-main { min-width: 0; }
.book-part-title { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-part-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-part-actions { display: flex; gap: 4px; }
.book-part-actions button { border: 1px solid var(--line); background: #fff; border-radius: 4px; width: 30px; height: 30px; cursor: pointer; }
.book-part-actions button:hover { border-color: var(--accent); color: var(--accent); }
.compose-actions .primary-action { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 650; }
.compose-actions .primary-action:disabled { opacity: .45; cursor: default; }

@media (max-width: 700px) {
  .compose-top { grid-template-columns: 1fr; }
  .book-part { grid-template-columns: 30px minmax(0,1fr); }
  .book-part-actions { grid-column: 2; }
}
.book-part-title-input { width:100%; border:1px solid transparent; border-radius:4px; padding:4px 5px; margin:-4px -5px 0; font:inherit; font-size:13px; font-weight:650; color:var(--text); background:transparent; }
.book-part-title-input:hover { border-color:var(--line); background:#fff; }
.book-part-title-input:focus { outline:none; border-color:var(--accent); background:#fff; box-shadow:0 0 0 1px var(--accent); }

/* Zelfstandige vectorformules: ook zichtbaar in HTML-export en afdruk/PDF. */
.notes-math{display:inline-block;vertical-align:middle;max-width:100%;font-size:1em;line-height:1.2;cursor:default;}
.notes-math svg{max-width:100%;height:auto;overflow:visible;vertical-align:middle;}
.notes-math-display{display:block;text-align:center;margin:1.15em 0;break-inside:avoid;page-break-inside:avoid;}
.notes-math-display svg{display:inline-block;}
.editor-content .notes-math:hover{outline:1px dotted #999;outline-offset:3px;}

/* v0.4.6 – mobiel: bovenbalken in eigen horizontale scrollzone, geen pagina-overloop */
html,body,.app-shell,.workspace,.canvas-wrap{max-width:100%;min-width:0;}
.editor-content{overflow-wrap:anywhere;word-break:normal;}
.editor-content pre,.editor-content table,.editor-content .notes-math-display{max-width:100%;overflow-x:auto;}
.editor-content .notes-math-display{display:block;}
.editor-content .notes-math-display svg{max-width:none;}
.notes-source-note{font-size:.88em;color:#596272;border-left:3px solid #d5dce7;padding:.5em .8em;margin:1em 0;}
@media(max-width:900px){
 .topbar{position:relative;top:auto;display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;min-width:0;}
 .topbar .brand{max-width:100%;min-width:0;}
 .topbar .eyebrow{overflow-wrap:anywhere;}
 .topbar .title-wrap{order:2;flex:1 1 100%;min-width:0;width:100%;}
 .topbar .toolbar{order:3;justify-content:flex-start;display:flex;flex-wrap:nowrap;max-width:100%;width:100%;min-width:0;margin:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding-bottom:6px;}
 .toolbar button{flex:0 0 auto;}
 .canvas-wrap{width:100%;max-width:100%;min-width:0;padding:8px 12px 28px;overflow:visible;}
 .statusbar{overflow-wrap:anywhere;}
 .editbar{position:sticky;top:0;display:flex;flex-wrap:nowrap;width:100%;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;justify-content:flex-start;gap:6px;}
 .editbar button,.editbar .editbar-sep{flex:0 0 auto;white-space:nowrap;}
 .editor-content{width:100%;max-width:100%;min-width:0;overflow-x:visible;padding:14px 2px 40px;font-size:16px;line-height:1.6;}
 .editor-content table{display:block;overflow-x:auto;max-width:100%;min-width:0;}
 .editor-content img{max-width:100%;height:auto;}
}
@media(max-width:620px){
 .topbar{align-items:stretch;flex-direction:row;}
 .topbar .brand h1{font-size:19px;}
 .toolbar{max-width:100%;}
}

/* v0.4.6.4 – uitsluitend betere bereikbaarheid van knoppen in de zijbalk. */
@media (min-width: 901px) {
  .workspace, .workspace.sidebar-closed {
    grid-template-columns: clamp(335px, 29vw, 410px) minmax(0, 1fr) !important;
  }
}
.sidebar { overflow-x: hidden; }
.insert-actions, .block-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0; width: 100%;
}
.insert-actions > *, .block-actions > * { min-width: 0; max-width: 100%; }
.insert-actions button, .block-actions button {
  white-space: normal; overflow-wrap: break-word; word-break: normal;
  min-width: 0; max-width: 100%; text-align: center;
  line-height: 1.35; min-height: 36px;
}
.block-actions #selectedCount,
.block-actions .notes-selection-action,
.block-actions #applySelectionOperation,
.block-actions #clearBlocks,
.block-actions .clipboard-state {grid-column: 1 / -1;}
.block-actions .notes-selection-action {
  display: flex; flex-direction: column; gap: 6px;
  width: 100%; font-size: 13px; line-height: 1.35;
}
.block-actions .notes-selection-action select {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  font: inherit; padding: 8px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff;
}
.block-actions #applySelectionOperation {
  background: #eef2ff; border-color: #b5c2ff;
  color: #213db1; font-weight: 650; min-height: 40px;
}
.block-actions #applySelectionOperation:disabled {
  background: #f4f4f4; border-color: var(--line); color: #777;
}
@media (max-width: 900px) {
  .sidebar { overflow-x: hidden; }
}
