/* @settings
name: CodeMirror Options
id: CodeMirror Options
settings:
  - 
    id: cm-embeds
    title: Embed Rendering
    type: heading
    level: 1
    collapsed: false
  - 
    id: cm5-minimal-embeds
    title: Minimal Page & Header Embeds in Edit Mode
    description: This will remove all padding, margin, border, and background from Page & Header embeds in Edit Mode. It will also hide the link icon until the embed is hovered over.
    type: class-toggle
  - 
    id: cm-header-theme
    title: Syntax Highlighting Theme
    type: heading
    level: 1
    collapsed: false
  -
    id: cm-theme-selection
    title: Theme
    type: class-select
    allowEmpty: false
    default: cm-theme-custom
    options:
      - 
        label: Solarized Light
        value: cm-theme-solarized-light
      - 
        label: Material Palenight
        value: cm-theme-material-palenight
      - 
        label: Dracula
        value: cm-theme-dracula
      - 
        label: Custom
        value: cm-theme-custom
  - 
    id: cm-header-styles
    title: Syntax Highlighting Styling
    type: heading
    level: 1
    collapsed: true
  -
    id: cm-font-monospace
    title: Code Block Font
    type: variable-text
    default: 'Jetbrains Mono, SFMono-Regular, Consolas, "Roboto Mono",
    monospace'
  -
    id: cm-font-size
    title: Code Block Font Size
    type: variable-text
    default: '16px'
  -
    id: cm-line-height
    title: Code Block Line Height
    type: variable-number
    default: 1.5
  -
    id: cm-font-weight
    title: Code Block Font Weight
    type: variable-number
    default: 500
  -
    id: cm-wrap-lines
    title: Code Block Wrap Lines in Peview
    type: variable-select
    default: 'pre-wrap'
    options:
        - 
          label: Wrap Lines
          value: pre-wrap
        -
          label: Do Not Wrap Lines
          value: pre
  - 
    id: cm-header-colors
    title: Syntax Highlighting Custom Colors (select theme "Custom" to enable)
    type: heading
    level: 1
    collapsed: true
  -
    id: cm-background-color
    title: Code Block Background Color
    type: variable-themed-color
    format: hex
    default-light: '#292d3e'
    default-dark: '#292d3e'
  -
    id: cm-active-line-background-color
    title: Code Block Active Line Background-Color
    type: variable-themed-color
    format: hex
    default-light: '#353a50'
    default-dark: '#353a50'
  -
    id: cm-foreground-color
    title: Code Block Foreground Color
    type: variable-themed-color
    format: hex
    default-light: '#d4d4d4'
    default-dark: '#d4d4d4'
  -
    id: cm-keyword
    title: Code Block Keyword Color
    type: variable-themed-color
    format: hex
    default-light: '#c792ea'
    default-dark: '#c792ea'
  -
    id: cm-atom
    title: Code Block Atom Color
    type: variable-themed-color
    format: hex
    default-light: '#f78c6c'
    default-dark: '#f78c6c'
  -
    id: cm-number
    title: Code Block Number Color
    type: variable-themed-color
    format: hex
    default-light: '#ff5370'
    default-dark: '#ff5370'
  -
    id: cm-type
    title: Code Block Type Color
    type: variable-themed-color
    format: hex
    default-light: '#decb6b'
    default-dark: '#decb6b'
  -
    id: cm-def
    title: Code Block Definition Color
    type: variable-themed-color
    format: hex
    default-light: '#82aaff'
    default-dark: '#82aaff'
  -
    id: cm-definition
    title: Code Block Definition-2 Color
    type: variable-themed-color
    format: hex
    default-light: '#82aaff'
    default-dark: '#82aaff'
  -
    id: cm-property
    title: Code Block Property Color
    type: variable-themed-color
    format: hex
    default-light: '#c792ea'
    default-dark: '#c792ea'
  -
    id: cm-variable
    title: Code Block Variable Color
    type: variable-themed-color
    format: hex
    default-light: '#f07178'
    default-dark: '#f07178'
  -
    id: cm-variable-2
    title: Code Block Variable-2 Color
    type: variable-themed-color
    format: hex
    default-light: '#eeffff'
    default-dark: '#eeffff'
  -
    id: cm-variable-3
    title: Code Block Variable-3 Color
    type: variable-themed-color
    format: hex
    default-light: '#f07178'
    default-dark: '#f07178'
  -
    id: cm-callee
    title: Code Block Callee Color
    type: variable-themed-color
    format: hex
    default-light: '#89ddff'
    default-dark: '#89ddff'
  -
    id: cm-qualifier
    title: Code Block Qualifier Color
    type: variable-themed-color
    format: hex
    default-light: '#decb6b'
    default-dark: '#decb6b'
  -
    id: cm-operator
    title: Code Block Operator Color
    type: variable-themed-color
    format: hex
    default-light: '#89ddff'
    default-dark: '#89ddff'
  -
    id: cm-hr
    title: Code Block HR Color
    type: variable-themed-color
    format: hex
    default-light: '#98e342'
    default-dark: '#98e342'
  -
    id: cm-link
    title: Code Block Link Color
    type: variable-themed-color
    format: hex
    default-light: '#696d70'
    default-dark: '#696d70'
  -
    id: cm-error-bg
    title: Code Block Error Color
    type: variable-themed-color
    format: hex
    default-light: '#ff5370'
    default-dark: '#ff5370'
  -
    id: cm-header
    title: Code Block Header Color
    type: variable-themed-color
    format: hex
    default-light: '#da7dae'
    default-dark: '#da7dae'
  -
    id: cm-builtin
    title: Code Block Builtin Color
    type: variable-themed-color
    format: hex
    default-light: '#ffcb6b'
    default-dark: '#ffcb6b'
  -
    id: cm-meta
    title: Code Block Meta Color
    type: variable-themed-color
    format: hex
    default-light: '#ffcb6b'
    default-dark: '#ffcb6b'
  -
    id: cm-matching-bracket
    title: Code Block Matching Bracket Color
    type: variable-themed-color
    format: hex
    default-light: '#ffffff'
    default-dark: '#ffffff'
  -
    id: cm-tag
    title: Code Block Tag Color
    type: variable-themed-color
    format: hex
    default-light: '#ff5370'
    default-dark: '#ff5370'
  -
    id: cm-tag-in-comment
    title: Code Block Tag in Comment Color
    type: variable-themed-color
    format: hex
    default-light: '#ff5370'
    default-dark: '#ff5370'
  -
    id: cm-string-2
    title: Code Block String-2 Color
    type: variable-themed-color
    format: hex
    default-light: '#f07178'
    default-dark: '#f07178'
  -
    id: cm-bracket
    title: Code Block Bracket Color
    type: variable-themed-color
    format: hex
    default-light: '#ff5370'
    default-dark: '#ff5370'
  -
    id: cm-comment
    title: Code Block Comment Color
    type: variable-themed-color
    format: hex
    default-light: '#676e95'
    default-dark: '#676e95'
  -
    id: cm-string
    title: Code Block String Color
    type: variable-themed-color
    format: hex
    default-light: '#c3e88d'
    default-dark: '#c3e88d'
  -
    id: cm-attribute
    title: Code Block Attribute Color
    type: variable-themed-color
    format: hex
    default-light: '#c792ea'
    default-dark: '#c792ea'
  -
    id: cm-attribute-in-comment
    title: Code Block Attribute In Comment Color
    type: variable-themed-color
    format: hex
    default-light: '#c792ea'
    default-dark: '#c792ea'

*/

