/* Markdown note styles */

/* Hide separator, emoji and table buttons for markdown notes */
.innernote[data-markdown-note="true"] .btn-separator,
.innernote[data-markdown-note="true"] .btn-emoji,
.innernote[data-markdown-note="true"] .btn-table,
.innernote[data-markdown-note="true"] .btn-checklist {
    display: none !important;
}

.markdown-preview {
    padding: 10px 10px 24px;
    box-sizing: border-box;
    min-height: 100px;
}

.markdown-editor {
    padding: 10px 10px 24px;
    box-sizing: border-box;
    min-height: 100px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    /* Prevent parent container from scrolling when cursor moves */
    overflow-anchor: none;
}

.markdown-editor:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Table rows are space-padded so their pipes line up (formatMarkdownTableBlockLines
   in markdown-handler.js); that alignment is only visible in a fixed-width font.
   The unmatched #id inside :is() only boosts specificity above the forced-Inter
   rule in notes/noteentry.css. */
.markdown-editor .cm-line:is(#poznote-md-table-font-boost, .cm-md-table-line) {
    font-family: 'Courier New', Courier, monospace !important;
}

.markdown-editor:empty:before {
    content: attr(data-ph);
    color: #999;
}

.markdown-editor .markdown-excalidraw-placeholder {
    display: block;
    position: relative;
    margin: 0;
    padding: 2px 10px 2px 0;
    min-height: calc(1.4em + 4px);
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
}

.markdown-editor .markdown-excalidraw-placeholder::before {
    content: attr(data-summary);
    position: absolute;
    top: 2px;
    right: 10px;
    bottom: 2px;
    left: 0;
    display: flex;
    align-items: center;
    line-height: 1.4;
    color: #5f6b76;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.markdown-codemirror-host .markdown-excalidraw-placeholder {
    width: 100%;
    box-sizing: border-box;
    vertical-align: top;
}

html[data-theme='dark'] .markdown-editor .markdown-excalidraw-placeholder::before,
body.dark-mode .markdown-editor .markdown-excalidraw-placeholder::before {
    color: #b9c4cf;
}

.markdown-codemirror-host {
    padding: 0;
    white-space: normal;
    --poznote-cm-keyword: #d73a49;
    --poznote-cm-atom: #005cc5;
    --poznote-cm-string: #032f62;
    --poznote-cm-number: #005cc5;
    --poznote-cm-comment: #6a737d;
    --poznote-cm-function: #6f42c1;
    --poznote-cm-variable: #24292e;
    --poznote-cm-type: #22863a;
    --poznote-cm-punctuation: #24292e;
    --poznote-cm-meta: #005cc5;
    --poznote-cm-heading: #005cc5;
    --poznote-cm-link: #0366d6;
    --poznote-cm-monospace: #6f42c1;
    --poznote-cm-invalid: #b31d28;
    --poznote-cm-invalid-bg: transparent;
}

.markdown-codemirror-host .cm-editor {
    min-height: 100px;
    height: auto;
    background: transparent;
    color: inherit;
    font-family: 'Courier New', Courier, monospace;
    font-size: inherit;
    line-height: inherit;
    outline: none;
}

.markdown-codemirror-host .cm-editor.cm-focused {
    outline: none;
}

.markdown-codemirror-host .cm-scroller {
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-family: inherit;
}

.markdown-codemirror-host .cm-scroller::-webkit-scrollbar {
    display: none;
}

.markdown-codemirror-host .cm-content {
    min-height: 100px;
    padding: 10px 10px 24px;
    caret-color: currentColor;
}

.markdown-codemirror-host .cm-line {
    padding: 0;
}

.markdown-codemirror-host .cm-gutters {
    display: none;
}

.markdown-codemirror-host .cm-activeLine {
    background: rgba(0, 125, 184, 0.05);
}

.markdown-codemirror-host .cm-selectionBackground,
.markdown-codemirror-host .cm-focused .cm-selectionBackground {
    background: rgba(0, 125, 184, 0.22);
}

.markdown-codemirror-host .cm-placeholder {
    color: #999;
    opacity: 1;
}

