/* ============================================================
   YZ.Notes — design tokens (dark default, light via [data-theme])
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #101418;
  --surface: #171c22;
  --surface-2: #1e252d;
  --border: #2a323c;
  --text: #e6ebf0;
  --text-2: #aab4bf;
  --text-3: #7a8590;
  --accent: #6c5ce7;
  --accent-hover: #7d6ff0;
  --accent-soft: rgba(108, 92, 231, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --success: #22c55e;
  --warning: #f59e0b;
  --fs-xs: 0.75rem;
  --fs-sm: 0.85rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.8rem;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.45);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --header-height: 52px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #d8dde3;
  --text: #1d232a;
  --text-2: #4c5661;
  --text-3: #7a8590;
  --shadow-pop: 0 8px 30px rgba(20, 30, 40, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-md);
}

a { color: var(--accent); }

/* ============================================================
   Buttons / forms
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: var(--fs-sm);
  font-family: inherit;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger, .context-menu-item.danger { color: var(--danger); }

.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: var(--fs-sm); color: var(--text-2); }
.form-hint { font-size: var(--fs-xs); color: var(--text-3); margin: -8px 0 12px; }
.form-input, select.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 9px 11px;
  font-size: var(--fs-md);
  font-family: inherit;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); }

/* Color swatches */
.color-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch, .color-swatch-current {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.selected, .color-swatch-current.selected { border-color: var(--text); }

/* ============================================================
   App shell / sidebar
   ============================================================ */
#app { display: flex; min-height: 100vh; }

#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.2s ease, width 0.2s ease;
  z-index: 30;
}

#main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left 0.2s ease;
  display: flex;
  flex-direction: column;
}

#app-header {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--header-height);
  padding: 0 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.menu-btn { display: none; }
.collapse-btn-rail { display: none; color: var(--text-3); }

.sidebar-inner { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; min-height: 100%; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-lg); padding: 2px 4px 6px; }
.sidebar-brand-icon { font-size: 1.3rem; }

.sidebar-search { position: relative; }
.sidebar-search-results { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sidebar-search-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.sidebar-search-result:hover { background: var(--surface-2); }
.search-result-snippet { flex-basis: 100%; color: var(--text-3); font-size: var(--fs-xs); }
.search-result-snippet mark { background: var(--accent-soft); color: var(--text); }
.sidebar-search-empty { color: var(--text-3); font-size: var(--fs-sm); padding: 4px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--fs-md);
}
.sidebar-nav-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav-link.active { background: var(--accent-soft); color: var(--text); }

.sidebar-filter-row { display: flex; gap: 4px; align-items: center; }
.sidebar-icon-btn { padding: 6px 10px; font-size: var(--fs-lg); line-height: 1; }

/* Document tree */
.sidebar-tree { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.doc-item:hover { background: var(--surface-2); }
.doc-tree-item.active { background: var(--accent-soft); }
.doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.category-item { font-weight: 600; margin-top: 6px; }
.sub-documents { padding-left: 14px; border-left: 1px solid var(--border); margin-left: 10px; }
.collapse-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 9px;
  padding: 2px 4px;
  line-height: 1;
}
.collapse-spacer { width: 17px; flex: none; }
.entity-icon { flex: none; }
.entity-dot, .doc-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.drop-target-active { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sidebar-empty { color: var(--text-3); font-size: var(--fs-sm); padding: 8px 4px; }
.sidebar-new-doc { justify-content: center; margin-top: auto; }

/* Desktop rail collapse */
@media (min-width: 769px) {
  .collapse-btn-rail { display: inline-flex; }
  body.sidebar-collapsed #sidebar { width: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed #main { margin-left: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed .sidebar-collapse-hide,
  body.sidebar-collapsed .category-select,
  body.sidebar-collapsed .sidebar-search,
  body.sidebar-collapsed .sidebar-new-doc { display: none !important; }
  body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; }
}

/* Mobile drawer */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); width: min(85vw, var(--sidebar-width)); box-shadow: none; }
  body.sidebar-open #sidebar { transform: translateX(0); box-shadow: var(--shadow-pop); }
  #main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
}

/* ============================================================
   Context menu
   ============================================================ */