:root {
  --cm-font-weight: 500;
  --cm-font-size: var(--editor-font-size);
  --cm-font-monospace: Jetbrains Mono, SFMono-Regular, Consolas, "Roboto Mono", monospace;
  --cm-wrap-lines: pre-wrap;
  --cm-line-height: 1.5;
}

:root,
.unified-cm-highlighting.cm-theme-custom {
  /* material: palenight theme */
  --cm-keyword: #c792ea;
  --cm-atom: #f78c6c;
  --cm-number: #ff5370;
  --cm-type: #decb6b;
  --cm-def: #82aaff;
  --cm-property: #c792ea;
  --cm-variable: #f07178;
  --cm-variable-2: #eeffff;
  --cm-variable-3: #f07178;
  --cm-definition: #82aaff;
  --cm-callee: #89ddff;
  --cm-qualifier: #decb6b;
  --cm-operator: #89ddff;
  --cm-hr: #98e342;
  --cm-link: #696d70;
  --cm-error-bg: #ff5370;
  --cm-header: #da7dae;
  --cm-builtin: #ffcb6b;
  --cm-meta: #ffcb6b;
  --cm-matching-bracket: #ffffff;
  --cm-tag: #ff5370;
  --cm-tag-in-comment: #ff5370;
  --cm-string-2: #f07178;
  --cm-bracket: #ff5370;
  --cm-comment: #676e95;
  --cm-string: #c3e88d;
  --cm-attribute: #c792ea;
  --cm-attribute-in-comment: #c792ea;
  --cm-background-color: #292d3e;
  --cm-active-line-background-color: #353a50;
  --cm-foreground-color: #d4d4d4;
}

body.unified-cm-highlighting.theme-light.cm-theme-dracula,
body.unified-cm-highlighting.theme-dark.cm-theme-dracula {
  --cm-background: #282a36;
  --cm-foreground: #f8f8f2;
  --cm-comment: #6272a4;
  --cm-string: #f1fa8c;
  --cm-string-2: #f1fa8c;
  --cm-number: #bd93f9;
  --cm-variable: #50fa7b;
  --cm-variable-2: #ffffff;
  --cm-def: #50fa7b;
  --cm-operator: #ff79c6;
  --cm-keyword: #ff79c6;
  --cm-atom: #bd93f9;
  --cm-meta: #f8f8f2;
  --cm-tag: #ff79c6;
  --cm-attribute: #50fa7b;
  --cm-qualifier: #50fa7b;
  --cm-property: #66d9ef;
  --cm-builtin: #50fa7b;
  --cm-variable-3: #ffb86c;
  --cm-type: #ffb86c;
  --cm-activeline-background: #414458;
  --cm-matchingbracket: #fffff;
}