.markdown-codemirror-host .poznote-cm-keyword {
    color: var(--poznote-cm-keyword) !important;
}

.markdown-codemirror-host .poznote-cm-atom {
    color: var(--poznote-cm-atom) !important;
}

.markdown-codemirror-host .poznote-cm-string {
    color: var(--poznote-cm-string) !important;
}

.markdown-codemirror-host .poznote-cm-number {
    color: var(--poznote-cm-number) !important;
}

.markdown-codemirror-host .poznote-cm-comment {
    color: var(--poznote-cm-comment) !important;
    font-style: italic !important;
}

.markdown-codemirror-host .poznote-cm-function {
    color: var(--poznote-cm-function) !important;
}

.markdown-codemirror-host .poznote-cm-variable {
    color: var(--poznote-cm-variable) !important;
}

.markdown-codemirror-host .poznote-cm-type {
    color: var(--poznote-cm-type) !important;
}

.markdown-codemirror-host .poznote-cm-punctuation {
    color: var(--poznote-cm-punctuation) !important;
}

.markdown-codemirror-host .poznote-cm-meta {
    color: var(--poznote-cm-meta) !important;
}

.markdown-codemirror-host .poznote-cm-heading {
    color: var(--poznote-cm-heading) !important;
    font-weight: 700 !important;
}

/* Per-level heading colors; each level falls back to the shared heading color
   unless a --poznote-cm-headingN variable is set (colored markdown setting). */
