/* Vault Web: an Obsidian-style look (default theme colors, layout and type scale). */

/* ------------------------------------------------------------------ tokens */
body {
  --font-interface: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: var(--font-interface);
  --font-monospace: ui-monospace, SFMono-Regular, "Cascadia Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --font-text-size: 16px;
  --font-ui-smaller: 12px;
  --font-ui-small: 13px;
  --font-ui-medium: 15px;
  --line-height: 1.5;
  --file-line-width: 700px;
  --radius-s: 4px; --radius-m: 8px; --radius-l: 12px;
  --h1-size: 1.802em; --h2-size: 1.602em; --h3-size: 1.424em; --h4-size: 1.266em; --h5-size: 1.125em; --h6-size: 1em;
  --ribbon-width: 44px;
  --header-height: 40px;
  --accent-h: 258; --accent-s: 88%; --accent-l: 66%;
  --color-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --color-accent-1: hsl(calc(var(--accent-h) - 3), calc(var(--accent-s) * 1.02), calc(var(--accent-l) * 1.15));
  --color-accent-2: hsl(calc(var(--accent-h) - 5), calc(var(--accent-s) * 1.05), calc(var(--accent-l) * 1.29));
  --color-red-rgb: 233, 49, 71; --color-orange-rgb: 236, 117, 0; --color-yellow-rgb: 224, 172, 0;
  --color-green-rgb: 8, 185, 78; --color-cyan-rgb: 0, 191, 188; --color-blue-rgb: 8, 109, 221;
  --color-purple-rgb: 120, 82, 238; --color-pink-rgb: 213, 57, 132; --color-grey-rgb: 158, 158, 158;
}
body.theme-dark {
  color-scheme: dark;
  --accent-h: 254; --accent-s: 80%; --accent-l: 68%;
  --color-base-00: #1e1e1e; --color-base-05: #212121; --color-base-10: #242424; --color-base-20: #262626;
  --color-base-25: #2a2a2a; --color-base-30: #363636; --color-base-35: #3f3f3f; --color-base-40: #555555;
  --color-base-50: #666666; --color-base-60: #999999; --color-base-70: #b3b3b3; --color-base-100: #dadada;
  --background-modifier-hover: rgba(255, 255, 255, 0.067);
  --background-modifier-active-hover: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
  --background-modifier-border: var(--color-base-30);
  --background-modifier-form-field: var(--color-base-25);
  --text-highlight-bg: rgba(255, 208, 0, 0.4);
  --shadow-s: 0 1px 2px rgba(0,0,0,.4), 0 3.4px 6.7px rgba(0,0,0,.25);
  --shadow-l: 0 2px 8px rgba(0,0,0,.4), 0 3.4px 6.7px rgba(0,0,0,.25), 0 25px 40px rgba(0,0,0,.4);
}
body.theme-light {
  color-scheme: light;
  --color-base-00: #ffffff; --color-base-05: #fcfcfc; --color-base-10: #fafafa; --color-base-20: #f6f6f6;
  --color-base-25: #e3e3e3; --color-base-30: #e0e0e0; --color-base-35: #d4d4d4; --color-base-40: #bdbdbd;
  --color-base-50: #ababab; --color-base-60: #707070; --color-base-70: #5c5c5c; --color-base-100: #222222;
  --background-modifier-hover: rgba(0, 0, 0, 0.067);
  --background-modifier-active-hover: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
  --background-modifier-border: var(--color-base-30);
  --background-modifier-form-field: var(--color-base-00);
  --text-highlight-bg: rgba(255, 208, 0, 0.4);
  --shadow-s: 0 1px 2px rgba(0,0,0,.028), 0 3.4px 6.7px rgba(0,0,0,.042), 0 15px 30px rgba(0,0,0,.07);
  --shadow-l: 0 1.8px 7.3px rgba(0,0,0,.071), 0 6.3px 24.7px rgba(0,0,0,.112), 0 30px 90px rgba(0,0,0,.2);
}
body {
  --background-primary: var(--color-base-00);
  --background-primary-alt: var(--color-base-10);
  --background-secondary: var(--color-base-20);
  --background-secondary-alt: var(--color-base-05);
  --text-normal: var(--color-base-100);
  --text-muted: var(--color-base-70);
  --text-faint: var(--color-base-50);
  --text-on-accent: #fff;
  --text-accent: var(--color-accent);
  --text-accent-hover: var(--color-accent-2);
  --interactive-accent: var(--color-accent);
  --interactive-accent-hover: var(--color-accent-1);
  --interactive-normal: var(--color-base-30);
  --interactive-hover: var(--color-base-35);
  --icon-color: var(--text-muted);
  --icon-color-hover: var(--text-normal);
  --icon-color-active: var(--text-accent);
  --nav-item-color: var(--text-muted);
  --nav-item-color-active: var(--text-normal);
  --nav-item-background-active: var(--background-modifier-hover);
  --tab-background-active: var(--background-primary);
  --titlebar-background: var(--background-secondary-alt);
  --ribbon-background: var(--background-secondary);
  --code-background: var(--background-primary-alt);
  --code-normal: var(--text-normal);
  --link-color: var(--text-accent);
  --link-external-color: var(--text-accent);
  --link-unresolved-opacity: 0.7;
  --tag-color: var(--text-accent);
  --tag-background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.1);
  --tag-background-hover: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
  --blockquote-border: var(--interactive-accent);
  --hr-color: var(--background-modifier-border);
  --checkbox-color: var(--interactive-accent);
  --table-border: var(--background-modifier-border);
  --table-header-background: var(--background-primary-alt);
  --graph-node: var(--text-muted);
  --graph-node-unresolved: var(--text-faint);
  --graph-node-focused: var(--text-accent);
  --graph-line: var(--background-modifier-border);
  --graph-text: var(--text-normal);
  --scrollbar-thumb: rgba(128,128,128,.25);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-interface);
  font-size: var(--font-ui-medium);
  color: var(--text-normal);
  background: var(--background-secondary);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font-family: inherit; font-size: var(--font-ui-small); color: var(--text-normal); background: var(--interactive-normal); border: 0; border-radius: var(--radius-s); padding: 4px 12px; height: 30px; cursor: pointer; box-shadow: var(--shadow-s); }
