@font-face {
    font-family: "Coanda";
    src: url("../fonts/coandatrial-bold-webfont.woff2") format("woff2"),
        url("../fonts/coandatrial-bold-webfont.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/gilroy-regular.woff2") format("woff2"),
        url("../fonts/gilroy-regular.woff") format("woff");
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/gilroy-bold.woff2") format("woff2"),
        url("../fonts/gilroy-bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bm-bg: #101316;
    --bm-panel: #171b21;
    --bm-panel-alt: #1d232c;
    --bm-surface: #12171d;
    --bm-border: rgba(255, 255, 255, 0.2);
    --bm-border-strong: rgba(255, 255, 255, 0.18);
    --bm-text: #edf2f7;
    --bm-text-muted: #9caab6;
    --bm-text-dim: #738090;
    --bm-canvas: #0b0f14;
    --bm-sheet: #ffffff;
    --bm-sheet-ink: #111827;
    --bm-editor-font: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --bm-ui-font: "Gilroy", "Segoe UI", sans-serif;
    --bm-display-font: "Coanda", "Gilroy", sans-serif;
    --bm-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    --bm-radius: 16px;
    --bm-accent: #d5fb0b;
    --bm-accent-rgb: 213, 251, 11;
}

body[data-brand="devwp"] {
    --bm-accent: #fb0b5d;
    --bm-accent-rgb: 251, 11, 93;
}

body[data-brand="bidmark"] {
    --bm-accent: #d5fb0b;
    --bm-accent-rgb: 213, 251, 11;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(var(--bm-accent-rgb), 0.1), transparent 28%),
        radial-gradient(circle at bottom right, rgba(var(--bm-accent-rgb), 0.08), transparent 22%),
        var(--bm-bg);
    color: var(--bm-text);
    font-family: var(--bm-ui-font);
}

.bm-app-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(var(--bm-accent-rgb), 0.1), transparent 28%),
        radial-gradient(circle at bottom right, rgba(var(--bm-accent-rgb), 0.08), transparent 22%),
        var(--bm-bg);
}

.bm-topbar,
.bm-statusbar,
.bm-tabs,
.bm-sidebar,
.bm-pane-header,
.bm-editor,
.bm-toolbar-btn,
.bm-save-indicator,
.form-control,
.form-select,
.input-group-text,
.dropdown-menu,
.dropdown-item,
.btn {
    color: inherit;
}

.bm-topbar {
    background: rgba(10, 13, 17, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--bm-border);
}

.bm-branding {
    min-width: 0;
}

.bm-brand-title {
    font-family: var(--bm-display-font);
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.bm-brand-subtitle {
    margin-top: 0.2rem;
    color: var(--bm-text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bm-toolbar-btn,
.bm-select-group .input-group-text,
.bm-select-group .form-select,
.bm-sidebar .form-control,
.bm-sidebar .form-select,
.bm-sidebar .input-group-text,
.bm-statusbar,
.dropdown-menu {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bm-border);
}

.bm-toolbar-btn {
    border-radius: 10px;
}

.bm-toolbar-btn:hover,
.bm-toolbar-btn:focus-visible,
.dropdown-item:hover,
.dropdown-item:focus-visible {
    background: rgba(var(--bm-accent-rgb), 0.12);
    border-color: rgba(var(--bm-accent-rgb), 0.35);
    color: var(--bm-text);
}

.bm-accent-btn {
    background: var(--bm-accent);
    border: 1px solid rgba(var(--bm-accent-rgb), 0.7);
    color: #111;
    font-weight: 700;
}

.bm-accent-btn:hover,
.bm-accent-btn:focus-visible {
    background: #f6ffe0;
    border-color: rgba(var(--bm-accent-rgb), 1);
    color: #111;
}

.bm-save-indicator,
#statusSaved,
#statusPages,
#statusMode {
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bm-border);
    font-size: 0.82rem;
    white-space: nowrap;
}

.bm-save-indicator[data-tone="dirty"],
#statusSaved[data-tone="dirty"] {
    background: rgba(255, 181, 66, 0.12);
    border-color: rgba(255, 181, 66, 0.35);
    color: #ffd28b;
}