body.unified-cm-highlighting.theme-light.cm-theme-material-palenight,
body.unified-cm-highlighting.theme-dark.cm-theme-material-palenight {
  /* material: palenight theme */
  --cm-keyword: #c792ea;
  --cm-atom: #f78c6c;
  --cm-number: #ff5370;
  --cm-type: #decb6b;
  --cm-def: #82aaff;
  --cm-property: #c792ea;
  --cm-variable: #f07178;
  --cm-variable-2: #eeffff;
  --cm-variable-3: #f07178;
  --cm-definition: #82aaff;
  --cm-callee: #89ddff;
  --cm-qualifier: #decb6b;
  --cm-operator: #89ddff;
  --cm-hr: #98e342;
  --cm-link: #696d70;
  --cm-error-bg: #ff5370;
  --cm-header: #da7dae;
  --cm-builtin: #ffcb6b;
  --cm-meta: #ffcb6b;
  --cm-matching-bracket: #ffffff;
  --cm-tag: #ff5370;
  --cm-tag-in-comment: #ff5370;
  --cm-string-2: #f07178;
  --cm-bracket: #ff5370;
  --cm-comment: #676e95;
  --cm-string: #c3e88d;
  --cm-attribute: #c792ea;
  --cm-attribute-in-comment: #c792ea;
  --cm-background-color: #292d3e;
  --cm-active-line-background-color: #353a50;
  --cm-foreground-color: #d4d4d4;
}

body.unified-cm-highlighting.theme-light.cm-theme-solarized-light,
body.unified-cm-highlighting.theme-dark.cm-theme-solarized-light {
  /* solarized */
  --cm-keyword: #cb4b16;
  --cm-atom: #d33682;
  --cm-number: #d33682;
  --cm-type: #6c71c4;
  --cm-def: #2aa198;
  --cm-property: #2aa198;
  --cm-variable: #839496;
  --cm-variable-2: #b58900;
  --cm-variable-3: #6c71c4;
  --cm-definition: #82aaff;
  --cm-callee: #89ddff;
  --cm-qualifier: #b58900;
  --cm-operator: #6c71c4;
  --cm-hr: #98e342;
  --cm-link: #93a1a1;
  --cm-error-bg: #ff5370;
  --cm-header: #586e75;
  --cm-builtin: #d33682;
  --cm-meta: #859900;
  --cm-matching-bracket: #859900;
  --cm-tag: #93a1a1;
  --cm-tag-in-comment: #ff5370;
  --cm-string-2: #b58900;
  --cm-bracket: #cb4b16;
  --cm-comment: #586e75;
  --cm-string: #859900;
  --cm-attribute: #2aa198;
  --cm-attribute-in-comment: #c792ea;
  --cm-background-color: #fdf6e3;
  --cm-active-line-background-color: #fffcf4;
  --cm-foreground-color: #657b83;
}

/* Settings Styling */

.mod-settings .setting-item.setting-disabled {
  display: none;
}

.codemirror-options-settings .info {
  font-size: 1rem;
  color: var(--text-accent);
}

.token-list-setting .setting-item-description {
  user-select: text !important;
}

.token-list-setting .setting-item-description {
  max-width: 24em;
}

/* START: Style rendered code blocks */

/* This element causes top padding and isn't needed, so we hide it */
.rendered-code-block-wrapper span[cm-text] {
  display: none;
}

/* Allow text selection */
.rendered-code-block-wrapper {
  user-select: text;
}

/* Embed Styling */
.rendered-embed-wrapper .CodeMirror-line > span {
  display: block;
  height: 0px;
}
.rendered-embed-wrapper .hmd-fold-code-embed > div > p {
  margin: 0;
}
.cm-s-obsidian .rendered-inline-embed {
  position: relative;
  border: 1px solid transparent;
}
.cm-s-obsidian .rendered-inline-embed .hmd-fold-embed-stub:hover,
.cm-s-obsidian .rendered-embed-wrapper .hmd-fold-embed-stub:hover {
  color: #fff;
  border-color: #c30;
  background: #f40;
}
.cm-s-obsidian .rendered-inline-embed .hmd-fold-embed-stub.omittable {
  display: none;
}
.cm-s-obsidian .rendered-inline-embed:hover {
  border: 1px dashed #999;
}
.cm-s-obsidian .rendered-embed-wrapper .hmd-fold-embed-stub {
  display: inline-block;
  font-size: 67%;
  color: #999;
  vertical-align: middle;
  border: 1px solid #999;
  padding: 0 0.2em;
  border-radius: 5px;
  margin: 0 0.5em;
  background-color: var(--background-primary-alt);
  cursor: pointer;
}
.cm-s-obsidian .rendered-inline-embed .hmd-fold-embed-stub {
  display: inline-block;
  font-size: 67%;
  color: #999;
  vertical-align: middle;
  border: 1px solid #999;
  padding: 0 0.2em;
  border-radius: 5px;
  margin: 0 0.5em;
  background-color: var(--background-primary-alt);
  cursor: pointer;
}
.cm-s-obsidian .rendered-inline-embed:hover .hmd-fold-embed-stub.omittable {
  display: block;
  left: 0;
  bottom: 100%;
  margin: 0;
  position: absolute;
  z-index: 100;
}
/* add padding to avoid cursor flicker when moving the cursor from line to line
   without the padding, there's a slight gap between the lines */
.rendered-inline-embed.embed-type-block :where(p, li) {
  padding: 3px 0;
}
/* render any headers as normal sized inline text to avoid any cursor/button issues */
/* why are you block referencing a header anyway? use a header ref */
.rendered-inline-embed.embed-type-block :where(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  font-size: 1em;
  display: inline;
}

/* move the <EMBED> button on list lines since Outliner hides xy overflow */
.cm-s-obsidian .HyperMD-list-line .rendered-inline-embed:hover .hmd-fold-embed-stub.omittable {
  display: block;
  left: -4.8em;
  height: 1.9em;
  top: 0;
  margin: 0;
  position: absolute;
  z-index: 100;
}
.cm-s-obsidian .HyperMD-list-line .rendered-inline-embed:hover .hmd-fold-embed-stub.omittable.flip-stub {
  display: inline-block;
  height: 1.9em;
  margin: 0;
  position: static;
  z-index: 100;
  width: auto;
}

