.nbr-rich-text { width: 100%; min-width: 0; margin-left: 0; }
.nbr-rich-text textarea { width: 100%; min-height: 250px; }
.nbr-editor-ready { border: 1px solid var(--border-color, #ccd5d0); border-radius: 8px; overflow: hidden; background: var(--body-bg, #fff); color: var(--body-fg, #172a30); }
.nbr-editor-ready textarea[hidden] { display: none !important; }
.nbr-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 10px; background: var(--darkened-bg, #f3f6f4); border-bottom: 1px solid var(--border-color, #ccd5d0); }
.nbr-editor-toolbar button, .nbr-editor-toolbar select, .nbr-editor-toolbar input { margin: 0; min-height: 32px; border: 1px solid transparent; border-radius: 4px; background: var(--body-bg, #fff); color: var(--body-fg, #172a30); font-family: "SolaimanLipi", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif; font-size: 12px; cursor: pointer; }
.nbr-editor-toolbar button { min-width: 32px; padding: 5px 9px; line-height: 1.4; }
.nbr-editor-toolbar select { width: auto; max-width: 180px; padding: 5px; }
.nbr-editor-toolbar input[type="color"] { width: 32px; padding: 3px; }
.nbr-editor-toolbar button:hover, .nbr-editor-toolbar button[aria-pressed="true"] { border-color: var(--link-fg, #436e55); background: var(--selected-bg, #dceadc); }
.nbr-editor-toolbar button:disabled, .nbr-editor-toolbar option:disabled { opacity: .45; cursor: default; }
.nbr-editor-toolbar :focus-visible { outline: 2px solid var(--link-fg, #436e55); outline-offset: 2px; }
.nbr-editor-page { padding: 24px; background: var(--darkened-bg, #f3f6f4); max-height: 65vh; overflow: auto; }
.nbr-editor-document { box-sizing: border-box; width: 100%; min-height: 330px; max-width: none; padding: 38px; margin: 0 auto; outline: none; border: 1px solid var(--border-color, #e0e5e0); box-shadow: 0 2px 6px #0000000a; background: var(--body-bg, #fff); color: var(--body-fg, #172a30); }
.nbr-editor-document, .nbr-rich-text-rendered { font-family: "SolaimanLipi", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif; font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.nbr-editor-document p, .nbr-rich-text-rendered p { font-size: inherit; margin: 0 0 .75em; padding: 0; }
.nbr-editor-document h1, .nbr-editor-document h2, .nbr-editor-document h3 { margin: 1em 0 .5em; padding: 0; background: none; color: inherit; line-height: 1.5; font-weight: 700; }
.nbr-editor-document h1 { font-size: 2em; }
.nbr-editor-document h2 { font-size: 1.5em; }
.nbr-editor-document h3 { font-size: 1.25em; }
.nbr-editor-document ul, .nbr-editor-document ol, .nbr-rich-text-rendered ul, .nbr-rich-text-rendered ol { margin: .75em 0; padding-left: 2em; }
.nbr-editor-document li, .nbr-rich-text-rendered li { font-size: inherit; list-style: inherit; }
.nbr-editor-document ul li, .nbr-rich-text-rendered ul li { list-style-type: disc; }
.nbr-editor-document ol li, .nbr-rich-text-rendered ol li { list-style-type: decimal; }
.nbr-editor-document blockquote, .nbr-rich-text-rendered blockquote { border-left: 3px solid #869e89; margin: 1em 0; padding-left: 1em; color: var(--body-quiet-color, #637063); }
.nbr-editor-document table, .nbr-rich-text-rendered table { border-collapse: collapse; width: 100%; margin: 1em 0; table-layout: fixed; }
.nbr-editor-document td, .nbr-editor-document th, .nbr-rich-text-rendered td, .nbr-rich-text-rendered th { border: 1px solid var(--border-color, #aebdaf); padding: 8px; vertical-align: top; position: relative; min-width: 50px; font-size: inherit; }
.nbr-editor-document th, .nbr-rich-text-rendered th { background: var(--darkened-bg, #edf2ed); font-weight: 700; }
.nbr-editor-document .selectedCell::after { content: ""; position: absolute; inset: 0; background: #8baaf044; pointer-events: none; }
.nbr-editor-document pre { padding: 12px; overflow: auto; background: var(--darkened-bg, #edf2ed); }
.nbr-editor-document a, .nbr-rich-text-rendered a { color: var(--link-fg, #28597b); text-decoration: underline; }
.nbr-editor-status { font-family: "SolaimanLipi", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif; padding: 8px 12px; font-size: 11px; background: var(--darkened-bg, #f3f6f4); border-top: 1px solid var(--border-color, #ccd5d0); }
.nbr-editor-expanded { position: fixed; inset: 16px; width: auto; z-index: 1100; display: flex; flex-direction: column; box-shadow: 0 0 0 100vmax #0009; }
.nbr-editor-expanded .nbr-editor-page { flex: 1; max-height: none; }
.nbr-editor-link-dialog { border: 1px solid var(--border-color, #ccd5d0); border-radius: 8px; padding: 24px; max-width: 420px; width: calc(100% - 32px); color: var(--body-fg, #172a30); background: var(--body-bg, #fff); }
.nbr-editor-link-dialog::backdrop { background: #0006; }
.nbr-editor-link-dialog label { display: block; float: none; margin-bottom: 8px; }
.nbr-editor-link-dialog input { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
.nbr-editor-link-dialog button { padding: 8px 12px; margin-right: 8px; cursor: pointer; }
.nbr-editor-link-error { color: var(--error-fg, #b44034); }
@media (max-width: 767px) {
  .nbr-editor-page { padding: 8px; }
  .nbr-editor-document { padding: 18px; }
  .nbr-editor-expanded { inset: 5px; }
}

/* Shared rendering rules also cover historic CKEditor documents. */
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid #aebdaf; padding: 8px; }
.nbr-editor-document img, .prose img { max-width: 100%; height: auto; }
.nbr-editor-document figure { margin: 1em 0; }
.nbr-editor-document figcaption { text-align: center; font-size: .875em; }
.nbr-editor-document .image-style-align-left { float: left; margin-right: 1em; }
.nbr-editor-document .image-style-align-right, .nbr-editor-document .image-style-side { float: right; margin-left: 1em; }
.nbr-editor-document .image-style-align-center { margin-left: auto; margin-right: auto; }
.nbr-editor-document sub { vertical-align: sub; font-size: .75em; }
.nbr-editor-document sup { vertical-align: super; font-size: .75em; }
.nbr-editor-document mark, .prose mark { background: #fff3a3; }
.nbr-editor-document .marker-green, .prose .marker-green { background: #62f962; }
.nbr-editor-document .marker-pink, .prose .marker-pink { background: #fc7999; }
.nbr-editor-document .marker-blue, .prose .marker-blue { background: #72ccfd; }
.nbr-editor-document .pen-red, .prose .pen-red { color: #e71313; background: transparent; }
.nbr-editor-document .pen-green, .prose .pen-green { color: #128a00; background: transparent; }

/* Admin form field sizing must not stretch toolbar controls to a full row. */
body.change-form #content-main .aligned .form-row .nbr-rich-text .nbr-editor-toolbar select[aria-label] {
  width: auto !important;
  max-width: 180px !important;
}
body.change-form #content-main .aligned .flex-container:has(> .nbr-rich-text) {
  flex-wrap: wrap;
}
.nbr-editor-document { clear: both; }
.nbr-editor-document::after { content: ""; display: block; clear: both; }

.prose figure.image.image-style-side { float: right; margin-left: 1em; }