button:hover { background: var(--interactive-hover); }
button.mod-cta { background: var(--interactive-accent); color: var(--text-on-accent); }
button.mod-cta:hover { background: var(--interactive-accent-hover); }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 12px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128,128,128,.4); }
::-webkit-scrollbar-corner { background: transparent; }
::selection { background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25); }
.svg-icon { flex-shrink: 0; display: block; }
.boot-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--background-primary); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--background-modifier-border); border-top-color: var(--interactive-accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--interactive-accent); z-index: 100; transition: width .2s, opacity .4s; }
.load-progress.is-done { width: 100% !important; opacity: 0; }

.clickable-icon { display: flex; align-items: center; justify-content: center; padding: 4px 6px; border-radius: var(--radius-s); color: var(--icon-color); cursor: pointer; background: transparent; box-shadow: none; height: auto; border: 0; }
.clickable-icon:hover { background: var(--background-modifier-hover); color: var(--icon-color-hover); }
.clickable-icon[disabled] { opacity: .35; pointer-events: none; }

/* ------------------------------------------------------------------ layout */
.app-container { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.workspace { flex: 1; display: flex; min-height: 0; position: relative; }
.workspace-ribbon {
  width: var(--ribbon-width); flex-shrink: 0; background: var(--ribbon-background);
  border-right: 1px solid var(--background-modifier-border);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 6px 0 8px;
}
.side-dock-actions, .side-dock-settings { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.workspace-ribbon .clickable-icon { padding: 6px; }
.workspace-ribbon .ribbon-toggle { margin-bottom: 4px; }

.workspace-split { display: flex; flex-direction: column; min-width: 0; background: var(--background-secondary); }
.mod-left-split, .mod-right-split { flex-shrink: 0; transition: width .15s ease; overflow: hidden; }
.mod-left-split.is-collapsed, .mod-right-split.is-collapsed { width: 0 !important; border: 0 !important; }
.mod-left-split { border-right: 1px solid var(--background-modifier-border); }
.mod-right-split { border-left: 1px solid var(--background-modifier-border); }
.workspace-split.mod-root { flex: 1; background: var(--background-primary); }
.workspace-leaf-resize-handle { width: 4px; margin: 0 -2px; cursor: col-resize; z-index: 5; flex-shrink: 0; }
.workspace-leaf-resize-handle:hover { background: var(--interactive-accent); }
body:not(.left-open) .workspace-leaf-resize-handle.mod-left, body:not(.right-open) .workspace-leaf-resize-handle.mod-right { display: none; }

.workspace-tab-header-container {
  height: var(--header-height); flex-shrink: 0; display: flex; align-items: center;
  padding: 0 8px; background: var(--titlebar-background); border-bottom: 1px solid var(--background-modifier-border);
}
.mod-left-split .workspace-tab-header-container, .mod-right-split .workspace-tab-header-container { background: var(--background-secondary); }
.workspace-tab-header-container-inner { display: flex; gap: 2px; }
.workspace-tab-header-container-inner .workspace-tab-header { padding: 5px 7px; border-radius: var(--radius-s); color: var(--icon-color); cursor: pointer; }
.workspace-tab-header-container-inner .workspace-tab-header:hover { background: var(--background-modifier-hover); color: var(--icon-color-hover); }
.workspace-tab-header-container-inner .workspace-tab-header.is-active { background: var(--background-modifier-hover); color: var(--text-normal); }
.workspace-leaf-content { flex: 1; overflow: auto; padding: 4px 0 24px; }

/* main tab strip */
.mod-top { padding: 0 6px 0 4px; gap: 4px; align-items: flex-end; }
.tab-strip { display: flex; align-items: flex-end; overflow-x: auto; overflow-y: hidden; min-width: 0; height: 100%; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.tab-strip .workspace-tab-header {
  position: relative; height: 32px; min-width: 60px; max-width: 220px; flex: 0 1 200px;
  display: flex; align-items: center; padding: 0 8px; margin-right: 1px; border-radius: var(--radius-m) var(--radius-m) 0 0;
  color: var(--text-muted); cursor: pointer; font-size: var(--font-ui-small);
}
.tab-strip .workspace-tab-header:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tab-strip .workspace-tab-header.is-active { background: var(--tab-background-active); color: var(--text-normal); box-shadow: 0 0 0 1px var(--background-modifier-border); clip-path: inset(-1px -1px 0 -1px); }
.tab-strip .workspace-tab-header:not(.is-active) + .workspace-tab-header:not(.is-active)::before { content: ''; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 1px; background: var(--background-modifier-border); }
.workspace-tab-header-inner { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.workspace-tab-header-inner-icon { display: flex; color: var(--icon-color); }
.workspace-tab-header-inner-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-tab-header-inner-close-button { display: flex; padding: 2px; border-radius: var(--radius-s); color: var(--icon-color); opacity: 0; }
.workspace-tab-header:hover .workspace-tab-header-inner-close-button, .workspace-tab-header.is-active .workspace-tab-header-inner-close-button { opacity: 1; }
.workspace-tab-header-inner-close-button:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tab-dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.workspace-tab-header-new-tab { align-self: center; }
.workspace-tab-header-spacer { flex: 1; }
.sidebar-toggle-button { align-self: center; }

.workspace-tab-container { flex: 1; min-height: 0; position: relative; }
.workspace-leaf { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--background-primary); }
.workspace-leaf.is-active { display: flex; }

/* view header */
.view-header { height: var(--header-height); flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--background-primary); }
.view-header-nav-buttons { display: flex; gap: 2px; }
.view-header-nav-buttons button { padding: 4px 6px; }
.view-header-title-container { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 2px; overflow: hidden; white-space: nowrap; font-size: var(--font-ui-small); color: var(--text-muted); }
.view-header-breadcrumb { cursor: pointer; padding: 2px 4px; border-radius: var(--radius-s); overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.view-header-breadcrumb:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.view-header-breadcrumb-separator { color: var(--text-faint); padding: 0 1px; }
.view-header-title { color: var(--text-normal); padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 60%; }
.view-actions { display: flex; align-items: center; gap: 2px; }
.conflict-slot:empty { display: none; }
.conflict-banner { display: flex; align-items: center; gap: 6px; font-size: var(--font-ui-smaller); color: rgb(var(--color-orange-rgb)); padding-right: 6px; }
.conflict-banner button { height: 24px; padding: 2px 8px; font-size: var(--font-ui-smaller); }

.view-content { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.view-content.is-graph { overflow: hidden; }

/* ------------------------------------------------------------------ reading view */
.markdown-reading-view { flex: 1; overflow-y: auto; user-select: text; }
.markdown-preview-view { padding: 8px 32px 30vh; font-family: var(--font-text); font-size: var(--font-text-size); line-height: var(--line-height); word-wrap: break-word; }
.is-readable-line-width.markdown-preview-view, .is-readable-line-width .cm-sizer { max-width: var(--file-line-width); margin: 0 auto; }
.inline-title { font-size: var(--h1-size); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; margin: 16px 0 24px; color: var(--text-normal); user-select: text; }
.markdown-rendered { user-select: text; }
.markdown-rendered > :first-child { margin-top: 0; }
.markdown-rendered p { margin: 0 0 1em; }
.markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3, .markdown-rendered h4, .markdown-rendered h5, .markdown-rendered h6 { font-weight: 700; line-height: 1.25; margin: 1.2em 0 .5em; letter-spacing: -0.015em; }
.markdown-rendered h1 { font-size: var(--h1-size); }
.markdown-rendered h2 { font-size: var(--h2-size); font-weight: 650; }
.markdown-rendered h3 { font-size: var(--h3-size); font-weight: 650; }
.markdown-rendered h4 { font-size: var(--h4-size); font-weight: 600; }
.markdown-rendered h5 { font-size: var(--h5-size); font-weight: 600; }
.markdown-rendered h6 { font-size: var(--h6-size); font-weight: 600; color: var(--text-muted); }
.markdown-rendered a { color: var(--link-color); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.markdown-rendered a:hover { color: var(--text-accent-hover); }
.markdown-rendered a.internal-link { text-decoration-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), .4); }
.markdown-rendered a.is-unresolved { opacity: var(--link-unresolved-opacity); text-decoration-style: dashed; }
.markdown-rendered a.external-link { padding-right: 15px; background: no-repeat right 2px center / 11px; background-image: linear-gradient(transparent, transparent), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E"); }
.markdown-rendered strong { font-weight: 700; }
.markdown-rendered mark { background: var(--text-highlight-bg); color: var(--text-normal); border-radius: 2px; padding: 0 1px; }
.markdown-rendered del { color: var(--text-muted); }
.markdown-rendered hr { border: 0; border-top: 2px solid var(--hr-color); margin: 2em 0; }
.markdown-rendered img { max-width: 100%; border-radius: var(--radius-s); }
.markdown-rendered ul, .markdown-rendered ol { padding-inline-start: 1.6em; margin: 0 0 1em; }
.markdown-rendered li { margin: .15em 0; }
.markdown-rendered li > p { margin: 0; }
.markdown-rendered ul > li::marker { color: var(--text-faint); }
.markdown-rendered ol > li::marker { color: var(--text-muted); }
.markdown-rendered ul ul, .markdown-rendered ol ol, .markdown-rendered ul ol, .markdown-rendered ol ul { margin: 0; }
.markdown-rendered ul ul, .markdown-rendered ul ol, .markdown-rendered ol ul, .markdown-rendered ol ol { border-left: 1px solid var(--background-modifier-border); margin-left: -1.1em; padding-left: 2.2em; }
.markdown-rendered .contains-task-list { padding-inline-start: 1.6em; }
.markdown-rendered .task-list-item { list-style: none; position: relative; }
.markdown-rendered .task-list-item.is-checked { color: var(--text-muted); text-decoration: line-through; }
.task-list-item-checkbox {
  appearance: none; -webkit-appearance: none; width: 15px; height: 15px; margin: 0 6px 0 -1.4em; position: relative; top: 2px;
  border: 1px solid var(--text-faint); border-radius: 4px; cursor: pointer; background: transparent; flex-shrink: 0;
}
.task-list-item-checkbox:hover { border-color: var(--text-muted); }
.task-list-item-checkbox:checked { background: var(--checkbox-color) no-repeat center / 11px; border-color: var(--checkbox-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.markdown-rendered blockquote { margin: 0 0 1em; padding: 0 0 0 1.25em; border-left: 2px solid var(--blockquote-border); color: var(--text-normal); }
.markdown-rendered code { font-family: var(--font-monospace); font-size: .875em; background: var(--code-background); color: var(--code-normal); padding: .1em .25em; border-radius: var(--radius-s); }
.markdown-rendered pre { position: relative; background: var(--code-background); border-radius: var(--radius-s); padding: 12px 16px; margin: 0 0 1em; overflow-x: auto; line-height: 1.55; border: 1px solid var(--background-modifier-border); }
.markdown-rendered pre code { padding: 0; background: none; font-size: .85em; white-space: pre; }
.copy-code-button { position: absolute; top: 6px; right: 6px; height: auto; padding: 3px 8px; font-size: var(--font-ui-smaller); opacity: 0; box-shadow: none; background: var(--interactive-normal); color: var(--text-muted); }
pre:hover .copy-code-button { opacity: 1; }
.table-wrapper { overflow-x: auto; margin: 0 0 1em; }
.markdown-rendered table { border-collapse: collapse; font-size: .94em; }
.markdown-rendered th, .markdown-rendered td { border: 1px solid var(--table-border); padding: 4px 10px; text-align: left; vertical-align: top; }
.markdown-rendered th { font-weight: 600; background: var(--table-header-background); }
.markdown-rendered .footnotes { font-size: .9em; color: var(--text-muted); border-top: 1px solid var(--background-modifier-border); margin-top: 2em; padding-top: 1em; }
.markdown-rendered .footnotes-sep { display: none; }
a.tag, .cm-tag {
  background: var(--tag-background); color: var(--tag-color) !important; border-radius: 2em; padding: 1px 8px; font-size: .875em;
  text-decoration: none !important; white-space: nowrap; cursor: pointer;
}
a.tag:hover { background: var(--tag-background-hover); }
.is-flashing { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: var(--text-highlight-bg); } 100% { background: transparent; } }

/* properties */
.metadata-container { margin: 0 0 24px; font-size: var(--font-ui-small); }
.metadata-properties-heading { font-weight: 600; color: var(--text-normal); margin-bottom: 6px; cursor: pointer; font-size: var(--font-ui-medium); }
.metadata-container.is-collapsed .metadata-properties { display: none; }
.metadata-property { display: flex; align-items: flex-start; gap: 4px; padding: 3px 0; border-bottom: 1px solid transparent; }
.metadata-property:hover { background: var(--background-modifier-hover); border-radius: var(--radius-s); }
.metadata-property-key { width: 160px; flex-shrink: 0; color: var(--text-muted); padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-property-value { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px; color: var(--text-normal); word-break: break-word; }
.prop-pill { background: var(--background-modifier-hover); border-radius: var(--radius-s); padding: 0 6px; }
.metadata-property-value a.tag { font-size: .95em; }

/* callouts */
.callout {
  --callout-color: var(--color-blue-rgb);
  background: rgba(var(--callout-color), 0.1); border-radius: var(--radius-s); padding: 12px 12px 12px 24px; margin: 0 0 1em;
  border-left: 0; overflow: hidden;
}
.callout[data-callout="abstract"] { --callout-color: var(--color-cyan-rgb); }
.callout[data-callout="tip"] { --callout-color: var(--color-cyan-rgb); }
.callout[data-callout="success"] { --callout-color: var(--color-green-rgb); }
.callout[data-callout="question"], .callout[data-callout="warning"] { --callout-color: var(--color-orange-rgb); }
.callout[data-callout="failure"], .callout[data-callout="danger"], .callout[data-callout="bug"] { --callout-color: var(--color-red-rgb); }
.callout[data-callout="example"] { --callout-color: var(--color-purple-rgb); }
.callout[data-callout="quote"] { --callout-color: var(--color-grey-rgb); }
.callout-title { display: flex; align-items: flex-start; gap: 6px; color: rgb(var(--callout-color)); font-weight: 600; margin-left: -12px; }
.callout.is-collapsible .callout-title { cursor: pointer; }
.callout-icon { display: flex; margin-top: 3px; }
.callout-title-inner { flex: 1; }
.callout-fold { display: flex; margin-top: 3px; transition: transform .1s; transform: rotate(90deg); }
.callout.is-collapsed .callout-fold { transform: rotate(0deg); }
.callout.is-collapsed .callout-content { display: none; }
.callout-content { margin-top: 6px; margin-left: -12px; }
.callout-content > :last-child { margin-bottom: 0; }

/* embeds */
.internal-embed.markdown-embed { position: relative; border-left: 2px solid var(--interactive-accent); padding: 4px 0 4px 20px; margin: 0 0 1em; }
.markdown-embed-title { font-weight: 700; font-size: 1.1em; margin-bottom: 6px; color: var(--text-muted); }
.markdown-embed-link { position: absolute; top: 4px; right: 4px; color: var(--text-faint) !important; opacity: 0; }
.markdown-embed:hover .markdown-embed-link { opacity: 1; }
.markdown-embed-content { max-height: 600px; overflow-y: auto; }
.pdf-embed iframe { width: 100%; height: 600px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); }
.embed-loading { color: var(--text-faint); font-style: italic; }
.internal-embed.is-unresolved { opacity: .7; }

/* ------------------------------------------------------------------ editor (live preview) */
.view-content.is-editing { overflow: hidden; }
.markdown-source-view { flex: 1; overflow-y: auto; padding: 8px 32px 0; user-select: text; }
.markdown-source-view .cm-sizer { padding-bottom: 30vh; }
.cm-editor { font-family: var(--font-text); font-size: var(--font-text-size); line-height: var(--line-height); color: var(--text-normal); background: transparent; }
.cm-editor.cm-focused { outline: none; }
.cm-scroller { overflow: visible !important; font-family: inherit !important; line-height: inherit !important; }
.cm-content { padding: 0 !important; caret-color: var(--text-normal); }
.cm-line { padding: 0 !important; }
.cm-cursor { border-left: 2px solid var(--interactive-accent) !important; }
.cm-selectionBackground, .cm-focused .cm-selectionBackground, .cm-editor ::selection { background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25) !important; }
.cm-activeLine { background: transparent !important; }
.cm-placeholder { color: var(--text-faint); }
.cm-header-line { font-weight: 700; line-height: 1.25; padding-top: .55em !important; padding-bottom: .2em !important; letter-spacing: -0.015em; }
.cm-h1-line { font-size: var(--h1-size); } .cm-h2-line { font-size: var(--h2-size); } .cm-h3-line { font-size: var(--h3-size); }
.cm-h4-line { font-size: var(--h4-size); } .cm-h5-line { font-size: var(--h5-size); } .cm-h6-line { font-size: var(--h6-size); color: var(--text-muted); }
.cm-hd { font-weight: inherit; }
.cm-formatting { color: var(--text-faint); }
.cm-header-line .cm-formatting { color: var(--text-faint); font-weight: 400; }
.cm-em { font-style: italic; } .cm-strong { font-weight: 700; } .cm-strike { text-decoration: line-through; color: var(--text-muted); }
.cm-inline-code { font-family: var(--font-monospace); font-size: .875em; background: var(--code-background); border-radius: var(--radius-s); padding: .1em .2em; }
.cm-url { color: var(--text-faint); }
.cm-link, .cm-link-text, .cm-wikilink { color: var(--link-color); text-decoration: underline; text-decoration-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), .4); text-underline-offset: 2px; cursor: pointer; }
.cm-wikilink.is-unresolved { opacity: var(--link-unresolved-opacity); text-decoration-style: dashed; }
.cm-highlight { background: var(--text-highlight-bg); }
.cm-blockquote-line { border-left: 2px solid var(--blockquote-border); padding-left: 1.25em !important; }
.cm-quote { color: var(--text-normal); }
.cm-codeblock-line { font-family: var(--font-monospace); font-size: .85em; background: var(--code-background); padding: 0 16px !important; }
.cm-codeblock-begin { border-radius: var(--radius-s) var(--radius-s) 0 0; padding-top: 6px !important; }
.cm-codeblock-end { border-radius: 0 0 var(--radius-s) var(--radius-s); padding-bottom: 6px !important; }
.cm-codeblock-fence { color: var(--text-faint); }
.cm-codeblock-fence.is-dim { font-size: .75em; }
.cm-bullet { color: var(--text-faint); display: inline-block; width: 1.1em; font-size: 1.1em; }
.cm-task { margin: 0 6px 0 0 !important; top: 2px; }
.cm-task-done { color: var(--text-muted); text-decoration: line-through; }
.cm-hr-widget { display: inline-block; width: 100%; border-top: 2px solid var(--hr-color); vertical-align: middle; }
.cm-image-embed { max-width: 100%; display: block; border-radius: var(--radius-s); margin: 4px 0; }
.cm-embed-block { cursor: text; padding: 2px 0 6px; white-space: normal; }
.cm-embed-block:hover { box-shadow: 0 0 0 1px var(--background-modifier-border); border-radius: var(--radius-s); }
.cm-embed-block .markdown-rendered > :last-child, .cm-embed-block .callout { margin-bottom: 0; }
.cm-block-props .metadata-container { margin-bottom: 6px; }
.cm-searchMatch { background: rgba(255, 208, 0, .3); }
.cm-panels { background: var(--background-secondary) !important; color: var(--text-normal) !important; border-color: var(--background-modifier-border) !important; }
.cm-panel input, .cm-panel button { font-size: var(--font-ui-small); }

/* ------------------------------------------------------------------ side panels */
.nav-header { display: flex; justify-content: center; padding: 4px 8px 6px; }
.nav-buttons-container { display: flex; gap: 2px; }
.nav-files-container { padding: 0 8px; font-size: var(--font-ui-small); }
.tree-item-self {
  display: flex; align-items: center; gap: 4px; min-height: 26px; padding: 3px 8px; border-radius: var(--radius-s);
  color: var(--nav-item-color); line-height: 1.3; position: relative;
}
.tree-item-self.is-clickable { cursor: pointer; }
.tree-item-self.is-clickable:hover { background: var(--background-modifier-hover); color: var(--nav-item-color-active); }
.tree-item-self.is-active { background: var(--nav-item-background-active); color: var(--nav-item-color-active); }
.tree-item-inner { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-folder.mod-root > .nav-folder-title { font-weight: 600; color: var(--text-normal); padding-left: 8px; }
.nav-folder.mod-root > .nav-folder-children { padding-left: 0; }
.nav-folder-title { color: var(--nav-item-color); }
.nav-folder.is-collapsed > .nav-folder-children { display: none; }
.collapse-icon { display: flex; color: var(--text-faint); width: 14px; margin-left: -2px; transition: transform .1s; transform: rotate(90deg); }
.collapse-icon.is-collapsed { transform: rotate(0deg); }
.nav-folder-children { position: relative; }
.nav-file-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; background: var(--background-modifier-hover); color: var(--text-muted); padding: 0 4px; border-radius: 3px; line-height: 16px; }
.tree-item-flair { font-size: var(--font-ui-smaller); color: var(--text-faint); background: var(--background-modifier-hover); border-radius: var(--radius-s); padding: 0 5px; }
.pane-empty, .search-empty-state { color: var(--text-faint); font-size: var(--font-ui-small); padding: 12px 16px; }

.search-row { padding: 6px 10px; }
.search-input-container input, .graph-filter, .prompt-input.text-input {
  width: 100%; height: 30px; padding: 4px 10px; font-size: var(--font-ui-small); color: var(--text-normal);
  background: var(--background-modifier-form-field); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); outline: none;
}
.search-input-container input:focus, .graph-filter:focus, .prompt-input.text-input:focus { border-color: var(--interactive-accent); box-shadow: 0 0 0 2px hsla(var(--accent-h), var(--accent-s), var(--accent-l), .25); }
.search-info { font-size: var(--font-ui-smaller); color: var(--text-faint); padding: 2px 14px 6px; }
.search-results-children, .backlink-pane, .outline, .tag-container, .outgoing-link-section { padding: 0 8px; font-size: var(--font-ui-small); }
.search-result-file-title { color: var(--text-normal); font-weight: 500; }
.search-result-file-matches { margin: 2px 0 8px 6px; border-left: 1px solid var(--background-modifier-border); }
.search-result-file-match { padding: 4px 8px 4px 12px; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-s); white-space: normal; word-break: break-word; font-size: var(--font-ui-smaller); line-height: 1.45; }
.search-result-file-match:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.search-result-file-matched-text { background: var(--text-highlight-bg); color: var(--text-normal); border-radius: 2px; }
.backlink-section-title { font-weight: 600; color: var(--text-normal); }
.backlink-pane-section.is-collapsed .search-result-container { display: none; }
.backlink-pane-section.is-collapsed .collapse-icon { transform: rotate(0); }
.backlink-pane-section { margin-bottom: 8px; }
.outgoing-link-section { margin-bottom: 12px; }
.outgoing-link-item.is-unresolved { opacity: .7; }
.outgoing-link-item .tree-item-icon { display: flex; color: var(--text-faint); }
.tag-pane-tag-text { color: var(--text-muted); }
.panel-localgraph { padding: 0; overflow: hidden; }

