/* LatentK Notebook 1.2.0 | MIT
 * Built from src/styles/tokens.css and LXGW WenKai Screen.
 * Font: SIL OFL 1.1, see FONT-LICENSE.txt and FONT-NOTICE.txt.
 */
/* LXGW WenKai Screen [4] */
/* LXGW WenKai Screen [5] */
/* LXGW WenKai Screen [6] */
/* LXGW WenKai Screen [21] */
/* LXGW WenKai Screen [22] */
/* LXGW WenKai Screen [23] */
/* LXGW WenKai Screen [24] */
/* LXGW WenKai Screen [25] */
/* LXGW WenKai Screen [26] */
/* LXGW WenKai Screen [27] */
/* LXGW WenKai Screen [28] */
/* LXGW WenKai Screen [29] */
/* LXGW WenKai Screen [30] */
/* LXGW WenKai Screen [31] */
/* LXGW WenKai Screen [32] */
/* LXGW WenKai Screen [33] */
/* LXGW WenKai Screen [34] */
/* LXGW WenKai Screen [35] */
/* LXGW WenKai Screen [36] */
/* LXGW WenKai Screen [37] */
/* LXGW WenKai Screen [38] */
/* LXGW WenKai Screen [39] */
/* LXGW WenKai Screen [40] */
/* LXGW WenKai Screen [41] */
/* LXGW WenKai Screen [42] */
/* LXGW WenKai Screen [43] */
/* LXGW WenKai Screen [44] */
/* LXGW WenKai Screen [45] */
/* LXGW WenKai Screen [46] */
/* LXGW WenKai Screen [47] */
/* LXGW WenKai Screen [48] */
/* LXGW WenKai Screen [49] */
/* LXGW WenKai Screen [50] */
/* LXGW WenKai Screen [51] */
/* LXGW WenKai Screen [52] */
/* LXGW WenKai Screen [53] */
/* LXGW WenKai Screen [54] */
/* LXGW WenKai Screen [55] */
/* LXGW WenKai Screen [56] */
/* LXGW WenKai Screen [57] */
/* LXGW WenKai Screen [58] */
/* LXGW WenKai Screen [59] */
/* LXGW WenKai Screen [60] */
/* LXGW WenKai Screen [61] */
/* LXGW WenKai Screen [62] */
/* LXGW WenKai Screen [63] */
/* LXGW WenKai Screen [64] */
/* LXGW WenKai Screen [65] */
/* LXGW WenKai Screen [66] */
/* LXGW WenKai Screen [67] */
/* LXGW WenKai Screen [68] */
/* LXGW WenKai Screen [69] */
/* LXGW WenKai Screen [70] */
/* LXGW WenKai Screen [71] */
/* LXGW WenKai Screen [72] */
/* LXGW WenKai Screen [73] */
/* LXGW WenKai Screen [74] */
/* LXGW WenKai Screen [75] */
/* LXGW WenKai Screen [76] */
/* LXGW WenKai Screen [77] */
/* LXGW WenKai Screen [78] */
/* LXGW WenKai Screen [79] */
/* LXGW WenKai Screen [80] */
/* LXGW WenKai Screen [81] */
/* LXGW WenKai Screen [82] */
/* LXGW WenKai Screen [83] */
/* LXGW WenKai Screen [84] */
/* LXGW WenKai Screen [85] */
/* LXGW WenKai Screen [86] */
/* LXGW WenKai Screen [87] */
/* LXGW WenKai Screen [88] */
/* LXGW WenKai Screen [89] */
/* LXGW WenKai Screen [90] */
/* LXGW WenKai Screen [91] */
/* LXGW WenKai Screen [97] */
/* LXGW WenKai Screen [98] */
/* LXGW WenKai Screen [99] */
/* LXGW WenKai Screen [100] */
/* LXGW WenKai Screen [101] */
/* LXGW WenKai Screen [102] */
/* LXGW WenKai Screen [103] */
/* LXGW WenKai Screen [104] */
/* LXGW WenKai Screen [105] */
/* LXGW WenKai Screen [106] */
/* LXGW WenKai Screen [107] */
/* LXGW WenKai Screen [108] */
/* LXGW WenKai Screen [109] */
/* LXGW WenKai Screen [110] */
/* LXGW WenKai Screen [111] */
/* LXGW WenKai Screen [112] */
/* LXGW WenKai Screen [113] */
/* LXGW WenKai Screen [114] */
/* LXGW WenKai Screen [115] */
/* LXGW WenKai Screen [116] */
/* LXGW WenKai Screen [117] */
/* LXGW WenKai Screen [118] */
/* LXGW WenKai Screen [119] */
body.theme-light {
  --lk-paper: #f6f7f4;
  --lk-paper-2: #ffffff;
  --lk-erased: #e0e3e0;
  --lk-pencil: #1f2433;
  --lk-pencil-60: rgba(31, 36, 51, 0.6);
  --lk-pencil-45: rgba(31, 36, 51, 0.45);
  --lk-pencil-25: rgba(31, 36, 51, 0.25);
  --lk-pencil-12: rgba(31, 36, 51, 0.12);
  --lk-marker: #c4562f;
  --lk-pen: #3b4f9e;
  --lk-postit: #e6ebfa;
  --lk-postit-2: #dcefe4;
  --lk-postit-3: #f8e5dc;
  --lk-tape: rgba(255, 236, 150, 0.7);
  --accent-h: 227.879;
  --accent-s: 45.622%;
  --accent-l: 42.549%;

  --color-red: #aa363f; --color-orange: #9c5915; --color-yellow: #8c6b10;
  --color-green: #2b7549; --color-cyan: #247789; --color-blue: #3b4f9e;
  --color-purple: #74549d; --color-pink: #a83b68;
  --color-red-rgb: 170,54,63; --color-orange-rgb: 156,89,21; --color-yellow-rgb: 140,107,16;
  --color-green-rgb: 43,117,73; --color-cyan-rgb: 36,119,137; --color-blue-rgb: 59,79,158;
  --color-purple-rgb: 116,84,157; --color-pink-rgb: 168,59,104;
  color-scheme: light;
}
body.theme-dark {
  --lk-paper: #171a22;
  --lk-paper-2: #1f232e;
  --lk-erased: #2b3040;
  --lk-pencil: #e6e8ef;
  --lk-pencil-60: rgba(230, 232, 239, 0.65);
  --lk-pencil-45: rgba(230, 232, 239, 0.45);
  --lk-pencil-25: rgba(230, 232, 239, 0.25);
  --lk-pencil-12: rgba(230, 232, 239, 0.12);
  --lk-marker: #e07a55;
  --lk-pen: #8ea2e8;
  --lk-postit: #2e3650;
  --lk-postit-2: #2b4a3a;
  --lk-postit-3: #4a3330;
  --lk-tape: rgba(255, 236, 150, 0.35);
  --accent-h: 226.667;
  --accent-s: 66.176%;
  --accent-l: 73.333%;

  --color-red: #ef8d96; --color-orange: #f0ae68; --color-yellow: #ddc775;
  --color-green: #7fbf9a; --color-cyan: #80c2d0; --color-blue: #8ea2e8;
  --color-purple: #bea0df; --color-pink: #e691b5;
  --color-red-rgb: 239,141,150; --color-orange-rgb: 240,174,104; --color-yellow-rgb: 221,199,117;
  --color-green-rgb: 127,191,154; --color-cyan-rgb: 128,194,208; --color-blue-rgb: 142,162,232;
  --color-purple-rgb: 190,160,223; --color-pink-rgb: 230,145,181;
  --lk-tape: rgba(255, 236, 150, 0.35);
  color-scheme: dark;
}