.bm-save-indicator[data-tone="busy"],
#statusSaved[data-tone="busy"] {
    background: rgba(var(--bm-accent-rgb), 0.12);
    border-color: rgba(var(--bm-accent-rgb), 0.35);
    color: var(--bm-text);
}

.bm-save-indicator[data-tone="error"],
#statusSaved[data-tone="error"] {
    background: rgba(255, 102, 102, 0.12);
    border-color: rgba(255, 102, 102, 0.35);
    color: #ffb3b3;
}

.bm-sidebar {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%), var(--bm-panel);
    border-right: 1px solid var(--bm-border);
    transition: width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease;
}

.bm-sidebar.is-collapsed {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

.bm-sidebar.is-collapsed .bm-sidebar-body,
.bm-sidebar.is-collapsed .bm-sidebar-title,
.bm-sidebar.is-collapsed .bm-sidebar-caption {
    display: none;
}

.bm-sidebar-header {
    border-color: var(--bm-border) !important;
}

.bm-sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.bm-sidebar-caption,
.bm-shortcuts-title,
.bm-pane-meta,
.bm-doc-meta,
.bm-empty-eyebrow,
.bm-empty-copy,
.bm-doc-count {
    color: var(--bm-text-muted);
}

.bm-sidebar-footer {
    border-color: var(--bm-border) !important;
}

.bm-doc-list {
    min-height: 0;
}

.bm-doc-item {
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.bm-doc-item:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--bm-accent-rgb), 0.28);
    background: rgba(var(--bm-accent-rgb), 0.08);
}

.bm-doc-item.is-active {
    border-color: rgba(var(--bm-accent-rgb), 0.5);
    background: rgba(var(--bm-accent-rgb), 0.12);
}

.bm-doc-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--bm-accent);
    flex-shrink: 0;
}

.bm-doc-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.bm-doc-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-dirty-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--bm-accent);
    box-shadow: 0 0 0 4px rgba(var(--bm-accent-rgb), 0.16);
    flex-shrink: 0;
}

.bm-tabs {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    overflow-x: auto;
    background: rgba(15, 19, 25, 0.86);
    border-bottom: 1px solid var(--bm-border);
}

.bm-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0 1rem;
    border-right: 1px solid var(--bm-border);
    color: var(--bm-text-muted);
    cursor: pointer;
    user-select: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.bm-tab:hover {
    background: rgba(255, 255, 255, 0.04);
}

.bm-tab.is-active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bm-text);
    box-shadow: inset 0 -2px 0 var(--bm-accent);
}

.bm-tab-title {
    display: inline-block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-tab-close {
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.bm-tab-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bm-mainstage {
    min-width: 0;
}

.bm-stage {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
        var(--bm-surface);
}

.bm-empty-state {
    background:
        radial-gradient(circle at top, rgba(var(--bm-accent-rgb), 0.08), transparent 34%),
        transparent;
}

.bm-empty-title {
    max-width: 16ch;
    margin: 0.4rem auto 1rem;
    font-family: var(--bm-display-font);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.bm-empty-copy {
    max-width: 42rem;
    margin: 0 auto;
    font-size: 1rem;
}

.bm-workspace {
    --editor-width: 48%;
    display: flex;
    align-items: stretch;
    height: 100%;
}

.bm-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bm-pane-editor {
    flex: 0 0 var(--editor-width);
}

.bm-pane-preview {
    flex: 1 1 auto;
}

.bm-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--bm-border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bm-editor-shell,
.bm-preview-viewport {
    min-height: 0;
    flex: 1 1 auto;
}

.bm-editor-shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%), #0f141a;
}

.bm-editor {
    width: 100%;
    height: 100%;
    resize: none;
    border: 0;
    outline: none;
    padding: 1.35rem 1.5rem 2rem;
    background: transparent;
    font-family: var(--bm-editor-font);
    font-size: 14px;
    line-height: 1.7;
    color: #f4f6f8;
    tab-size: 2;
}

.bm-editor::selection {
    background: rgba(var(--bm-accent-rgb), 0.28);
}

.bm-divider {
    width: 10px;
    flex-shrink: 0;
    cursor: col-resize;
    border-inline: 1px solid var(--bm-border);
    background: linear-gradient(90deg, transparent, rgba(var(--bm-accent-rgb), 0.18), transparent);
}

.bm-preview-viewport {
    overflow: auto;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
        var(--bm-canvas);
}

.bm-preview-viewport {
    --bm-preview-page-gap: 2rem;
}

.bm-preview-document {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.35rem 1.4rem 2rem;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--bm-text);
    font-family: var(--bm-ui-font);
    line-height: 1.7;
    box-shadow: none;
}