/* ------------------------------------------------------------------ status bar */
.status-bar {
  position: fixed; right: 0; bottom: 0; z-index: 20; display: flex; gap: 2px; align-items: center;
  font-size: var(--font-ui-smaller); color: var(--text-muted); background: var(--background-secondary);
  border-top-left-radius: var(--radius-m); border: 1px solid var(--background-modifier-border); border-right: 0; border-bottom: 0; padding: 2px 6px;
}
.status-bar-item { padding: 1px 6px; border-radius: var(--radius-s); display: flex; align-items: center; white-space: nowrap; }
.status-bar-item.mod-clickable { cursor: pointer; }
.status-bar-item.mod-clickable:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.sync-status { display: inline-flex; align-items: center; gap: 4px; }
.sync-status.is-ok .svg-icon { color: rgb(var(--color-green-rgb)); }
.sync-status.is-saving .svg-icon { animation: spin 1s linear infinite; }
.sync-status.is-error, .sync-status.is-warning { color: rgb(var(--color-orange-rgb)); }

/* ------------------------------------------------------------------ empty state, files */
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; }
.empty-state-container { text-align: center; }
.empty-state-title { font-size: 1.25em; font-weight: 600; color: var(--text-muted); margin-bottom: 18px; }
.empty-state-action-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state-action { color: var(--text-accent); cursor: pointer; font-size: var(--font-ui-medium); text-decoration: none; display: block; }
.empty-state-action:hover { color: var(--text-accent-hover); }
.loading-note { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px; color: var(--text-faint); }
.image-container { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; }
.image-container img { max-width: 100%; max-height: 100%; }
.pdf-view { flex: 1; border: 0; width: 100%; background: var(--background-primary); }
.media-container { flex: 1; display: flex; align-items: center; justify-content: center; }
.media-container video { max-width: 100%; max-height: 100%; }