.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.context-menu-item {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: inherit;
}
.context-menu-item:hover { background: var(--surface-2); }
.context-menu-item.danger:hover { background: var(--danger-soft); }
.context-menu-separator { height: 1px; background: var(--border); margin: 5px 4px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { margin: 0; font-size: var(--fs-lg); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.close-btn { font-size: var(--fs-lg); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  z-index: 300;
  font-size: var(--fs-sm);
  transition: opacity 0.3s;
}
.toast-error { border-color: var(--danger); }
.toast-hide { opacity: 0; }

/* ============================================================
   Home / archive views
   ============================================================ */
#view-content { padding: 8px 24px 40px; flex: 1; min-width: 0; }

.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.view-header h1 { font-size: var(--fs-2xl); margin: 0; }

.empty-state { text-align: center; padding: 70px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state-icon { font-size: 3rem; }
.empty-state-text { color: var(--text-2); max-width: 480px; }

.document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.document-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: inherit;
}
.document-card:hover { border-color: var(--accent); }
.document-card-title { display: flex; gap: 8px; font-weight: 600; }
.document-card-meta { color: var(--text-3); font-size: var(--fs-xs); }

.archive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.archive-title { background: none; border: none; color: var(--text); font-size: var(--fs-md); cursor: pointer; padding: 0; }
.archive-title:hover { color: var(--accent); }
.archive-meta { color: var(--text-3); font-size: var(--fs-xs); margin-left: auto; }

/* ============================================================
   Settings view
   ============================================================ */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 18px;
  max-width: 640px;
}
.settings-section-title { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin: 16px 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0 18px; flex-wrap: wrap; }
.settings-row-label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.settings-row-hint { color: var(--text-3); font-weight: 400; font-size: var(--fs-xs); }
.settings-row-actions { display: flex; gap: 6px; }
.template-content { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; min-height: 220px; resize: vertical; white-space: pre; }
.theme-picker { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; }
.theme-option { display: inline-flex; align-items: center; gap: 6px; border: none; }
.theme-option.active { background: var(--accent-soft); color: var(--text); }
.theme-option-icon { font-size: var(--fs-md); }

/* ============================================================
   Editor view
   ============================================================ */
.editor-view { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - var(--header-height) - 48px); min-height: 420px; }

.archived-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--warning);
  color: #1d232a;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: var(--fs-sm);
}

.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--text-3); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb-current { color: var(--text-2); }

.editor-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.editor-title { font-size: var(--fs-xl); margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.editor-actions { display: flex; gap: 2px; align-items: center; }
.mode-btn.active { background: var(--accent-soft); color: var(--text); }
.editor-meta-btn { font-size: var(--fs-lg); }

.editor-body { flex: 1; display: flex; gap: 14px; min-height: 0; }
.editor-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.preview-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 22px;
}

.editor-body.mode-write .preview-pane { display: none; }
.editor-body.mode-preview .editor-pane { display: none; }
@media (max-width: 768px) {
  .editor-body.mode-split .preview-pane { display: none; }
  .editor-view { height: calc(100dvh - var(--header-height) - 40px); }
}

.editor-footer { display: flex; justify-content: flex-end; min-height: 20px; }
.editor-status { font-size: var(--fs-xs); color: var(--text-3); }
.editor-status.status-unsaved { color: var(--warning); }
.editor-status.status-error { color: var(--danger); }
.editor-status.status-saved { color: var(--success); }

.backlinks { flex-shrink: 0; border-top: 1px solid var(--border); padding-top: 8px; }
.backlinks-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin: 0 0 6px; }
.backlinks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.backlinks-list a { color: var(--accent); text-decoration: none; font-size: var(--fs-sm); }
.backlinks-list a:hover { text-decoration: underline; }
.backlinks-count { margin-left: 5px; font-size: var(--fs-xs); color: var(--text-3); }

/* EasyMDE theming to match the app */
.CodeMirror, .editor-toolbar { background: var(--surface) !important; border-color: var(--border) !important; }
.CodeMirror { color: var(--text) !important; height: 100% !important; border-radius: 0 0 var(--r-sm) var(--r-sm); }
.editor-toolbar { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.editor-toolbar a { color: var(--text-2) !important; }
.editor-toolbar a.active, .editor-toolbar a:hover { background: var(--surface-2) !important; }
.EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--text) !important; }
.editor-pane .EasyMDEContainer { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.editor-pane .CodeMirror { flex: 1; }

/* ============================================================
   Markdown preview typography (markdown-body)
   ============================================================ */
.markdown-body { line-height: 1.65; word-wrap: break-word; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { line-height: 1.3; margin: 1.2em 0 0.5em; }
.markdown-body h1 { font-size: var(--fs-2xl); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h2 { font-size: var(--fs-xl); }
.markdown-body h3 { font-size: var(--fs-lg); }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 0.5em 0; }
.markdown-body code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.markdown-body pre { background: var(--surface-2); border-radius: var(--r-sm); padding: 14px; overflow-x: auto; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 3px solid var(--accent); margin: 0.6em 0; padding: 2px 14px; color: var(--text-2); }
.markdown-body table { border-collapse: collapse; margin: 0.8em 0; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 12px; }
.markdown-body img { max-width: 100%; border-radius: var(--r-sm); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.4em 0; }
.wikilink-missing { color: var(--text-3); text-decoration: underline dotted; cursor: help; }

/* --- Tags --- */

.markdown-body a.tag-link { color: var(--accent); text-decoration: none; background: var(--accent-soft); border-radius: var(--r-sm); padding: 0 4px; }
.markdown-body a.tag-link:hover { text-decoration: underline; }

.sidebar-tags { margin-top: 12px; }
.sidebar-tags-header { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; padding: 4px 8px; }
.sidebar-tags-header:hover { color: var(--text-2); }
.sidebar-tags-title { flex: 1; text-align: left; }
.sidebar-tags-count { font-size: var(--fs-xs); color: var(--text-3); }
.sidebar-tag-list { display: flex; flex-direction: column; }
.sidebar-tag-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 8px 3px 24px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.sidebar-tag-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-tag-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-tag-count { font-size: var(--fs-xs); color: var(--text-3); flex-shrink: 0; }

.tag-view-header { display: flex; align-items: baseline; gap: 12px; }
.tag-view-count { font-size: var(--fs-sm); color: var(--text-3); }
.tag-view-related { margin-top: 28px; }
.tag-view-related-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin: 0 0 8px; }
.tag-chip { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }

.CodeMirror { position: relative; }
.tag-autocomplete { z-index: 60; min-width: 180px; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 4px; }
.tag-autocomplete-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; background: none; border: none; color: var(--text); font-size: var(--fs-sm); text-align: left; padding: 5px 10px; border-radius: var(--r-sm); cursor: pointer; }
.tag-autocomplete-item:hover, .tag-autocomplete-item.active { background: var(--accent-soft); color: var(--accent); }
.tag-autocomplete-count { font-size: var(--fs-xs); color: var(--text-3); }