.bm-preview-document > :first-child {
    margin-top: 0;
}

.bm-preview-document h1,
.bm-preview-document h2,
.bm-preview-document h3,
.bm-preview-document h4,
.bm-preview-document h5,
.bm-preview-document h6 {
    margin: 0 0 0.65em;
    color: var(--bm-text);
    font-family: var(--bm-display-font);
    line-height: 1.05;
    text-transform: uppercase;
}

.bm-preview-document h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.bm-preview-document h2 {
    margin-top: 1.2em;
    padding-top: 0.25rem;
    border-top: 2px solid rgba(var(--bm-accent-rgb), 0.35);
    font-size: 1.45rem;
}

.bm-preview-document h3 {
    margin-top: 1.1em;
    font-size: 1.1rem;
}

.bm-preview-document p,
.bm-preview-document ul,
.bm-preview-document ol,
.bm-preview-document blockquote,
.bm-preview-document table,
.bm-preview-document pre {
    margin: 0 0 1rem;
}

.bm-preview-document ul,
.bm-preview-document ol {
    padding-left: 1.35rem;
}

.bm-preview-document strong {
    color: #ffffff;
}

.bm-preview-document a {
    color: var(--bm-accent);
    text-decoration-color: rgba(var(--bm-accent-rgb), 0.45);
}

.bm-preview-document code {
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
    background: rgba(var(--bm-accent-rgb), 0.12);
    color: #ffffff;
    font-family: var(--bm-editor-font);
    font-size: 0.92em;
}

.bm-preview-document pre {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #0b1016;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8edf3;
    overflow: auto;
}

.bm-preview-document pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
    white-space: pre-wrap;
}

.bm-preview-document blockquote {
    padding: 0.65rem 0 0.65rem 1rem;
    border-left: 4px solid var(--bm-accent);
    color: var(--bm-text-muted);
}

.bm-preview-document hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 1.2rem 0;
}

.bm-preview-document table {
    width: 100%;
    border-collapse: collapse;
}

.bm-preview-document th,
.bm-preview-document td {
    padding: 0.6rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    vertical-align: top;
}

.bm-preview-document th {
    background: rgba(var(--bm-accent-rgb), 0.12);
    color: #ffffff;
    text-align: left;
}

.bm-preview-document img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.bm-preview-viewport.is-loading::before,
.bm-preview-viewport.is-empty::before {
    display: block;
    margin: 2rem auto;
    max-width: 30rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    text-align: center;
    color: var(--bm-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bm-border);
}

.bm-preview-viewport.is-loading::before {
    content: "Paginating A4 preview...";
}

.bm-preview-viewport.is-empty::before {
    content: "The paginated preview will appear here.";
}

.bm-preview-viewport .pagedjs_pages,
#printRoot .pagedjs_pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.bm-preview-viewport .pagedjs_pages {
    gap: var(--bm-preview-page-gap);
    padding: 0.35rem 0 2rem;
}

.bm-preview-viewport .pagedjs_page,
#printRoot .pagedjs_page {
    background: var(--bm-sheet);
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 4px;
    box-shadow: var(--bm-shadow);
    overflow: hidden;
}

.bm-preview-viewport .pagedjs_pagebox,
#printRoot .pagedjs_pagebox {
    background: var(--bm-sheet);
}

.bm-preview-viewport .pagedjs_page {
    position: relative;
    background: #0b1016;
    border: 0;
    border-radius: 0;
    box-shadow: var(--bm-shadow);
}