/* ------------------------------------------------------------------ graph */
.graph-view { position: relative; flex: 1; width: 100%; height: 100%; min-height: 200px; overflow: hidden; background: var(--background-primary); }
.graph-view canvas { display: block; touch-action: none; }
.graph-controls { position: absolute; top: 10px; right: 10px; width: 220px; padding: 8px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: var(--shadow-s); }
.panel-localgraph .graph-controls { display: none; }
.panel-localgraph .graph-view { height: 100%; }

/* ------------------------------------------------------------------ modals, menus, popovers, notices */
.modal-container { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.modal-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.modal { position: relative; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-l); box-shadow: var(--shadow-l); width: 560px; max-width: calc(100vw - 24px); }
.modal.prompt { width: 700px; overflow: hidden; }
.modal.mod-prompt, .modal.mod-confirm { padding: 20px; width: 460px; }
.modal-title { font-size: 1.15em; font-weight: 600; margin-bottom: 12px; }
.modal-content { margin-bottom: 16px; line-height: 1.45; }
.modal-content .prompt-input { margin-top: 8px; }
.setting-item-description { color: var(--text-muted); font-size: var(--font-ui-small); }
.modal-button-container { display: flex; justify-content: flex-end; gap: 8px; }
.modal-close-button { position: absolute; top: 12px; right: 12px; color: var(--icon-color); cursor: pointer; padding: 4px; border-radius: var(--radius-s); }
.modal-close-button:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.prompt-input-container { border-bottom: 1px solid var(--background-modifier-border); }
.prompt-input { width: 100%; border: 0; outline: none; background: transparent; color: var(--text-normal); font-size: var(--font-ui-medium); padding: 14px 16px; }
.prompt-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.suggestion-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); cursor: pointer; font-size: var(--font-ui-medium); }
.suggestion-item.is-selected { background: var(--background-modifier-hover); }
.suggestion-content { flex: 1; min-width: 0; }
.suggestion-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-note { font-size: var(--font-ui-smaller); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.suggestion-highlight { color: var(--text-accent); font-weight: 600; }
.suggestion-hotkey { font-family: inherit; font-size: var(--font-ui-smaller); color: var(--text-muted); background: var(--background-modifier-hover); border-radius: var(--radius-s); padding: 2px 6px; }
.suggestion-empty { padding: 10px; color: var(--text-faint); font-size: var(--font-ui-small); }
.prompt-instructions { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--background-modifier-border); font-size: var(--font-ui-smaller); color: var(--text-muted); }
.prompt-instruction-command { font-weight: 600; margin-right: 4px; }