.markdown-codemirror-host .poznote-cm-heading1 {
    color: var(--poznote-cm-heading1, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-heading2 {
    color: var(--poznote-cm-heading2, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-heading3 {
    color: var(--poznote-cm-heading3, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-heading4 {
    color: var(--poznote-cm-heading4, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-heading5 {
    color: var(--poznote-cm-heading5, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-heading6 {
    color: var(--poznote-cm-heading6, var(--poznote-cm-heading)) !important;
}

.markdown-codemirror-host .poznote-cm-link {
    color: var(--poznote-cm-link) !important;
    text-decoration: underline !important;
}

.markdown-codemirror-host .poznote-cm-emphasis {
    font-style: italic !important;
}

.markdown-codemirror-host .poznote-cm-strong {
    font-weight: 700 !important;
}

.markdown-codemirror-host .poznote-cm-monospace {
    color: var(--poznote-cm-monospace) !important;
}

.markdown-codemirror-host .poznote-cm-strikethrough {
    text-decoration: line-through !important;
}

.markdown-codemirror-host .poznote-cm-invalid {
    background-color: var(--poznote-cm-invalid-bg) !important;
    color: var(--poznote-cm-invalid) !important;
}

.cm-tooltip {
    border: 1px solid #d9dee7;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cm-tooltip-autocomplete ul {
    max-height: 260px;
}

.cm-tooltip-autocomplete ul li[aria-selected] {
    background: #007db8;
    color: #fff;
}

body.slash-menu-cursor-hidden,
body.slash-menu-cursor-hidden * {
    cursor: none !important;
}

/* Markdown rendered content styles */
.markdown-preview h1 {
    font-size: 2em;
    font-weight: bold;
    margin: 0.67em 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.3em;
}

.markdown-preview h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.75em 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.3em;
}

.markdown-preview h3 {
    font-size: 1.25em;
    font-weight: bold;
    margin: 0.83em 0;
}

.markdown-preview h4 {
    font-size: 1em;
    font-weight: bold;
    margin: 1em 0;
}

.markdown-preview h5 {
    font-size: 0.875em;
    font-weight: bold;
    margin: 1.33em 0;
}

.markdown-preview h6 {
    font-size: 0.75em;
    font-weight: bold;
    margin: 1.67em 0;
    color: #666;
}

/* Heading anchor links (GitHub-style) */
.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    position: relative;
}

.markdown-preview .heading-anchor {
    opacity: 0;
    margin-left: 0.35em;
    padding: 0 0.2em;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    vertical-align: middle;
    font-size: inherit;
    cursor: pointer;
}

.markdown-preview h1:hover .heading-anchor,
.markdown-preview h2:hover .heading-anchor,
.markdown-preview h3:hover .heading-anchor,
.markdown-preview h4:hover .heading-anchor,
.markdown-preview h5:hover .heading-anchor,
.markdown-preview h6:hover .heading-anchor {
    opacity: 0.5;
}

.markdown-preview .heading-anchor:hover {
    opacity: 1 !important;
}

.markdown-preview .heading-anchor svg {
    fill: currentColor;
    vertical-align: middle;
    width: 0.8em;
    height: 0.8em;
}

.markdown-preview p {
    margin: 0 0 1em 0;
}

/* Blank lines to preserve spacing in markdown */
.markdown-preview p.blank-line {
    margin: 0;
    min-height: 1em;
    line-height: 1;
}

.markdown-preview p:first-child {
    margin-top: 0;
}

.markdown-preview p:last-child {
    margin-bottom: 0;
}

.markdown-preview code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    /* border-radius: 3px; */
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #333;
}

.markdown-preview pre {
    background-color: #f4f4f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0 !important;
}

.noteentry pre.indented-pre,
.markdown-preview pre.indented-pre {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 0 1em 0 !important;
    font-family: monospace !important;
    font-size: inherit !important;
    color: inherit !important;
    white-space: pre-wrap !important;
    width: auto !important;
    box-sizing: border-box !important;
    position: static !important;
}

html[data-theme='dark'] .noteentry pre.indented-pre,
html[data-theme='dark'] .markdown-preview pre.indented-pre,
body.dark-mode .noteentry pre.indented-pre,
body.dark-mode .markdown-preview pre.indented-pre {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    color: inherit !important;
}

.markdown-preview pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    border-radius: 0;
}

.markdown-preview blockquote,
.noteentry blockquote {
    border-left: 4px solid #ddd;
    padding-left: 16px;
    margin: 1em 0;
    color: #666;
    font-style: italic;
}

.markdown-preview ul,
.markdown-preview ol {
    margin: 1em 0;
    padding-left: 2em;
}

.markdown-preview li {
    margin: 0.5em 0;
    line-height: 1.6;
}

.markdown-preview ul {
    list-style-type: disc;
}

.markdown-preview ol {
    list-style-type: decimal;
}

.markdown-preview a {
    color: #007bff;
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

.markdown-preview img,
.markdown-preview iframe {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0;
}

.markdown-preview iframe {
    border: none;
}

.markdown-preview video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.markdown-preview audio,
.markdown-preview .note-audio-embed {
    max-width: 280px;
    display: block;
    margin: 8px 0;
    border-radius: 8px;
    background: #f1f3f4;
}

@media screen and (max-width: 768px) {

    .markdown-preview audio,
    .markdown-preview .note-audio-embed {
        max-width: 240px;
    }
}

.markdown-preview iframe[data-is-audio] {
    max-width: 280px;
    width: 100%;
    height: 54px;
    display: block;
    overflow: hidden;
    margin: 8px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
}

.markdown-preview iframe.note-audio-embed {
    max-width: 280px;
    width: 100%;
    height: 54px;
    display: block;
    overflow: hidden;
    margin: 8px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
}

@media screen and (max-width: 768px) {
    .markdown-preview iframe[data-is-audio] {
        max-width: 240px;
    }

    .markdown-preview iframe.note-audio-embed {
        max-width: 240px;
    }
}

.markdown-preview hr {
    border: 0;
    border-top: 2px solid #e0e0e0;
    margin: 2em 0;
}

.markdown-preview strong {
    font-weight: bold;
}

.markdown-preview em {
    font-style: italic;
}

.markdown-preview del {
    text-decoration: line-through;
    color: #999;
}

.noteentry table,
.markdown-preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.noteentry table th,
.noteentry table td,
.markdown-preview table th,
.markdown-preview table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    white-space: pre-line;
}

.noteentry table th,
.markdown-preview table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.noteentry table tr:nth-child(even),
.markdown-preview table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Colored markdown (the "Colored markdown" display setting).
   One --mdc-* variable per element; the user's colors are inlined on <body>
   by index.php, so they apply identically in light and dark mode (the values
   below are only fallbacks, dark fallbacks in css/dark-mode/markdown.css).
   The unmatched #id inside :is() boosts specificity above the blanket
   `.noteentry * { color: var(--dm-text) !important }` rule in
   css/dark-mode/editor.css and above the dark-mode preview defaults, so one
   set of rules serves both themes. */
body.markdown-colored {
    --mdc-h1: #007db8;
    --mdc-h2: #1a7f37;
    --mdc-h3: #8250df;
    --mdc-h4: #bf3989;
    --mdc-h5: #1b7c83;
    --mdc-h6: #656d76;
    --mdc-code: #b34e00;
    --mdc-codeblock: #b34e00;
    --mdc-quote: #007db8;
    --mdc-table: #007db8;
    --mdc-hr: #007db8;
}

/* Editor: retint the CodeMirror heading and inline-code tokens with the
   chosen colors; links, markdown markers (quote/list/fence, the meta token)
   and fenced-code syntax colors keep the standard palette. The dark-mode
   variant lives in css/dark-mode/markdown.css because the dark CM palette
   redefines these variables later in the cascade. */
body.markdown-colored .markdown-codemirror-host {
    --poznote-cm-heading: var(--mdc-h1);
    --poznote-cm-heading1: var(--mdc-h1);
    --poznote-cm-heading2: var(--mdc-h2);
    --poznote-cm-heading3: var(--mdc-h3);
    --poznote-cm-heading4: var(--mdc-h4);
    --poznote-cm-heading5: var(--mdc-h5);
    --poznote-cm-heading6: var(--mdc-h6);
    --poznote-cm-monospace: var(--mdc-code);
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h1) {
    color: var(--mdc-h1) !important;
    border-bottom-color: color-mix(in srgb, var(--mdc-h1) 30%, transparent);
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h2) {
    color: var(--mdc-h2) !important;
    border-bottom-color: color-mix(in srgb, var(--mdc-h2) 30%, transparent);
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h3) {
    color: var(--mdc-h3) !important;
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h4) {
    color: var(--mdc-h4) !important;
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h5) {
    color: var(--mdc-h5) !important;
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, h6) {
    color: var(--mdc-h6) !important;
}

/* Code blocks: tint the block background with the chosen color (mixed into
   the standard light surface; the dark surface variant lives in
   css/dark-mode/markdown.css). !important is needed to beat the
   `background: #F8FAFC !important` on pre.code-block in css/code-blocks.css,
   so indented and mermaid blocks must be excluded here explicitly. */
body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, pre:not(.indented-pre):not(.mermaid)) {
    background: color-mix(in srgb, var(--mdc-codeblock) 8%, #f4f4f4) !important;
}

body.markdown-colored .markdown-preview :not(pre) > :is(#poznote-md-colored-boost, code:not([class*="hljs"]):not([class*="language-"])) {
    color: var(--mdc-code) !important;
    background-color: color-mix(in srgb, var(--mdc-code) 9%, transparent) !important;
    border-radius: 3px;
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, blockquote) {
    border-left-color: var(--mdc-quote);
    background-color: color-mix(in srgb, var(--mdc-quote) 6%, transparent);
    padding-top: 4px;
    padding-bottom: 4px;
    padding-right: 8px;
}

body.markdown-colored .markdown-preview table :is(#poznote-md-colored-boost, th) {
    background-color: color-mix(in srgb, var(--mdc-table) 9%, transparent);
}

body.markdown-colored .markdown-preview :is(#poznote-md-colored-boost, hr) {
    border-top-color: color-mix(in srgb, var(--mdc-hr) 35%, transparent);
}

/* Task lists (checkboxes) */
.markdown-preview ul.task-list {
    list-style: none;
    padding-left: 0;
}

.markdown-preview li.task-list-item {
    list-style: none;
    position: relative;
    padding-left: 0;
}

.markdown-preview li.task-list-item input[type="checkbox"] {
    margin-right: 0.5em;
    cursor: pointer;
    vertical-align: middle;
}

/* Interactive markdown checkbox styling */
.markdown-preview .markdown-task-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #007DB8;
}

.markdown-preview .markdown-task-checkbox:hover {
    transform: scale(1.1);
    transition: transform 0.1s ease;
}

/* Nested task lists need indentation */
.markdown-preview li.task-list-item>ul.task-list,
.markdown-preview li.task-list-item>ul,
.markdown-preview li.task-list-item>ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

/* Style for checked task items */
.markdown-preview li.task-list-item input[type="checkbox"]:checked+span {
    text-decoration: line-through;
    color: #888;
}

/* Click-to-navigate hint in split mode */
.noteentry.markdown-split-mode .markdown-preview [data-line]:not(.markdown-task-checkbox):not(summary):not(details) {
    transition: background-color 0.15s ease;
}

.noteentry.markdown-split-mode .markdown-preview [data-line]:not(.markdown-task-checkbox):not(summary):not(details):hover {
    background-color: rgba(0, 125, 184, 0.05);
    border-radius: 3px;
}

/* Indicateur visuel pour le drag & drop */
.noteentry.drag-over {
    border: 2px dashed #007DB8 !important;
    background-color: rgba(0, 125, 184, 0.05) !important;
    transition: all 0.2s ease;
}

.noteentry.drag-over .markdown-editor {
    background-color: rgba(0, 125, 184, 0.02);
    transition: background-color 0.2s ease;
}

/* Style pour le texte de chargement d'upload */
.markdown-editor {
    position: relative;
}

/* Supprimer complètement tous les cadres en mode édition markdown */
.noteentry[data-note-type="markdown"] .markdown-editor:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* Supprimer aussi le cadre sur l'élément parent noteentry quand on édite du markdown */
.noteentry[data-note-type="markdown"]:focus {
    border: none !important;
    border-bottom: none !important;
    outline: none !important;
}

/* Placeholder for empty preview */
.markdown-preview-placeholder {
    color: #999;
    padding: 0;
    text-align: left;
    opacity: 0.6;
}

.markdown-preview.empty {
    display: flex !important;
    align-items: flex-start;
    justify-content: flex-start;
}


/* Mermaid diagrams */
.mermaid {
    margin: 1em 0;
    text-align: center;
    background-color: white;
    /* Ensure visibility in dark mode if mermaid doesn't handle it */
    padding: 10px;
    border-radius: 4px;
}

/* Dark mode adjustment for mermaid container */
[data-theme='dark'] .mermaid {
    background-color: var(--dm-surface);
}

/* Math equations styling */
.math-block {
    display: block;
    margin: 1em 0;
    padding: 0.5em 0;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
}

.math-inline {
    display: inline;
    margin: 0 0.2em;
}

/* KaTeX font adjustments for better readability */
.katex {
    font-size: 1.1em;
}

.math-block .katex {
    font-size: 1.21em;
}

/* Math error styling */
.math-block span[style*="color: #cc0000"],
.math-inline span[style*="color: #cc0000"] {
    font-family: monospace;
    font-size: 0.9em;
}

/* Dark mode adjustments for math */
[data-theme='dark'] .katex {
    color: #e0e0e0;
}

/* Split view mode styles */
.noteentry.markdown-split-mode {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    align-items: stretch !important;
    overflow: hidden !important;
    height: auto !important;
    padding: 0 !important;
}

/* Hide overflow on parent containers when in split mode */
.innernote:has(.noteentry.markdown-split-mode) {
    overflow: hidden !important;
}

#right_col:has(.noteentry.markdown-split-mode) {
    overflow: hidden !important;
}

/* Tab bar now lives outside #right_col — split-mode header needs no override */

.noteentry.markdown-split-mode .markdown-editor-container,
.noteentry.markdown-split-mode .markdown-editor {
    flex: 1 1 50% !important;
    width: 50% !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-right: 1px solid #e0e0e0 !important;
    box-sizing: border-box !important;
    max-height: var(--markdown-split-pane-height, calc(100vh - 200px)) !important;
}

.noteentry.markdown-split-mode .markdown-editor-container {
    display: flex !important;
}

.noteentry.markdown-split-mode .markdown-editor {
    padding: 10px 20px 44px 10px !important;
}

.noteentry.markdown-split-mode .markdown-codemirror-host {
    padding: 0 !important;
    overflow: hidden !important;
}

.noteentry.markdown-split-mode .markdown-codemirror-host .cm-editor {
    height: 100%;
    min-height: 0;
    max-height: var(--markdown-split-pane-height, calc(100vh - 200px));
}

.noteentry.markdown-split-mode .markdown-codemirror-host .cm-scroller {
    max-height: var(--markdown-split-pane-height, calc(100vh - 200px));
    overflow-y: auto;
    overflow-x: hidden;
}

.noteentry.markdown-split-mode .markdown-codemirror-host .cm-content {
    min-height: var(--markdown-split-pane-height, calc(100vh - 200px));
    padding: 10px 20px 44px 10px;
    box-sizing: border-box;
}

.noteentry.markdown-split-mode .markdown-preview {
    flex: 1 1 50% !important;
    width: 50% !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 10px 10px 44px 24px !important;
    box-sizing: border-box !important;
    max-height: var(--markdown-split-pane-height, calc(100vh - 200px)) !important;
}

/* Dark mode border for split view */
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-preview {
    background: var(--dm-content-bg) !important;
}

[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor {
    border-right-color: #404040 !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode {
    --markdown-split-pane-bottom-gap: 18px;
    gap: 16px !important;
    padding: 6px 2px 10px !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-editor-container,
body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-preview {
    position: relative !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    max-height: var(--markdown-split-pane-height, calc(100vh - 240px)) !important;
    border: 1px solid #d9dee7 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-editor-container {
    overflow: hidden !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-editor {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 18px 18px 18px !important;
    border-right: none !important;
    box-sizing: border-box !important;
    max-height: none !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-codemirror-host {
    padding: 0 !important;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-codemirror-host .cm-editor,
body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-codemirror-host .cm-scroller {
    max-height: var(--markdown-split-pane-height, calc(100vh - 240px));
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-codemirror-host .cm-content {
    min-height: var(--markdown-split-pane-height, calc(100vh - 240px));
    padding: 18px;
}

body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-preview {
    min-height: 0 !important;
    padding: 18px 18px 18px !important;
}

html[data-theme='dark'] body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-editor-container,
html[data-theme='dark'] body.markdown-split-card-view .noteentry.markdown-split-mode .markdown-preview,
body.dark-mode.markdown-split-card-view .noteentry.markdown-split-mode .markdown-editor-container,
body.dark-mode.markdown-split-card-view .noteentry.markdown-split-mode .markdown-preview {
    border-color: var(--dm-border) !important;
    background: var(--dm-content-bg) !important;
}

/* Scrollbar styling for split view columns */
.noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar,
.noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar,
.noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar {
    width: 0;
    display: none;
}

.noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-track,
.noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-track,
.noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-track {
    display: none;
}

.noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-thumb,
.noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-thumb,
.noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-thumb {
    display: none;
}

.noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-thumb:hover,
.noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-thumb:hover,
.noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-thumb:hover {
    display: none;
}

/* Dark mode scrollbar for split view */
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-track,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-track,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-track {
    display: none;
}

[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-thumb,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-thumb,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-thumb {
    display: none;
}

[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container::-webkit-scrollbar-thumb:hover,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor::-webkit-scrollbar-thumb:hover,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-preview::-webkit-scrollbar-thumb:hover {
    display: none;
}

/* Firefox scrollbar styling for split view */
.noteentry.markdown-split-mode .markdown-editor-container,
.noteentry.markdown-split-mode .markdown-editor,
.noteentry.markdown-split-mode .markdown-preview {
    scrollbar-width: none;
}

[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor-container,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-editor,
[data-theme='dark'] .noteentry.markdown-split-mode .markdown-preview {
    scrollbar-width: none;
}