/* ============================================================
   Write with AI — button states, modal, jobs overview
   ============================================================ */
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.ai-write-btn.ai-busy { animation: ai-pulse 1.6s ease-in-out infinite; color: var(--accent); }

.ai-nav-badge {
  margin-left: 8px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-xs);
  text-align: center;
  animation: ai-pulse 1.6s ease-in-out infinite;
}

.ai-doc-badge { margin-left: 4px; font-size: var(--fs-xs); animation: ai-pulse 1.6s ease-in-out infinite; }

.ai-modal { width: min(92vw, 760px); max-width: 760px; }
.ai-prompt { resize: vertical; min-height: 140px; }
.ai-modal .form-hint { margin-top: 6px; } /* override the global -8px hint margin used after inputs */
.ai-note { color: var(--text-2); font-size: var(--fs-sm); margin: 0 0 10px; }

.ai-progress { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.ai-phase { font-weight: 600; margin: 0; animation: ai-pulse 1.6s ease-in-out infinite; }
.ai-detail, .ai-elapsed { color: var(--text-2); font-size: var(--fs-sm); margin: 0; }
.ai-sources { margin-top: 4px; }
.ai-sources-title { font-size: var(--fs-xs); color: var(--text-3); margin: 0 0 4px; }
.ai-sources ul { margin: 0; padding-left: 18px; font-size: var(--fs-sm); }

.ai-error { display: flex; flex-direction: column; gap: 8px; }
.ai-error-title { font-weight: 600; color: var(--warning); margin: 0; }
.ai-error-message { color: var(--text-2); font-size: var(--fs-sm); white-space: pre-wrap; word-break: break-word; margin: 0; }
.ai-error-details { font-size: var(--fs-sm); color: var(--text-3); }
.ai-done { font-weight: 600; color: var(--success); }

.ai-jobs-section .settings-row-label a { font-weight: 600; text-decoration: none; }
.ai-job-error { color: var(--danger); font-weight: 400; word-break: break-word; }
.ai-job-row.status-failed .settings-row-label,
.ai-job-row.status-interrupted .settings-row-label { border-left: 3px solid var(--danger); padding-left: 10px; }

/* ============================================================
   Print — only #print-root is visible (see js/printDocument.js)
   ============================================================ */
#print-root { display: none; }

@media print {
  @page { margin: 18mm 16mm; }

  html, body {
    background: #fff !important;
    color: #1d232a !important;
    color-scheme: light !important;
    font-size: 11.5pt;
  }

  body > *:not(#print-root) { display: none !important; }

  #print-root {
    display: block;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f2f3f5;
    --border: #c9cfd6;
    --text: #1d232a;
    --text-2: #3a434d;
    --text-3: #6b7480;
    --accent: #4636b8;
    --accent-soft: #ece8fb;
    color: var(--text);
    line-height: 1.6;
  }

  #print-root .print-title {
    font-size: 20pt;
    margin: 0 0 0.6em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  #print-root .markdown-body a { color: var(--accent); text-decoration: none; }
  #print-root .markdown-body pre,
  #print-root .markdown-body img { break-inside: avoid; }
  #print-root .markdown-body h1,
  #print-root .markdown-body h2,
  #print-root .markdown-body h3 { break-after: avoid; }
}