.cm-s-obsidian .hmd-fold-html-stub.omittable,
.cm-s-obsidian .omittable.hmd-fold-code-stub {
  display: none;
}
/* End Embed Styling */

.cm-s-obsidian .rendered-code-block-wrapper .HyperMD-codeblock-begin {
  padding: 0;
}

/* Remove the default code block background and let the rendered element set it */
.rendered-code-block-wrapper .HyperMD-codeblock-bg {
  opacity: 0;
}
/* Admonitions have margins by default. We don't need these in edit mode */
/* You can add the margins back in, if you want, but you'll need to adjust the <CODE> button positioning */
.rendered-code-block-wrapper .admonition {
  margin: 0em;
}

/* END: Style rendered code blocks */

/* START: Reset default theme styling of rendered tables */

.cm-s-obsidian .CodeMirror-linewidget table.dataview td,
.cm-s-obsidian .CodeMirror-linewidget table.dataview th,
.cm-s-obsidian .hmd-fold-html table.dataview td,
.cm-s-obsidian .hmd-fold-html table.dataview th {
  border: unset;
  padding: 4px 10px;
}

.cm-s-obsidian .CodeMirror-linewidget .table-view-table.dataview > thead > tr > th {
  font-weight: 700;
  font-size: larger;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: solid;
  max-width: 100%;
  /* padding: 0px; */
}

/* START: Banner rendering */

body.cm-render-banners div[data-banner] .CodeMirror-code {
  margin-top: var(--banner-height);
  /* margin-bottom: calc(-1 * var(--banner-height)); */
}

/* body.cm-render-banners div[data-banner] .CodeMirror-lines>div>div:last-child {
  margin-bottom: calc(-1 * var(--banner-height));
} */

/* the style below is needed to ensure the banner isn't removed when there is
   no vertical scroll bar */