.modal.mod-history { width: 1000px; height: 76vh; padding: 18px 18px 14px; display: flex; flex-direction: column; }
.history-file { color: var(--text-muted); font-weight: 500; }
.history-body { flex: 1; min-height: 0; display: flex; gap: 12px; }
.history-list { width: 270px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--background-modifier-border); padding-right: 8px; }
.history-item { padding: 7px 10px; border-radius: var(--radius-s); cursor: pointer; margin-bottom: 2px; }
.history-item:hover { background: var(--background-modifier-hover); }
.history-item.is-selected { background: var(--background-modifier-active-hover); }
.history-item-date { font-size: var(--font-ui-small); font-weight: 600; }
.history-item-msg { font-size: var(--font-ui-smaller); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-sha { font-family: var(--font-monospace); font-size: 11px; color: var(--text-faint); }
.history-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--background-modifier-border); }
.history-meta { font-size: var(--font-ui-small); color: var(--text-muted); }
.history-actions { display: flex; gap: 6px; }
.history-preview { flex: 1; overflow-y: auto; padding-top: 10px; user-select: text; }
.history-preview .markdown-preview-view { padding: 0 12px 40px; }
.diff-view { font-family: var(--font-monospace); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.diff-line { padding: 0 8px; }
.diff-add { background: rgba(var(--color-green-rgb), .15); color: var(--text-normal); }
.diff-del { background: rgba(var(--color-red-rgb), .15); color: var(--text-normal); }
.diff-gap { color: var(--text-faint); padding: 2px 8px; }
.diff-legend { font-size: var(--font-ui-smaller); margin-bottom: 8px; display: flex; gap: 8px; }
.diff-legend span { padding: 1px 6px; border-radius: var(--radius-s); }

.menu { position: fixed; z-index: 60; min-width: 200px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: var(--shadow-l); padding: 6px; font-size: var(--font-ui-small); }
.menu-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius-s); cursor: pointer; }
.menu-item:hover { background: var(--background-modifier-hover); }
.menu-item-icon { display: flex; color: var(--icon-color); }