/* LatentK Notebook — app styles. Colors and font faces are added by build.mjs.
   Prefer Obsidian variables so Reading, Live Preview, and Source share tokens.
   Never transform CodeMirror lines: cursor coordinates must remain stable. */
body.theme-light, body.theme-dark {
  --lk-font-body: 'LXGW WenKai Screen', 'KaiTi', 'STKaiti', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-interface-theme: var(--lk-font-body);
  --font-text-theme: var(--lk-font-body);
  --font-monospace-theme: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'LXGW WenKai Screen', monospace;
  --lk-radius: 180px 15px 180px 15px / 15px 180px 15px 180px;
  --lk-radius-code: 12px 20px 16px 14px / 14px 16px 20px 12px;
  --lk-dots: radial-gradient(var(--lk-erased) 1px, transparent 1px);
  --lk-grid-size: 24px;
  --lk-callout-tape-space: 0.65em;
  --lk-card-shadow: 3px 3px 0 color-mix(in srgb, var(--lk-pencil) 10%, transparent);
  --lk-ui-shadow: 2px 2px 0 color-mix(in srgb, var(--lk-pencil) 25%, transparent);

  --background-primary: var(--lk-paper);
  --background-primary-alt: var(--lk-paper-2);
  --background-secondary: var(--lk-paper-2);
  --background-secondary-alt: var(--lk-paper);
  --background-modifier-border: var(--lk-pencil-25);
  --background-modifier-border-hover: var(--lk-pencil-60);
  --background-modifier-border-focus: var(--lk-pen);
  --background-modifier-hover: var(--lk-pencil-12);
  --background-modifier-active-hover: var(--lk-postit);
  --background-modifier-form-field: var(--lk-paper-2);
  --background-modifier-message: var(--lk-paper-2);
  --background-modifier-info: var(--lk-postit);
  --tooltip-background: var(--lk-paper-2);
  --tooltip-color: var(--lk-pencil);
  /* Native controls expect solid semantic fills, not pastel card surfaces. */
  --lk-on-solid: #ffffff;
  --background-modifier-error: var(--color-red);
  --background-modifier-error-hover: color-mix(in srgb, var(--color-red) 88%, var(--lk-pencil));
  --background-modifier-success: var(--color-green);
  --interactive-normal: var(--lk-paper-2);
  --interactive-hover: var(--lk-postit);
  --interactive-accent: var(--color-accent);
  --interactive-accent-hover: var(--color-accent-2);
  --text-normal: var(--lk-pencil);
  --text-muted: color-mix(in srgb, var(--lk-pencil) 75%, var(--lk-paper));
  --text-faint: color-mix(in srgb, var(--lk-pencil) 68%, var(--lk-paper));
  --text-on-accent: var(--lk-on-solid);
  --text-on-accent-inverted: #171a22;
  --text-accent: var(--lk-pen);
  --text-accent-hover: color-mix(in srgb, var(--lk-marker) 50%, var(--lk-pencil));
  --text-selection: color-mix(in srgb, var(--lk-pen) 22%, transparent);
  --text-highlight-bg: var(--lk-postit-3);
  --caret-color: var(--lk-marker);
  --text-error: var(--color-red);
  --text-warning: var(--color-orange);
  --text-success: var(--color-green);
  --color-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --color-accent-1: var(--color-accent);
  --color-accent-2: color-mix(in srgb, var(--color-accent) 88%, var(--lk-pencil));

  --color-base-00: var(--lk-paper-2);
  --color-base-05: var(--lk-paper);
  --color-base-10: var(--lk-paper);
  --color-base-20: var(--lk-erased);
  --color-base-25: color-mix(in srgb, var(--lk-pencil) 18%, var(--lk-paper));
  --color-base-30: color-mix(in srgb, var(--lk-pencil) 25%, var(--lk-paper));
  --color-base-35: color-mix(in srgb, var(--lk-pencil) 32%, var(--lk-paper));
  --color-base-40: color-mix(in srgb, var(--lk-pencil) 40%, var(--lk-paper));
  --color-base-50: color-mix(in srgb, var(--lk-pencil) 50%, var(--lk-paper));
  --color-base-60: color-mix(in srgb, var(--lk-pencil) 68%, var(--lk-paper));
  --color-base-70: color-mix(in srgb, var(--lk-pencil) 75%, var(--lk-paper));
  --color-base-100: var(--lk-pencil);

  --line-height-normal: 1.9;
  --line-height-tight: 1.45;
  --p-spacing: 1.1rem;
  --file-line-width: 44rem;
  --file-margins: 32px;
  --heading-spacing: 1.8em;
  --h1-size: 2.2em;
  --h2-size: 1.55em;
  --h3-size: 1.3em;
  --h4-size: 1.1em;
  --h5-size: 1em;
  --h6-size: 0.95em;
  --h1-color: var(--lk-pencil);
  --h2-color: var(--lk-pencil);
  --h3-color: var(--lk-pen);
  --h4-color: var(--lk-pencil);
  --h5-color: var(--text-muted);
  --h6-color: var(--text-muted);
  --h1-font: var(--font-text);
  --h2-font: var(--font-text);
  --h3-font: var(--font-text);
  --h4-font: var(--font-text);
  --h5-font: var(--font-text);
  --h6-font: var(--font-text);
  --h1-weight: 700;
  --h2-weight: 700;
  --h3-weight: 700;
  --h4-weight: 700;
  --h5-weight: 700;
  --h6-weight: 700;
  --h1-line-height: 1.3;
  --h2-line-height: 1.4;
  --h3-line-height: 1.4;
  --inline-title-size: 2.4em;
  --inline-title-line-height: 1.3;
  --inline-title-color: var(--lk-pencil);
  --inline-title-weight: 700;
  --inline-title-font: var(--font-text);
  --bold-color: var(--lk-pencil);
  --italic-color: var(--text-muted);
  --heading-formatting: var(--text-faint);

  --link-color: var(--lk-pen);
  --link-color-hover: var(--text-accent-hover);
  --link-external-color: var(--lk-pen);
  --link-external-color-hover: var(--text-accent-hover);
  --link-unresolved-color: var(--text-muted);
  --link-unresolved-opacity: 1;
  --link-decoration: underline;
  --link-decoration-hover: underline;
  --link-external-decoration: underline;
  --link-external-decoration-hover: underline;
  --tag-color: var(--lk-pencil);
  --tag-color-hover: var(--lk-pencil);
  --tag-background: var(--lk-postit);
  --tag-background-hover: var(--lk-postit-3);
  --tag-border-color: var(--lk-pencil-25);
  --tag-border-color-hover: var(--lk-marker);
  --tag-border-width: 1px;
  --tag-radius: var(--lk-radius);
  --tag-size: 0.85em;
  --tag-padding-x: 0.55em;
  --tag-padding-y: 0.15em;

  --code-background: var(--lk-paper-2);
  --code-normal: var(--lk-pencil);
  --code-comment: var(--text-faint);
  --code-keyword: var(--text-accent-hover);
  --code-function: var(--lk-pen);
  --code-string: var(--color-green);
  --code-value: var(--color-purple);
  --code-important: var(--text-accent-hover);
  --code-operator: var(--lk-pen);
  --code-property: var(--lk-pen);
  --code-punctuation: var(--text-muted);
  --code-tag: var(--text-accent-hover);
  --code-size: 0.88em;
  --blockquote-border-color: var(--lk-pencil);
  --blockquote-border-thickness: 3px;
  --blockquote-background-color: transparent;
  --blockquote-color: var(--text-muted);
  --blockquote-font-style: italic;
  --hr-color: var(--lk-pencil-25);
  --hr-thickness: 2px;
  --table-border-color: var(--lk-pencil-25);
  --table-border-width: 2px;
  --table-header-background: var(--lk-postit);
  --table-header-background-hover: var(--lk-postit);
  --table-header-color: var(--lk-pencil);
  --table-header-weight: 700;
  --table-row-background-hover: var(--lk-postit);
  --table-selection: var(--lk-postit);
  --table-cell-padding: 0.5em 0.75em;
  --checkbox-color: var(--lk-pen);
  --checkbox-color-hover: color-mix(in srgb, var(--lk-pen) 88%, var(--lk-pencil));
  --checkbox-border-color: var(--lk-pencil-60);
  --checkbox-border-color-hover: var(--lk-pen);
  --checkbox-marker-color: var(--lk-on-solid);
  --toggle-thumb-color: var(--lk-paper-2);
  --slider-thumb-background: var(--text-on-accent-inverted);
  --slider-thumb-background-hover: color-mix(in srgb, var(--text-on-accent-inverted) 88%, #000000);
  --checkbox-radius: 4px 6px 5px 7px / 6px 4px 7px 5px;
  --checklist-done-color: var(--text-faint);
  --list-marker-color: var(--text-accent-hover);
  --list-marker-color-hover: var(--lk-pen);
  --list-marker-color-collapsed: var(--lk-pen);
  --indentation-guide-color: var(--lk-pencil-12);
  --indentation-guide-color-active: var(--lk-pencil-25);

  --nav-item-color: var(--text-muted);
  --nav-item-color-hover: var(--lk-pencil);
  --nav-item-color-active: var(--lk-pen);
  --nav-item-background-hover: var(--lk-postit);
  --nav-item-background-active: var(--lk-postit);
  --nav-item-weight-active: 700;
  --nav-item-radius: 6px 10px 8px 6px;
  --nav-collapse-icon-color: var(--text-faint);
  --nav-collapse-icon-color-collapsed: var(--lk-marker);
  --tab-background-active: var(--lk-paper);
  --tab-container-background: var(--lk-paper-2);
  --tab-text-color: var(--text-muted);
  --tab-text-color-focused: var(--text-muted);
  --tab-text-color-active: var(--lk-pen);
  --tab-text-color-focused-active: var(--lk-pen);
  --tab-text-color-focused-active-current: var(--lk-pen);
  --tab-text-color-focused-highlighted: var(--lk-pen);
  --tab-outline-color: var(--lk-pencil-25);
  --tab-divider-color: var(--lk-pencil-12);
  --tab-radius-active: 8px;
  --titlebar-background: var(--lk-paper-2);
  --titlebar-background-focused: var(--lk-paper-2);
  --titlebar-text-color: var(--text-muted);
  --titlebar-text-color-focused: var(--lk-pencil);
  --ribbon-background: var(--lk-paper-2);
  --ribbon-background-collapsed: var(--lk-paper-2);
  --status-bar-background: var(--lk-paper-2);
  --status-bar-border-color: var(--lk-pencil-25);
  --status-bar-text-color: var(--text-muted);
  --icon-color: var(--text-muted);
  --icon-color-hover: var(--lk-pencil);
  --icon-color-active: var(--lk-pen);
  --icon-color-focused: var(--lk-pen);
  --icon-opacity: 1;
  --icon-opacity-hover: 1;
  --icon-opacity-active: 1;
  --input-radius: 6px 10px 8px 6px;
  --input-border-width: 1px;
  --input-shadow: var(--lk-ui-shadow);
  --input-shadow-hover: var(--lk-ui-shadow);
  --search-clear-button-color: var(--text-muted);
  --search-icon-color: var(--lk-pen);
  --search-result-background: var(--lk-paper-2);
  --search-result-file-matched-bg: var(--lk-postit-3);
  --metadata-label-text-color: var(--text-muted);
  --metadata-input-text-color: var(--lk-pencil);
  --metadata-border-color: var(--lk-pencil-25);
  --metadata-border-radius: 8px;
  --metadata-divider-color: var(--lk-pencil-12);
  --embed-border-start: 2px dashed var(--lk-pencil-25);
  --embed-background: var(--lk-paper-2);
  --embed-padding: 1rem;
  --graph-text: var(--lk-pencil);
  --graph-line: var(--lk-pencil-25);
  --graph-node: var(--lk-pen);
  --graph-node-focused: var(--lk-marker);
  --graph-node-tag: var(--color-green);
  --graph-node-attachment: var(--lk-marker);
  --graph-node-unresolved: var(--text-faint);
  --canvas-background: var(--lk-paper);
  --canvas-dot-pattern: var(--lk-pencil-25);
  --canvas-card-label-color: var(--text-muted);
  --pdf-background: var(--lk-paper);
  --pdf-sidebar-background: var(--lk-paper-2);
}
body.theme-dark {
  --lk-on-solid: #171a22;
  --lk-card-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  --lk-ui-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}
/* Obsidian writes custom accent HSL inline, and selects inverted ink for light
   accents. Semantic error/success foregrounds remain independent of that choice. */
body:is(.theme-light, .theme-dark)[style*="--accent-h"] {
  --text-on-accent: #ffffff;
  --color-accent-2: color-mix(in srgb, var(--color-accent) 88%, #000000);
}
body:is(.theme-light, .theme-dark)[style*="--accent-h"][style*="--text-on-accent"] {
  --color-accent-2: color-mix(in srgb, var(--color-accent) 88%, #ffffff);
}

/* Neutral app chrome; dotted paper is reserved for note surfaces. */
.markdown-reading-view .markdown-preview-view, .markdown-source-view.mod-cm6 {
  background-color: var(--lk-paper);
  background-image: var(--lk-dots);
  background-size: var(--lk-grid-size) var(--lk-grid-size);
}
.markdown-rendered, .markdown-source-view.mod-cm6 .cm-content {
  font-synthesis: weight;
}
.inline-title { overflow-wrap: anywhere; }
.markdown-rendered h2, .markdown-source-view.mod-cm6 .HyperMD-header-2 {
  padding-bottom: 0.25em;
  border-bottom: 2px dashed var(--lk-pencil-25);
}
.markdown-rendered a:not(.tag),
.markdown-source-view.mod-cm6 :is(.cm-hmd-internal-link, .cm-link, .cm-url) {
  text-decoration-style: wavy;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.markdown-rendered a.is-unresolved {
  text-decoration-style: dashed;
}
.markdown-rendered mark, .markdown-source-view.mod-cm6 .cm-highlight {
  color: var(--lk-pencil);
  background: linear-gradient(104deg, transparent 0.6%, var(--lk-postit-3) 1.2%, var(--lk-postit-3) 98%, transparent 98.6%);
  border-radius: 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.markdown-rendered blockquote {
  position: relative;
  border-inline-start-style: dashed;
  padding-inline-start: 2em;
}
.markdown-rendered blockquote::before {
  content: '“';
  position: absolute;
  inset-inline-start: 0.25em;
  top: -0.2em;
  font: 2.5em/1 Georgia, serif;
  color: var(--lk-marker);
  pointer-events: none;
}
/* One subtle native guide in the editor; do not add a second border on the
   editable line itself. Obsidian measures that line for cursor placement. */
.markdown-source-view.mod-cm6 {
  --blockquote-border-thickness: 1px;
  --blockquote-border-color: var(--lk-pencil-25);
}
.markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote::before,
.markdown-source-view.mod-cm6 .cm-blockquote-border::before {
  border-inline-start-style: dashed;
}
.markdown-rendered hr { border-top-style: dashed; }

.markdown-rendered :not(pre) > code {
  background: var(--lk-erased);
  color: var(--lk-pencil);
  border: 1px solid var(--lk-pencil-25);
  border-radius: 6px 12px 8px 10px / 10px 8px 12px 6px;
  padding: 0.08em 0.3em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.markdown-source-view.mod-cm6 .cm-inline-code:not(.cm-formatting) {
  background: var(--lk-erased);
  color: var(--lk-pencil);
  border-color: var(--lk-pencil-25);
  border-radius: 6px 12px 8px 10px / 10px 8px 12px 6px;
}
.markdown-rendered pre {
  border: 2px solid var(--lk-pencil);
  border-radius: var(--lk-radius-code);
  box-shadow: var(--lk-card-shadow);
  padding: 2.2em 1.1em 1.1em;
}
.markdown-rendered pre code { border: 0; padding: 0; background: transparent; }
/* Outline the fence without shifting editor lines or changing their width. */
.markdown-source-view.mod-cm6 .HyperMD-codeblock {
  box-shadow: inset 1px 0 var(--lk-pencil-25), inset -1px 0 var(--lk-pencil-25);
}
.markdown-source-view.mod-cm6 .HyperMD-codeblock-begin {
  box-shadow: inset 1px 0 var(--lk-pencil-25), inset -1px 0 var(--lk-pencil-25), inset 0 1px var(--lk-pencil-25);
  border-radius: 8px 12px 0 0;
}
.markdown-source-view.mod-cm6 .HyperMD-codeblock-end {
  box-shadow: inset 1px 0 var(--lk-pencil-25), inset -1px 0 var(--lk-pencil-25), inset 0 -1px var(--lk-pencil-25);
  border-radius: 0 0 12px 8px;
}
.markdown-rendered img:not(.emoji),
.markdown-source-view.mod-cm6 .image-embed img:not(.emoji) {
  border: 2px solid var(--lk-pencil);
  border-radius: 16px 24px 20px 18px / 18px 20px 24px 16px;
  box-shadow: var(--lk-card-shadow);
}
.markdown-rendered .markdown-embed {
  border: 2px dashed var(--lk-pencil-25);
  border-radius: var(--lk-radius-code);
}

/* Native callouts retain their collapse control, nesting, and type icons. */
.callout {
  --lk-callout-paper: var(--lk-postit);
  --lk-callout-ink: var(--lk-pen);
  --callout-title-color: color-mix(in srgb, var(--lk-callout-ink) 50%, var(--lk-pencil));
  --callout-title-weight: 700;
  --callout-blend-mode: normal;
  position: relative;
  overflow: visible;
  margin: 1.5em 0.25em;
  padding: 1.45em 1.1em 0.9em;
  background: var(--lk-callout-paper);
  color: var(--lk-pencil);
  border: 2px solid var(--lk-pencil);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-card-shadow);
  mix-blend-mode: normal;
}
.callout::before {
  content: '';
  position: absolute;
  top: -0.55em;
  left: 50%;
  width: 5em;
  height: 1.1em;
  background: var(--lk-tape);
  border: 1px solid var(--lk-pencil-12);
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
}
/* Obsidian paint-contains noneditable CodeMirror widgets. Reserve room inside
   the callout widget for the tape, rather than disabling paint containment. */
.markdown-source-view.mod-cm6 .cm-callout {
  padding-block-start: var(--lk-callout-tape-space);
}
.markdown-source-view.mod-cm6 .cm-callout > .edit-block-button,
.markdown-source-view.mod-cm6 .cm-embed-block:has(.callout) > .edit-block-button {
  top: calc(var(--lk-callout-tape-space) + 0.85em);
  inset-inline-end: 1.15em;
}
/* Current Obsidian wraps the buttons in an absolutely positioned toolbar.
   Position that owner, not its static Edit child. Leave the title row clear
   so the native fold control keeps its own space. */
.markdown-source-view.mod-cm6 .cm-callout > .embed-actions {
  top: calc(var(--lk-callout-tape-space) + 0.35em);
  inset-inline-end: 1.15em;
}
.markdown-source-view.mod-cm6 .cm-callout > .markdown-rendered > .callout > .callout-title {
  padding-inline-end: 2.25rem;
}
.callout .callout-title { line-height: 1.5; }
.callout .callout-title-inner { min-width: 0; overflow-wrap: anywhere; }
.callout .callout-fold { margin-inline-start: auto; }
.callout :is(.callout-icon, .callout-fold) > .svg-icon { color: var(--callout-title-color); }
.callout .callout-content { background: transparent; }
.callout .callout-content > :first-child { margin-top: 0.6em; }
.callout .callout-content > :last-child { margin-bottom: 0; }
.callout.is-collapsed { padding-bottom: 0.9em; }
.callout[data-callout='question'], .callout[data-callout='help'], .callout[data-callout='faq'] {
  --lk-callout-paper: var(--lk-paper-2);
  --lk-callout-ink: var(--lk-marker);
  border-style: dashed;
}
.callout[data-callout='tip'], .callout[data-callout='hint'],
.callout[data-callout='success'], .callout[data-callout='check'], .callout[data-callout='done'],
.callout[data-callout='important'] {
  --lk-callout-paper: var(--lk-postit-2);
  --lk-callout-ink: var(--color-green);
}
.callout[data-callout='warning'], .callout[data-callout='caution'], .callout[data-callout='attention'],
.callout[data-callout='danger'], .callout[data-callout='error'], .callout[data-callout='bug'],
.callout[data-callout='failure'], .callout[data-callout='fail'], .callout[data-callout='missing'] {
  --lk-callout-paper: var(--lk-postit-3);
  --lk-callout-ink: var(--lk-marker);
}
.callout[data-callout='quote'], .callout[data-callout='cite'] {
  --lk-callout-paper: var(--lk-paper-2);
  --lk-callout-ink: var(--text-muted);
}

/* Combinations inherit the website's quieter treatment for inner objects. */
.callout .callout {
  margin: 0.85em 0;
  padding: 0.7em 0.85em;
  border: 1px dashed var(--lk-pencil-25);
  border-radius: 8px 12px 9px 7px;
  box-shadow: none;
}
.callout .callout::before { content: none; }
.callout .callout .callout-content > :first-child { margin-top: 0.4em; }
.callout :is(pre, table) { max-width: 100%; }
.callout .callout-content :is(p, li) { overflow-wrap: anywhere; }
.callout .callout-content :not(pre) > code { overflow-wrap: anywhere; }

/* Custom types use the native callout parser; +/- still controls folding. */
.callout[data-callout='margin'] {
  --callout-icon: lucide-pencil;
  --lk-callout-paper: var(--lk-paper-2);
  padding: 0.7em 0.9em;
  border: 1.5px dashed var(--lk-pencil-25);
  font-size: 0.92em;
  box-shadow: none;
}
.callout[data-callout='margin']::before { content: none; }
.callout[data-callout='fold'] {
  --callout-icon: lucide-chevrons-down;
  --lk-callout-paper: var(--lk-paper-2);
  padding: 0.85em 1em;
  border-radius: 8px 16px 10px 12px;
}
.callout[data-callout='fold']::before {
  width: 0; height: 0; left: auto; right: 0; top: 0;
  border: 0; border-left: 14px solid transparent;
  border-bottom: 14px solid var(--lk-pencil-25);
  background: transparent; transform: none;
}
.callout[data-callout='fold'] > .callout-title { padding-bottom: 0.15em; }
.callout[data-callout='fold']:not(.is-collapsed) > .callout-title {
  border-bottom: 1px dashed var(--lk-pencil-25);
  padding-bottom: 0.5em;
}
.callout[data-callout='photos'] {
  --callout-icon: lucide-images;
  --lk-callout-paper: var(--lk-paper-2);
}
.callout[data-callout='photos'] .image-embed img { padding: 0.4em; background: var(--lk-paper-2); }
.callout[data-callout='steps'], .callout[data-callout='timeline'] {
  --callout-icon: lucide-list-ordered;
  --lk-callout-paper: var(--lk-paper-2);
}
.callout[data-callout='timeline'] { --callout-icon: lucide-git-commit-horizontal; }
.callout[data-callout='timeline'] > .callout-content > ol {
  border-inline-start: 2px dashed var(--lk-pencil-25);
  margin-inline-start: 0.6em;
  padding-inline-start: 1.5em;
}
.callout[data-callout='bookmark'] {
  --callout-icon: lucide-bookmark;
  --lk-callout-paper: var(--lk-paper-2);
  padding: 0.8em 1em;
}
.callout[data-callout='bookmark']::before { content: none; }
.callout[data-callout='stamp'] {
  --callout-icon: lucide-stamp;
  --lk-callout-paper: var(--lk-paper-2);
  --lk-callout-ink: var(--lk-marker);
  padding: 0.55em 0.8em;
  border-color: var(--text-accent-hover);
  box-shadow: none;
}
.callout[data-callout='stamp']::before { content: none; }

/* Optional margin placement depends on the NOTE PANE, not the app window.
   Only standalone reading callouts move; nested notes and Live Preview stay
   in flow. No DOM rewriting, footnote relocation, or editor transforms. */
.markdown-preview-view { container-type: inline-size; container-name: lk-reading; }
@container lk-reading (min-width: 1160px) {
  .latentk-margins.is-readable-line-width .el-div > .callout[data-callout='margin'] {
    float: right;
    clear: right;
    width: 12rem;
    margin: 0.2em -14rem 0.8em 1em;
    background: var(--lk-postit);
    border-style: solid;
    box-shadow: var(--lk-card-shadow);
  }
}
.markdown-rendered sup.footnote-ref,
.markdown-rendered sup:has(> a[data-footnote-ref]) {
  position: relative;
  top: -0.5em;
  vertical-align: baseline;
  font-size: 0.72em;
  line-height: 0;
}
.markdown-rendered sup.footnote-ref > .footnote-link,
.markdown-rendered sup > a[data-footnote-ref] {
  color: var(--text-accent-hover);
  text-decoration: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 1em;
  line-height: 1;
  margin-inline-start: 0.15em;
}
.markdown-rendered .footnotes { border-top: 2px dashed var(--lk-pencil-25); font-size: 0.9em; }
.markdown-rendered .footnote-backref { color: var(--lk-pen); }

/* Keep native copy/selection controls. Tape is decoration on that button,
   not a competing replacement. Space above code protects its first line. */
.markdown-rendered pre > button.copy-code-button {
  top: 0.35em;
  right: 0.65em;
  padding: 0.15em 0.65em;
  font-size: 0.75em;
  color: var(--lk-pencil);
  background: var(--lk-tape);
  border: 1px solid var(--lk-pencil-25);
  border-radius: 2px;
}
.markdown-rendered pre > button.copy-code-button:focus-visible { opacity: 1; }
.canvas-node-container {
  border-radius: 12px 18px 14px 10px;
  box-shadow: var(--lk-card-shadow);
}
.canvas-node.is-selected .canvas-node-container { box-shadow: 0 0 0 2px var(--lk-pen); }
.canvas-node .callout { margin: 0.6em 0; padding: 0.7em; box-shadow: none; }
.canvas-node .callout::before { content: none; }
.hover-popover .callout { margin: 0.6em 0; padding: 0.75em; box-shadow: none; }
.hover-popover .callout::before { content: none; }
.hover-popover .markdown-preview-view { container-name: lk-popover; }

/* App controls stay compact and keep readable icons on hover. */
.workspace-tab-header.is-active .workspace-tab-header-inner-title { font-weight: 700; }
.workspace-tab-header.is-active .workspace-tab-header-inner {
  box-shadow: inset 0 -2px 0 var(--lk-marker);
}
.nav-file-title.is-active { border-inline-start: 2px solid var(--lk-marker); }
.clickable-icon:hover, .clickable-icon:focus-visible { color: var(--lk-pencil); }
button:not(.clickable-icon):not(.mod-warning) {
  border: 1px solid var(--lk-pencil-25);
}
button.mod-cta { border-color: var(--lk-pen); color: var(--text-on-accent); }
button.mod-warning {
  --text-color: var(--lk-on-solid);
  color: var(--lk-on-solid);
  border: 1px solid var(--color-red);
}
.is-mobile button.mod-warning { --text-color: var(--text-error); color: var(--text-error); }
.message:is(.mod-error, .mod-success),
.cm-hmd-frontmatter .error-marker,
.bases-toolbar .mod-error,
.changelog-item.mod-success {
  --text-on-accent: var(--lk-on-solid);
}
.message:is(.mod-error, .mod-success) a {
  color: var(--lk-on-solid);
  text-decoration: underline;
}
.recent-vaults-list-item:hover { color: var(--text-normal); }
.file-tree .tree-item-flair { color: var(--text-muted); }
input[type=radio]:checked { --checkbox-marker-color: var(--text-on-accent); }
.checkbox-container.is-enabled { --toggle-thumb-color: var(--text-on-accent); }
.canvas-node-group.is-themed .canvas-group-label:not([contenteditable=true]).mod-foreground-light { color: #ffffff; }
.canvas-node-group.is-themed .canvas-group-label:not([contenteditable=true]).mod-foreground-dark { color: #171a22; }
/* Disabled controls stay readable; border/cursor communicate availability.
   Keep native disabled attributes and event handling untouched. */
body :is(button, button.mod-cta, button.mod-warning):is(:disabled, [aria-disabled="true"]) {
  --text-color: var(--text-muted);
  color: var(--text-muted);
  background-color: var(--interactive-normal);
  opacity: 1;
  border: 1px dashed var(--background-modifier-border-hover);
  box-shadow: none;
  cursor: not-allowed;
}
body :is(textarea, select, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color])):disabled {
  color: var(--text-muted);
  background-color: var(--background-modifier-form-field);
  opacity: 1;
  border-style: dashed;
}
:is(button, a, input, select, textarea, .clickable-icon):focus-visible {
  outline: 2px dashed var(--lk-pen);
  outline-offset: 2px;
}
.menu, .suggestion-container, .popover {
  border: 1px solid var(--lk-pencil-25);
  border-radius: 8px 12px 10px 8px;
  box-shadow: var(--lk-ui-shadow);
}
.modal { border: 2px solid var(--lk-pencil-25); border-radius: 12px; }

/* Notices may carry success/error text from core or plugins. A neutral paper
   surface keeps those semantic colors readable instead of putting green or
   pale text on the theme's blue accent. Pair tooltip foreground explicitly
   as well; its old on-accent foreground would match this new paper surface. */
.notice, .tooltip {
  background-color: var(--lk-paper-2);
  color: var(--lk-pencil);
  border: 1px solid var(--lk-pencil-25);
  box-shadow: var(--lk-ui-shadow);
}
.notice :is(a, .internal-link), .tooltip a { color: var(--lk-pen); }
.notice :is(a, .internal-link):hover, .tooltip a:hover { color: var(--text-accent-hover); }
.tooltip .tooltip-modifier { color: var(--text-muted); }

/* Obsidian's filename validation uses the more specific .tooltip.mod-error,
   whose native on-accent text is unreadable on our dark, tinted error paper.
   Pair both colors explicitly and share that surface with every arrow side. */
.tooltip.mod-error {
  --lk-tooltip-error-paper: color-mix(in srgb, var(--color-red) 14%, var(--lk-paper-2));
  --background-modifier-error: var(--lk-tooltip-error-paper);
  --background-modifier-message: var(--lk-tooltip-error-paper);
  --tooltip-background: var(--lk-tooltip-error-paper);
  --tooltip-color: var(--lk-pencil);
  background-color: var(--lk-tooltip-error-paper);
  color: var(--lk-pencil);
  border-color: color-mix(in srgb, var(--color-red) 45%, var(--lk-paper-2));
}
.tooltip.mod-error.mod-top .tooltip-arrow { border-bottom-color: transparent; }

/* These editor hint variants use the same message surface but native CSS
   hardcodes white text. Keep them readable in light mode as well. */
.cm-tooltip.cm-tooltip-docstring, .cm-tooltip.cm-completionInfo {
  background-color: var(--lk-paper-2);
  color: var(--lk-pencil);
}

@media (max-width: 640px) {
  body.theme-light, body.theme-dark { --file-margins: 20px; --h1-size: 1.8em; --inline-title-size: 2em; }
  .callout { margin-inline: 0; padding-inline: 0.9em; }
}
body.is-mobile { --file-margins: 20px; --input-shadow: none; --input-shadow-hover: none; }
body.is-mobile :is(.callout, .markdown-rendered pre) { box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .callout .callout-fold .svg-icon { transition: none; }
}
/* Export a clean page; printing must never inherit the dark paper. */
@media print {
  body.theme-light, body.theme-dark {
    --lk-paper: #ffffff;
    --lk-paper-2: #ffffff;
    --lk-on-solid: #ffffff;
    --lk-pencil: #1f2433;
    --lk-pencil-12: rgba(31, 36, 51, 0.12);
    --lk-pencil-25: rgba(31, 36, 51, 0.25);
    --lk-pencil-60: rgba(31, 36, 51, 0.6);
    --lk-erased: #e0e3e0;
    --lk-pen: #3b4f9e;
    --color-accent: var(--lk-pen);
    --lk-marker: #c4562f;
    --lk-postit: #e6ebfa;
    --lk-postit-2: #dcefe4;
    --lk-postit-3: #f8e5dc;
    --lk-card-shadow: none;
    --lk-dots: none;
    --color-green: #2f7d4f;
    --color-red: #aa363f;
    --color-orange: #9c5915;
    --color-yellow: #8c6b10;
    --color-cyan: #247789;
    --color-blue: #3b4f9e;
    --color-purple: #74549d;
    --color-pink: #a83b68;
    color-scheme: light;
  }
  .callout::before { display: none; }
  .markdown-preview-view { container-type: normal; }
  .latentk-margins .el-div > .callout[data-callout='margin'] {
    float: none; width: auto; margin: 1em 0;
  }
}