body.cm-render-banners div[data-banner] .CodeMirror-vscrollbar {
  display: block;
  bottom: 0;
}
body.cm-render-banners div[data-banner] .CodeMirror-vscrollbar::before {
  content: "";
  height: var(--banner-height);
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--banner);
  background-size: cover;
  background-position: var(--banner_x) var(--banner_y);
}
body.cm-render-banners div[data-banner] .CodeMirror-gutter.CodeMirror-linenumbers,
body.cm-render-banners .mod-root div[data-banner] .CodeMirror-gutter.CodeMirror-foldgutter {
  background: transparent;
}
body.cm-render-banners div[data-banner][data-banner-style="gradient"] .CodeMirror-vscrollbar::before {
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

/* END: Banner rendering */

/* START: Rendered code & html block <CODE> button styling and placement */

.rendered-code-block-wrapper .CodeMirror-line .CodeMirror-widget,
.rendered-html-block-wrapper .CodeMirror-line .CodeMirror-widget,
.rendered-embed-wrapper .CodeMirror-line .CodeMirror-widget {
  position: absolute;
  left: 5px;
  top: -1.5em;
  padding-bottom: 0.5em;
  z-index: 3;
  line-height: 1.5;
  display: none;
}
.cm-s-obsidian .CodeMirror-linewidget.rendered-html-block,
.cm-s-obsidian .CodeMirror-linewidget.rendered-embed,
.cm-s-obsidian .CodeMirror-linewidget.rendered-code-block {
  padding: 0 5px;
}
.rendered-html-block-wrapper:hover .CodeMirror-line .CodeMirror-widget,
.rendered-embed-wrapper:hover .CodeMirror-line .CodeMirror-widget,
.rendered-code-block-wrapper:hover .CodeMirror-line .CodeMirror-widget {
  display: inline-flex;
}
.rendered-html-block-wrapper .CodeMirror-linewidget,
.rendered-embed-wrapper .CodeMirror-linewidget,
.rendered-code-block-wrapper .CodeMirror-linewidget {
  /* this is needed to have CM properly calculate the widget height */
  /* when using display: block, margins on child elements don't cause the parent to expand */
  display: grid;
}
.mod-root .markdown-source-view.is-readable-line-width .rendered-embed-wrapper .CodeMirror,
.mod-root .is-readable-line-width .rendered-embed-wrapper .markdown-preview-section {
  padding-left: 0;
  padding-right: 0;
  margin: 0 auto 0 auto;
  width: auto;
  max-width: 100%;
}
/* fixes for yinyang embeds getting cut off on the right side gutter */
.rendered-embed .hmd-fold-embed-content,
.rendered-inline-embed:not(.embed-type-block) .markdown-embed-content {
  max-width: 100%;
}
/* fixes for yinyang embeds getting cut off on the right side gutter */
.rendered-inline-embed:not(.embed-type-block) > div {
  width: 100%;
}
.cm-s-obsidian .CodeMirror-widget :where(.hmd-fold-code-stub, .hmd-fold-html-stub, .hmd-fold-embed-stub) {
  font-size: 0.7rem;
  font-family: var(--font-monospace);
  font-weight: 600;
  margin: 0;
  padding: 0em 0.2em;
  line-height: 1.75em;
}

/* END: Rendered code block <CODE> button styling and placement */

/* Inline Embed Styling */
.rendered-inline-embed div.markdown-embed {
  border-top: none;
  /* border-bottom-color: var(--block-ref-color); */
  /* border-bottom-style: dashed; */
  padding: 0px;
  margin: 0px;
}
/* .rendered-inline-embed .markdown-embed-content {
  white-space: normal;
} */
.rendered-inline-embed > div > p,
.rendered-embed > div > p {
  margin-block: 0;
}
.rendered-inline-embed > div,
.rendered-inline-embed > div > p {
  display: inline;
}
/* .rendered-embed p:first-of-type {
  margin-block: 0;
} */
.CodeMirror-linewidget.rendered-widget {
  padding: 0 5px;
}
/* fix styling of "file not created yet" block */
.rendered-embed .file-embed:hover {
  background-color: none;
  border: none;
}
.rendered-inline-embed.embed-type-block .markdown-embed,
.rendered-inline-embed.embed-type-block .file-embed {
  border: none;
}
/* fix rendering of embedded pdfs */
.rendered-embed .internal-embed:not(.image-embed) {
  display: block;
}
.rendered-embed .pdf-embed {
  width: 100%;
  height: 800px;
}
/* style inline block refs */
.rendered-inline-embed.embed-type-block,
.rendered-inline-embed.embed-type-block .markdown-embed,
.rendered-inline-embed.embed-type-block .markdown-embed > .markdown-embed-content,
.rendered-inline-embed.embed-type-block .markdown-embed > .markdown-embed-content > .markdown-preview-view,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  > div,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  > div
  > p,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  > div
  > div {
  display: inline;
  padding: 0px !important;
  margin: 0px !important;
}

/* Convert bullet list block refs inline (remove the bullet) */
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  ul,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  li,
.rendered-inline-embed.embed-type-block
  .markdown-embed
  > .markdown-embed-content
  > .markdown-preview-view
  > .markdown-preview-sizer
  li
  > div {
  /* inline-flex solves the list item embedded into not list item problem */
  display: inline;
}
.rendered-inline-embed.embed-type-block span.internal-embed {
  white-space: normal;
}
.rendered-inline-embed.embed-type-block .markdown-preview-view span.internal-embed {
  display: inline;
}
.rendered-inline-embed.embed-type-block
  div.markdown-embed
  > div.markdown-embed-content
  > div.markdown-preview-view
  > div.markdown-preview-section
  ul {
  padding: 0px !important;
  margin: 0px !important;
}

/* Hide the block ref link since we created our own */
.rendered-inline-embed.embed-type-block div.markdown-embed > div.markdown-embed-link {
  display: none;
}

.rendered-inline-embed.embed-type-block:hover {
  cursor: pointer;
}

.rendered-inline-embed.embed-type-block
  div.markdown-embed
  > div.markdown-embed-content
  > div.markdown-preview-view
  > div.markdown-preview-section {
  min-height: 0px !important;
}
/* END: Inline Embed Styling */

/* START: Render HTML Styling */

.cm-s-obsidian .hmd-fold-html {
  position: relative;
  border: 1px solid transparent;
}

/* END: Render HTML Styling */

/* Ozan doesn't have a setting to only disable image rendering 
   so here we try and hide them if the "render images" setting is on */
.cm-render-images-inline
  .oz-image-widget
  img:where([src*=".png"], [src*=".gif"], [src*=".svg"], [src*=".bmp"], [src*=".jpg"], [src*=".jpeg"]) {
  display: none;
}

/* prevent images from wrapping when embedded in list items */
.cm-render-images-inline .cm-s-obsidian .HyperMD-list-line img.hmd-image {
  max-width: 99%;
}

.cm-render-images-inline .cm-s-obsidian img.hmd-image {
  vertical-align: baseline;
}

/* Hide Tokens Styling */
/* Note: Most of the token hiding styling is already in the base Obsidian theme */

.hide-tokens .cm-s-obsidian pre.hmd-inactive-line.HyperMD-hr span.cm-hr {
  color: transparent;
  background-color: transparent;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-hr {
  left: 0;
  right: 0;
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAQAAAAziH6sAAAADklEQVR42mOc+Z9x5n8ACTkDM4ikM1IAAAAASUVORK5CYII=)
    repeat-x 0 center;
}

/* Table Styling */
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row span.cm-hmd-table-sep:before {
  content: "|";
  color: transparent;
  top: 0;
  height: 100%;
  position: absolute;
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mOc+R8AAjcBmvywMWoAAAAASUVORK5CYII=)
    repeat-y center 0;
  pointer-events: none;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row > span {
  display: inline-block;
  border-top: 1px solid #999;
  margin-right: 50px;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-0 > span,
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-1 > span,
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-2 > span {
  border-top: 0;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row span.cm-hmd-table-sep {
  width: 15px;
  text-align: center;
  box-sizing: content-box;
  font-weight: 400;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row span.cm-hmd-table-sep.cm-hmd-table-sep-dummy {
  width: 1em;
}
.cm-s-obsidian .HyperMD-table-row > :last-child {
  padding-right: 0px !important;
}
.hide-tokens
  .cm-s-obsidian
  pre.hmd-inactive-line.HyperMD-table-row
  span.cm-hmd-table-sep.cm-hmd-table-sep-dummy:before {
  display: none;
}
.hide-tokens .cm-s-obsidian pre.hmd-inactive-line.HyperMD-table-row-1 > span {
  color: transparent !important;
  text-shadow: none;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row span.cm-hmd-table-sep:before {
  content: "|";
  color: transparent;
  top: 0;
  height: 100%;
  position: absolute;
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mOc+R8AAjcBmvywMWoAAAAASUVORK5CYII=)
    repeat-y center 0;
  pointer-events: none;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-0 {
  font-weight: 600;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-0 span.cm-strong {
  font-weight: 800;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row .hmd-table-column-content {
  padding: 4px 1px;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-1 {
  line-height: 8px;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-1 > span {
  border-bottom: 0;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-1 .hmd-table-column-content {
  padding: 1px;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-0 > span {
  border-bottom: 0;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-0 span.hmd-table-column-content {
  padding-bottom: 1px;
}
.hide-tokens .cm-s-obsidian pre.HyperMD-table-row.HyperMD-table-row-2 span.hmd-table-column-content {
  padding-top: 1px;
}

.cm-s-obsidian span.hmd-hidden-token.cm-formatting-link,
.cm-s-obsidian span.hmd-hidden-token.cm-formatting-highlight,
.cm-s-obsidian span.hmd-hidden-token.cm-internal-link-url,
.cm-s-obsidian span.hmd-hidden-token.cm-internal-link-ref {
  display: inline;
  font-size: 1px !important;
  letter-spacing: -1ch;
  font-family: monospace;
  color: transparent;
}
.hide-tokens .cm-s-obsidian pre.hmd-inactive-line span.cm-formatting-quote {
  color: transparent;
}

/* fold links */
.cm-s-obsidian .hmd-link-icon::after {
  content: " " !important;
  text-shadow: none !important;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 4px;
  opacity: 1;
  padding-left: 1px;
  background-color: var(--text-accent);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="slategrey" d="M13 3l3.293 3.293l-7 7l1.414 1.414l7-7L21 11V3z"/><path fill="slategrey" d="M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"></path></svg>');
}

body .cm-s-obsidian span.hmd-link-icon {
  opacity: 0.6;
}

.cm-s-obsidian.HyperMD-with-meta span.cm-url,
.cm-s-obsidian.HyperMD-with-meta span.cm-link,
.cm-s-obsidian.HyperMD-with-meta span.cm-hmd-internal-link,
.cm-s-obsidian.HyperMD-with-meta .cm-link + .CodeMirror-widget,
.cm-s-obsidian.HyperMD-with-meta span.cm-hashtag,
.cm-s-obsidian.HyperMD-with-ctrl span.cm-url,
.cm-s-obsidian.HyperMD-with-ctrl span.cm-link,
.cm-s-obsidian.HyperMD-with-ctrl span.cm-hmd-internal-link,
.cm-s-obsidian.HyperMD-with-ctrl .cm-link + .CodeMirror-widget,
.cm-s-obsidian.HyperMD-with-ctrl span.cm-hashtag {
  cursor: pointer;
}

/* set the new text selection mode to use --text-selection */
body.style-active-selection span.CodeMirror-selectedtext {
  background-color: var(--text-selection) !important;
}

/* disable the default CodeMirror selection */
body.style-active-selection .CodeMirror-selected {
  background: transparent !important;
}

/* these two styles are needed for line nums and copy blocks to position properly */
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian[class*="language-"],
body.unified-cm-highlighting.cm-show-copy-button-on-pre[class*="theme-"] .markdown-preview-view pre {
  position: relative;
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian[class*="language-"] code,
body.unified-cm-highlighting.cm-show-copy-button-on-pre[class*="theme-"] .markdown-preview-view pre code {
  position: static !important;
}

/* START Setting: Show Line Numbers === true */
body.unified-cm-highlighting.cm-show-line-nums[class*="theme-"] .cm-linenumber {
  position: absolute;
  left: 0.5em;
  user-select: none;
  color: var(--cm-comment);
}

body.unified-cm-highlighting.cm-show-line-nums[class*="theme-"] .markdown-preview-view pre {
  padding-left: 3em !important;
}

/* END Setting: Show Line Numbers === true */

/* START Copy button */
body.fallback-highlighting[class*="theme-"] .markdown-preview-view button.copy {
  display: inline-block;
  height: 30px;
  padding: 0 12px;
  color: var(--cm-foreground-color);
  text-align: center;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: 0.1rem;
  text-transform: uppercase !important;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border-radius: 4px;
  border: 1px solid var(--cm-foreground-color);
  cursor: pointer;
  box-sizing: border-box;
}
body.fallback-highlighting[class*="theme-"] .markdown-preview-view button.copy {
  color: var(--cm-foreground-color);
  position: absolute;
  right: 0rem;
  top: 0.6rem;
  opacity: 0;
  z-index: 1;
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre:hover button.copy {
  background: var(--cm-background-color);
  opacity: 1;
}
/* END Copy button */

/* body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock,
body.fallback-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock {
    --code-bg: var(--cm-background-color);
    --note: var(--cm-background-color);
} */

body.unified-cm-highlighting[class*="theme-"] .HyperMD-codeblock-bg,
body.fallback-highlighting[class*="theme-"] .HyperMD-codeblock-bg {
  /* this is required to override YingYang's !important declaration */
  /* will remove as soon as it's removed from YinYang */
  --pre-code: var(--cm-background-color);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-section code {
  /* this is required to override YingYang's !important declaration */
  /* will remove as soon as it's removed from YinYang */
  --inline-code: var(--cm-foreground-color);
}

/* Reasoning for body.unified-cm-highlighting[class*="theme-"]  */
/* I had to get very specific to override the styling from Editor Syntax Highlighing and themes like Yin and Yang */

/* Setting the cursor since the cursor is black by default in the base theme
   * and it gets lost in a code black with a black background */
body.unified-cm-highlighting[class*="theme-"] .CodeMirror-cursor {
  --cursor-color: #afbaff;
  border-color: var(--cursor-color);
}

body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-opening-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-closing-tag {
  color: var(--cm-comment) !important;
}

body.unified-cm-highlighting[class*="theme-"] .CodeView,
body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian,
body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-gutter,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian div.HyperMD-codeblock-bg, /* code block in edit mode */
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-linebackground, /* frontmatter block in edit mode */
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .templater-command-bg, /* templater block in edit mode */
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .templater-inline .cm-templater-command, /* templater inline in edit mode */
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.CodeMirror-linebackground, /* math block in edit mode */
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre[class*="language-"],
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre[class*="language-"] code /* code block in preview mode */ {
  background: var(--cm-background-color);
  background-color: var(--cm-background-color);
  text-shadow: none; /* just no */
}
body.fallback-highlighting[class*="theme-"] code[class*="language-"],
body.unified-cm-highlighting[class*="theme-"] code[class*="language-"] {
  display: block;
}

/* edit modes */
body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter,
body.unified-cm-highlighting[class*="theme-"] .cm-templater-command,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math,
body.unified-cm-highlighting[class*="theme-"] .HyperMD-codeblock,
body.unified-cm-highlighting[class*="theme-"] .cm-hmd-codeblock {
  background: transparent;
  --font-monospace: var(--cm-font-monospace);
  color: var(--cm-foreground-color);
  font-family: var(--cm-font-monospace);
  font-weight: var(--cm-font-weight);
  line-height: var(--cm-line-height);
  font-size: var(--cm-font-size);
  white-space: pre-wrap; /* lines must wrap in edit mode or it breaks CM */
}

/* preview modes */
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian[class*="language-"],
body.fallback-highlighting[class*="theme-"] .markdown-preview-view code[class*="language-"],
body.fallback-highlighting[class*="theme-"] .markdown-preview-view .HyperMD-codeblock,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view .cm-hmd-codeblock {
  --font-monospace: var(--cm-font-monospace);
  color: var(--cm-foreground-color);
  font-family: var(--cm-font-monospace);
  font-weight: var(--cm-font-weight);
  line-height: var(--cm-line-height);
  font-size: var(--cm-font-size);
  white-space: var(--cm-wrap-lines);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-keyword,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-keyword,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-keyword,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-keyword,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-keyword,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-keyword {
  color: var(--cm-keyword);
  font-weight: normal;
}

body.cm5-minimal-embeds .CodeMirror-linewidget .rendered-embed .markdown-embed,
body.cm5-minimal-embeds .CodeMirror-linewidget .rendered-embed .markdown-embed .markdown-preview-view,
body.cm5-minimal-embeds .rendered-inline-embed .markdown-embed,
body.cm5-minimal-embeds .rendered-inline-embed .markdown-embed .markdown-preview-view {
  border: none !important; /* had to in order tp override primary theme */
  margin: 0;
  padding: 0;
  background: none;
}
body.cm5-minimal-embeds .CodeMirror-linewidget .rendered-embed .markdown-embed .markdown-embed-link {
  opacity: 0;
}
body.cm5-minimal-embeds .CodeMirror-linewidget .rendered-embed:hover .markdown-embed .markdown-embed-link {
  opacity: 1;
}

body.cm5-minimal-embeds .CodeMirror-linewidget.rendered-widget {
  padding: 0;
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-atom,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-atom,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-atom,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-atom,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-atom,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-atom {
  color: var(--cm-atom);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-number,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-number,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-number,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-number,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-number,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-number {
  color: var(--cm-number);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines span.cm-type,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-hmd-frontmatter.cm-type,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-templater-command.cm-type,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-math.cm-type,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock span.cm-type,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian span.cm-type {
  color: var(--cm-type);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-def,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-def {
  color: var(--cm-def);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines span.cm-property,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-hmd-frontmatter.cm-property,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-templater-command.cm-property,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-math.cm-property,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock span.cm-property,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian span.cm-property {
  color: var(--cm-property);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines span.cm-variable,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-templater-command.cm-variable,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-math.cm-variable,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock span.cm-variable,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian span.cm-variable {
  color: var(--cm-variable);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines span.cm-variable-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-templater-command.cm-variable-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-math.cm-variable-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock span.cm-variable-2,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian span.cm-variable-2 {
  color: var(--cm-variable-2);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines span.cm-variable-3,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-3,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-templater-command.cm-variable-3,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian span.cm-math.cm-variable-3,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock span.cm-variable-3,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian span.cm-variable-3 {
  color: var(--cm-variable-3);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-type.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-type.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-type.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-type.cm-def,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-type.cm-def,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-type.cm-def {
  color: var(--cm-definition);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-callee,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-callee,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-callee,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-callee,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-callee,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-callee {
  color: var(--cm-callee);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-operator,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-operator,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-operator,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-operator,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-operator,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-operator {
  color: var(--cm-operator);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-qualifier,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-qualifier,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-qualifier,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-qualifier,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-qualifier,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-qualifier {
  color: var(--cm-qualifier);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-tag,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-tag {
  color: var(--cm-tag);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-tag.cm-bracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-tag.cm-bracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-tag.cm-bracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-tag.cm-bracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-tag.cm-bracket,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-tag.cm-bracket {
  color: var(--cm-bracket);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-attribute,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-attribute {
  color: var(--cm-attribute);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-comment,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-comment,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-comment,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-comment,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-comment,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-comment {
  color: var(--cm-comment);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-comment.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-comment.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-comment.cm-attribute,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-comment.cm-attribute,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-comment.cm-attribute {
  color: var(--cm-attribute-in-comment);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-comment.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-comment.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-comment.cm-tag,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-comment.cm-tag,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-comment.cm-tag {
  color: var(--cm-tag-in-comment);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-string,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-string,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-string,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-string,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-string,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-string {
  color: var(--cm-string);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-string-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-string-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-string-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-string-2,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-string-2,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-string-2 {
  color: var(--cm-string-2);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-meta,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-meta,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-meta,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-meta,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-meta,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-meta {
  color: var(--cm-meta);
  /* background: var(--cm-background-color); */
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-builtin,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-builtin,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-builtin,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-builtin,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-builtin,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-builtin {
  color: var(--cm-builtin);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-header,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-header,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-header,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-header,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-header,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-header {
  color: var(--cm-header);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-hr,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-hr,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-hr,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-hr,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-hr,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-hr {
  color: var(--cm-hr);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-link,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-link,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-link,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-link,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-link,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-link {
  color: var(--cm-link);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .cm-error,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.cm-error,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.cm-error,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.cm-error,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .cm-error,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .cm-error {
  color: white;
  background-color: var(--cm-error-bg);
}

body.unified-cm-highlighting[class*="theme-"]
  .CodeView
  .cm-s-obsidian
  .CodeMirror-lines
  .CodeMirror-activeline-background,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-activeline-background,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.CodeMirror-activeline-background,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.CodeMirror-activeline-background,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock-bg.CodeMirror-activeline-background,
body.unified-cm-highlighting[class*="theme-"]
  .markdown-preview-view
  pre.cm-s-obsidian
  .CodeMirror-activeline-background {
  background: var(--cm-active-line-background-color);
}

body.unified-cm-highlighting[class*="theme-"] .CodeView .cm-s-obsidian .CodeMirror-lines .CodeMirror-matchingbracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-matchingbracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-templater-command.CodeMirror-matchingbracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .cm-math.CodeMirror-matchingbracket,
body.unified-cm-highlighting[class*="theme-"] .cm-s-obsidian .HyperMD-codeblock .CodeMirror-matchingbracket,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre.cm-s-obsidian .CodeMirror-matchingbracket {
  text-decoration: underline;
  color: rgb(var(--cm-matching-bracket)) !important;
}

/* END CODE BLOCK EDITOR MODE SYNTAX HIGHLIGHTING[class*="theme-"] */

/* FALL BACK CODE BLOCK PREVIEW MODE SYNTAX HIGHLIGHTING */

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre[class*="language-"] {
  /* material: palenight theme */
  background-color: var(--cm-background-color);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code,
body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code * {
  text-shadow: none;
  color: var(--cm-foreground-color);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.keyword {
  color: var(--cm-keyword);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.class-name {
  color: var(--cm-def);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.class {
  color: var(--cm-qualifier);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.function {
  color: var(--cm-def);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.punctuation {
  color: var(--cm-foreground-color);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.operator {
  color: var(--cm-operator);
  background: transparent;
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.entity {
  color: var(--cm-attribute);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.parameter {
  color: var(--cm-property);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.property {
  color: var(--cm-property);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.important {
  color: var(--cm-error-bg);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.attr-name {
  color: var(--cm-tag);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.attr-value {
  color: var(--cm-string);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.builtin {
  color: var(--cm-builtin);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.string {
  color: var(--cm-string);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.number {
  color: var(--cm-number);
}

body.fallback-highlighting[class*="theme-"] .markdown-preview-view pre code span.unit {
  color: var(--cm-number);
}

/* END FALL BACK CODE BLOCK PREVIEW MODE SYNTAX HIGHLIGHTING */

/* START Mathjax Preview */

.hmd-math-mathjax mjx-container[jax="CHTML"][display="true"] {
  margin: 0;
}

#math-preview.float-win {
  position: absolute;
  position: fixed;
  z-index: 3;
  background: var(--background-primary);
  background-image: linear-gradient(to bottom, var(--background-primary), var(--background-primary-alt));
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
  max-width: 70%;
}

#math-preview.float-win-hidden {
  display: none;
}

#math-preview .float-win-close {
  position: absolute;
  right: 0;
  height: 100%;
  top: 0;
  color: #fff;
  border: 0;
  background-color: transparent;
  cursor: pointer;
  width: 28px;
  border: none !important;
  margin-right: 4px;
  padding: 0;
  vertical-align: middle;
}

#math-preview .float-win-close:hover {
  background-color: transparent !important;
}

#math-preview .float-win-title {
  position: relative;
  background: var(--text-accent);
  font-size: 0.87em;
  color: var(--background-primary);
  padding: 5px 15px;
  padding-right: 50px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: move;
}

#math-preview .float-win-content {
  max-height: 80vh;
  overflow: auto;
  padding: 10px 20px;
}
#math-preview button.float-win-close:focus {
  box-shadow: none;
}
#math-preview .float-win-close .icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  stroke-width: 0;
  color: var(--background-primary);
  stroke: currentColor;
  fill: currentColor;
  vertical-align: bottom;
}
/* END Mathjax preview */