.bm-preview-viewport .pagedjs_page:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: calc(var(--bm-preview-page-gap) * -0.5);
    border-top: 1px dashed rgba(var(--bm-accent-rgb), 0.48);
    pointer-events: none;
}

.bm-preview-viewport .pagedjs_pagebox {
    background: #0b1016;
    color: var(--bm-text);
}

.bm-preview-viewport .pagedjs_margin-content,
#printRoot .pagedjs_margin-content {
    color: rgba(17, 24, 39, 0.5);
    font-family: var(--bm-ui-font);
}

.bm-preview-viewport .pagedjs_margin-content {
    color: var(--bm-text-muted);
}

#printRoot .pagedjs_pages {
    background: #0b1016;
}

#printRoot .pagedjs_page,
#printRoot .pagedjs_pagebox {
    background: #0b1016;
    color: var(--bm-text);
}

#printRoot .pagedjs_margin-content {
    color: var(--bm-text-muted);
}

.bm-print-root {
    position: fixed;
    top: 0;
    left: -300vw;
    width: 210mm;
    min-height: 297mm;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.bm-print-document {
    color: var(--bm-text);
    font-family: var(--bm-ui-font);
    font-size: 11pt;
    line-height: 1.7;
}

.bm-print-document > :first-child {
    margin-top: 0;
}

.bm-print-document h1,
.bm-print-document h2,
.bm-print-document h3,
.bm-print-document h4,
.bm-print-document h5,
.bm-print-document h6 {
    color: var(--bm-text);
    font-family: var(--bm-display-font);
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 0.65em;
    text-transform: uppercase;
    break-after: avoid-page;
    page-break-after: avoid;
}

.bm-print-document h1 {
    font-size: 27pt;
    letter-spacing: 0.02em;
}

.bm-print-document h2 {
    font-size: 18pt;
    margin-top: 1.3em;
    padding-top: 0.25rem;
    border-top: 2px solid rgba(var(--bm-accent-rgb), 0.35);
}

.bm-print-document h3 {
    font-size: 14pt;
    margin-top: 1.15em;
}

.bm-print-document p,
.bm-print-document li,
.bm-print-document blockquote {
    orphans: 3;
    widows: 3;
}

.bm-print-document p,
.bm-print-document ul,
.bm-print-document ol,
.bm-print-document blockquote,
.bm-print-document table,
.bm-print-document pre {
    margin: 0 0 1rem;
}

.bm-print-document ul,
.bm-print-document ol {
    padding-left: 1.3rem;
}

.bm-print-document a {
    color: var(--bm-accent);
    text-decoration-color: rgba(var(--bm-accent-rgb), 0.45);
}

.bm-print-document strong {
    color: #ffffff;
}

.bm-print-document code {
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: rgba(var(--bm-accent-rgb), 0.12);
    font-family: var(--bm-editor-font);
    font-size: 0.92em;
}

.bm-print-document pre {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #111827;
    color: #f9fafb;
    overflow: hidden;
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.bm-print-document pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
    white-space: pre-wrap;
}

.bm-print-document blockquote {
    padding: 0.6rem 0 0.6rem 1rem;
    border-left: 4px solid var(--bm-accent);
    color: var(--bm-text-muted);
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.bm-print-document hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 1.2rem 0;
}

.bm-print-document table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.bm-print-document th,
.bm-print-document td {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    vertical-align: top;
}

.bm-print-document th {
    background: rgba(var(--bm-accent-rgb), 0.12);
    color: #ffffff;
    text-align: left;
}

.bm-print-document img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    break-inside: avoid-page;
    page-break-inside: avoid;
}