.popover.hover-popover { position: fixed; z-index: 40; max-height: 380px; overflow-y: auto; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: var(--shadow-l); }
.hover-popover .markdown-preview-view { padding: 4px 22px 16px; font-size: .94em; }
.hover-popover .inline-title { font-size: 1.5em; margin: 12px 0 12px; }

.notice-container { position: fixed; top: 54px; right: 14px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.notice { background: var(--background-secondary-alt); border: 1px solid var(--background-modifier-border); color: var(--text-normal); border-radius: var(--radius-m); box-shadow: var(--shadow-s); padding: 10px 16px; font-size: var(--font-ui-small); max-width: 340px; animation: notice-in .15s ease; transition: opacity .3s; }
.notice.is-leaving { opacity: 0; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------------------ code highlighting (Obsidian-like palette) */
.hljs-comment, .hljs-quote { color: var(--text-faint); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type { color: #c678dd; }
.theme-light .hljs-keyword, .theme-light .hljs-selector-tag, .theme-light .hljs-built_in, .theme-light .hljs-type { color: #a626a4; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-addition { color: #98c379; }
.theme-light .hljs-string, .theme-light .hljs-attr, .theme-light .hljs-symbol, .theme-light .hljs-addition { color: #50a14f; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable { color: #d19a66; }
.theme-light .hljs-number, .theme-light .hljs-literal { color: #986801; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: #61afef; }
.theme-light .hljs-title, .theme-light .hljs-section, .theme-light .hljs-name { color: #4078f2; }
.hljs-deletion, .hljs-meta { color: #e06c75; }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: bold; }

/* ------------------------------------------------------------------ small screens */
.sidebar-scrim { display: none; }
@media (max-width: 767px) {
  :root { --ribbon-width: 0px; }
  .workspace-ribbon { position: fixed; left: 0; bottom: 0; top: auto; width: 100%; height: 48px; flex-direction: row; z-index: 30; border-right: 0; border-top: 1px solid var(--background-modifier-border); padding: 0 8px; }
  .side-dock-actions, .side-dock-settings { flex-direction: row; }
  .workspace { padding-bottom: 48px; }
  .mod-left-split, .mod-right-split { position: fixed; top: 0; bottom: 48px; z-index: 25; width: 85vw !important; max-width: 340px; box-shadow: var(--shadow-l); }
  .mod-left-split { left: 0; } .mod-right-split { right: 0; }
  .mod-left-split.is-collapsed, .mod-right-split.is-collapsed { width: 0 !important; box-shadow: none; }
  body.left-open .sidebar-scrim, body.right-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 24; background: rgba(0,0,0,.4); }
  .workspace-leaf-resize-handle { display: none; }
  .markdown-preview-view, .markdown-source-view { padding-left: 18px; padding-right: 18px; }
  .status-bar { bottom: 48px; }
  .modal.mod-history { height: 90vh; }
  .history-body { flex-direction: column; }
  .history-list { width: auto; height: 30%; border-right: 0; border-bottom: 1px solid var(--background-modifier-border); }
  .graph-controls { width: 160px; }
}