:is(.bm-preview-document, .bm-print-document) h1 {
    font-family: var(--bm-display-font);
    font-weight: 700;
    color: var(--bm-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 0.7em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid var(--bm-accent);
    border-top: 0;
    position: relative;
}

:is(.bm-preview-document, .bm-print-document) h2 {
    font-family: var(--bm-ui-font);
    font-weight: 700;
    font-size: 22pt;
    color: var(--bm-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    margin-top: 2em;
    margin-bottom: 0.8em;
    padding-top: 0;
    padding-bottom: 0.4em;
    border-top: 0;
    border-bottom: 1px solid var(--bm-border);
}

:is(.bm-preview-document, .bm-print-document) h3 {
    font-family: var(--bm-ui-font);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--bm-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
}

:is(.bm-preview-document, .bm-print-document) h4 {
    font-family: var(--bm-ui-font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--bm-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
}

:is(.bm-preview-document, .bm-print-document) h5 {
    font-family: var(--bm-ui-font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bm-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.3;
    margin-top: 1.4em;
    margin-bottom: 0.4em;
}

:is(.bm-preview-document, .bm-print-document) h6 {
    font-family: var(--bm-ui-font);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--bm-text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.3;
    margin-top: 1.2em;
    margin-bottom: 0.4em;
}

:is(.bm-preview-document, .bm-print-document) .bm-heading-accent {
    color: var(--bm-accent);
    font-family: var(--bm-display-font);
    font-weight: 700;
}

:is(.bm-preview-document, .bm-print-document) p {
    margin-bottom: 1.2em;
}

:is(.bm-preview-document, .bm-print-document) strong {
    color: #ffffff;
    font-weight: 700;
}

:is(.bm-preview-document, .bm-print-document) em {
    color: var(--bm-accent);
    font-style: italic;
}

:is(.bm-preview-document, .bm-print-document) del {
    color: var(--bm-text-muted);
    text-decoration: line-through;
}

:is(.bm-preview-document, .bm-print-document) a {
    color: var(--bm-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--bm-accent-rgb), 0.55);
    transition: border-color 0.15s, opacity 0.15s;
}

:is(.bm-preview-document, .bm-print-document) a:hover {
    opacity: 0.8;
    border-bottom-color: var(--bm-accent);
}

:is(.bm-preview-document, .bm-print-document) hr {
    border: none;
    height: 2px;
    background: var(--bm-accent);
    opacity: 0.4;
    margin: 2.5em 0;
}

:is(.bm-preview-document, .bm-print-document) blockquote {
    border-left: 3px solid var(--bm-accent);
    background: rgba(var(--bm-accent-rgb), 0.08);
    padding: 1rem 1.5rem 1rem 1.8rem;
    margin: 1.8rem 0;
    color: var(--bm-text-muted);
    border-radius: 0 2px 2px 0;
}

:is(.bm-preview-document, .bm-print-document) blockquote p {
    margin-bottom: 0;
}

:is(.bm-preview-document, .bm-print-document) code {
    font-family: var(--bm-editor-font);
    font-size: 0.86em;
    color: var(--bm-accent);
    background: rgba(var(--bm-accent-rgb), 0.08);
    padding: 0.15em 0.45em;
    border-radius: 3px;
    border: 1px solid rgba(var(--bm-accent-rgb), 0.18);
}

:is(.bm-preview-document, .bm-print-document) pre {
    background: var(--bm-panel);
    border-left: 3px solid var(--bm-accent);
    padding: 1.2rem 1.4rem;
    border-radius: 0 4px 4px 0;
    margin: 1.5rem 0;
    overflow-x: auto;
}

:is(.bm-preview-document, .bm-print-document) pre code {
    color: var(--bm-text);
    background: transparent;
    padding: 0;
    border: none;
    font-size: 0.88rem;
    line-height: 1.75;
}

:is(.bm-preview-document, .bm-print-document) ul,
:is(.bm-preview-document, .bm-print-document) ol {
    padding-left: 1.8rem;
    margin-bottom: 1.2em;
}

:is(.bm-preview-document, .bm-print-document) li {
    margin-bottom: 0.35em;
}

:is(.bm-preview-document, .bm-print-document) li::marker {
    color: var(--bm-accent);
    font-weight: 700;
}

:is(.bm-preview-document, .bm-print-document) ul > li::marker {
    content: "▸  ";
}

:is(.bm-preview-document, .bm-print-document) .bm-task-list {
    padding-left: 0;
    list-style: none;
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item {
    list-style: none;
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item::marker {
    content: "";
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item > input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    margin: 0 0.65rem 0 0;
    border: 1px solid rgba(var(--bm-accent-rgb), 0.72);
    border-radius: 2px;
    background: rgba(var(--bm-accent-rgb), 0.08);
    display: inline-grid;
    place-content: center;
    vertical-align: -0.12rem;
    pointer-events: none;
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item > input[type="checkbox"]::before {
    content: "";
    width: 0.56rem;
    height: 0.56rem;
    transform: scale(0);
    transition: transform 0.14s ease;
    clip-path: polygon(14% 44%, 0 58%, 40% 100%, 100% 18%, 86% 4%, 40% 63%);
    background: #111111;
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item > input[type="checkbox"]:checked {
    background: var(--bm-accent);
    border-color: var(--bm-accent);
}

:is(.bm-preview-document, .bm-print-document) .bm-task-item > input[type="checkbox"]:checked::before {
    transform: scale(1);
}

:is(.bm-preview-document, .bm-print-document) table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8rem 0;
    font-size: 0.92rem;
}

:is(.bm-preview-document, .bm-print-document) thead tr {
    border-bottom: 2px solid var(--bm-accent);
    background: rgba(var(--bm-accent-rgb), 0.08);
}

:is(.bm-preview-document, .bm-print-document) th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-family: var(--bm-ui-font);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bm-accent);
    background: transparent;
    border: 0;
}

:is(.bm-preview-document, .bm-print-document) td {
    padding: 0.6rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--bm-border);
    color: var(--bm-text);
    font-weight: 300;
}

:is(.bm-preview-document, .bm-print-document) tbody tr:last-child td {
    border-bottom: none;
}

:is(.bm-preview-document, .bm-print-document) tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

:is(.bm-preview-document, .bm-print-document) img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    margin: 1.5rem 0;
    border: none;
}

.bm-preview-document .bm-page-break,
.bm-print-document .bm-page-break {
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    break-before: page;
    page-break-before: always;
}

.bm-preview-document .bm-spacer,
.bm-print-document .bm-spacer {
    display: block;
    height: 1.2em;
    margin: 0;
    padding: 0;
}

.bm-preview-document .bm-hero-page,
.bm-print-document .bm-hero-page {
    position: relative;
    min-height: 248mm;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: visible;
    padding: 18mm 14mm;
    break-before: page;
    page-break-before: always;
    break-after: page;
    page-break-after: always;
    margin: -1.35rem -1.4rem 0;
}

.bm-preview-document .bm-hero-page-content,
.bm-print-document .bm-hero-page-content {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-preview-document > .bm-hero-page:first-child,
.bm-print-document > .bm-hero-page:first-child {
    break-before: auto;
    page-break-before: auto;
}

.bm-preview-document .bm-hero-page h1,
.bm-print-document .bm-hero-page h1 {
    margin: 0;
    width: 100%;
    font-size: 34pt;
}

.bm-preview-document .bm-hero-corner,
.bm-print-document .bm-hero-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 113%;
    max-width: none;
    margin-right: -26mm;
    margin-top: -20mm;
    pointer-events: none;
    z-index: 0;
}

.bm-preview-document .bm-hero-corner-svg,
.bm-print-document .bm-hero-corner-svg {
    display: block;
    width: 100%;
    height: auto;
    transform: scale(-1, -1);
    transform-origin: center;
}

.bm-preview-document .bm-corner-base,
.bm-print-document .bm-corner-base {
    fill: #282f34;
}

.bm-preview-document .bm-corner-accent,
.bm-print-document .bm-corner-accent {
    fill: var(--bm-accent);
}

.bm-preview-document .bm-corner-light,
.bm-print-document .bm-corner-light {
    fill: #e8e8e8;
}

.bm-preview-document .bm-logo-block,
.bm-print-document .bm-logo-block {
    margin: 1.75rem auto;
    width: min(100%, var(--bm-logo-width, 300px));
    text-align: center;
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.bm-preview-document .bm-logo-svg,
.bm-print-document .bm-logo-svg {
    display: block;
    width: 100%;
    height: auto;
}

.bm-preview-document .bm-logo-tone-accent,
.bm-print-document .bm-logo-tone-accent {
    color: var(--bm-accent);
}

.bm-preview-document .bm-logo-tone-white,
.bm-print-document .bm-logo-tone-white {
    color: #ffffff;
}

.bm-preview-document .bm-logo-size-small,
.bm-print-document .bm-logo-size-small {
    --bm-logo-width: 150px;
}

.bm-preview-document .bm-logo-size-default,
.bm-print-document .bm-logo-size-default {
    --bm-logo-width: 300px;
}

.bm-preview-document .bm-logo-size-large,
.bm-print-document .bm-logo-size-large {
    --bm-logo-width: 500px;
}

.bm-statusbar {
    border-top: 1px solid var(--bm-border);
    background: rgba(10, 13, 17, 0.82);
    font-size: 0.86rem;
}

#statusDoc,
#statusStats {
    color: var(--bm-text-muted);
}

.dropdown-menu {
    --bs-dropdown-bg: #11161c;
    --bs-dropdown-link-color: var(--bm-text);
    --bs-dropdown-link-hover-color: var(--bm-text);
    --bs-dropdown-link-hover-bg: rgba(var(--bm-accent-rgb), 0.12);
    --bs-dropdown-border-color: var(--bm-border);
}

.dropdown-item.text-danger {
    color: #ff9d9d !important;
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus-visible {
    background: rgba(255, 102, 102, 0.12);
}

.badge.text-bg-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--bm-text-muted) !important;
}

.bm-workspace[data-mode="edit"] .bm-pane-preview,
.bm-workspace[data-mode="edit"] .bm-divider {
    display: none;
}

.bm-workspace[data-mode="view"] .bm-pane-editor,
.bm-workspace[data-mode="view"] .bm-divider {
    display: none;
}

.bm-workspace[data-mode="view"] .bm-pane-preview,
.bm-workspace[data-mode="edit"] .bm-pane-editor {
    flex: 1 1 auto;
}

@page {
    size: A4;
    margin: 20mm 25mm;
}

@media (max-width: 991.98px) {
    .bm-sidebar {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .bm-brand-subtitle {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .bm-topbar .bm-select-group,
    .bm-topbar #btnSave {
        width: 100%;
    }

    .bm-topbar .ms-auto {
        width: 100%;
    }

    .bm-sidebar {
        position: absolute;
        z-index: 30;
        height: 100%;
        box-shadow: var(--bm-shadow);
    }

    .bm-sidebar.is-collapsed {
        transform: translateX(-100%);
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .bm-sidebar.is-collapsed .bm-sidebar-body,
    .bm-sidebar.is-collapsed .bm-sidebar-title,
    .bm-sidebar.is-collapsed .bm-sidebar-caption {
        display: block;
    }

    .bm-workspace,
    .bm-workspace[data-mode="split"] {
        flex-direction: column;
    }

    .bm-workspace[data-mode="split"] .bm-divider {
        width: 100%;
        height: 10px;
        cursor: row-resize;
        background: linear-gradient(180deg, transparent, rgba(var(--bm-accent-rgb), 0.18), transparent);
    }

    .bm-workspace[data-mode="split"] .bm-pane-editor,
    .bm-workspace[data-mode="split"] .bm-pane-preview {
        flex: 1 1 50%;
    }
}

@media print {
    html,
    body.bm-printing {
        background: #0b1016 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.bm-printing .bm-app-shell {
        display: none !important;
    }

    body.bm-printing #printRoot {
        position: static !important;
        left: auto !important;
        width: auto !important;
        min-height: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    body.bm-printing #printRoot .pagedjs_pages {
        gap: 0 !important;
        padding: 0 !important;
        background: #0b1016 !important;
    }

    body.bm-printing #printRoot .pagedjs_page {
        margin: 0 auto !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #0b1016 !important;
        color: var(--bm-text) !important;
    }

    body.bm-printing #printRoot .pagedjs_pagebox {
        background: #0b1016 !important;
    }

    body.bm-printing #printRoot .pagedjs_margin-content {
        color: var(--bm-text-muted) !important;
    }
}