/* Noos — Notes • Knowledge • Intelligence (zero external fonts/CDNs) */

:root {
  --bg-app: #0b0f14;
  --bg-sidebar: #0f151d;
  --bg-surface: #141c26;
  --bg-elevated: #192330;
  --bg-hover: rgba(110, 226, 255, 0.06);
  --bg-active: rgba(78, 216, 245, 0.14);
  --bg-code: #080c11;
  --bg-inline-code: rgba(78, 216, 245, 0.10);
  --border: rgba(130, 195, 235, 0.10);
  --border-strong: rgba(130, 195, 235, 0.18);

  --text-primary: #e5eff6;
  --text-secondary: #98b0c4;
  --text-muted: #627b91;

  --noos-mint: #5ef2c7;
  --noos-cyan: #4ed8f5;
  --noos-blue: #4f94ff;
  --noos-gradient: linear-gradient(135deg, #5ef2c7 0%, #4ed8f5 52%, #4f94ff 100%);

  --accent: #4ed8f5;
  --accent-hover: #7ce8ff;
  --accent-soft: rgba(78, 216, 245, 0.13);
  --accent-border: rgba(78, 216, 245, 0.34);
  --accent-glow: 0 0 18px rgba(78, 216, 245, 0.22);
  --btn-primary-fg: #051319;

  --ok: #5ef2c7;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #4ed8f5;
  --tip: #5ef2c7;

  --tok-kw: #60a5fa;
  --tok-str: #5ef2c7;
  --tok-num: #fbbf24;
  --tok-key: #4ed8f5;
  --tok-comment: #5d7388;
  --tok-var: #93c5fd;
  --tok-punct: #7e97ad;

  --sidebar-width: 280px;
  --topbar-height: 50px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 9px;
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.62);
}

[data-theme="light"] {
  --bg-app: #fbfdff;
  --bg-sidebar: #eff5f9;
  --bg-surface: #f4f9fc;
  --bg-elevated: #ffffff;
  --bg-hover: rgba(14, 116, 144, 0.06);
  --bg-active: rgba(8, 145, 178, 0.12);
  --bg-code: #eef4f8;
  --bg-inline-code: rgba(8, 145, 178, 0.09);
  --border: rgba(15, 58, 86, 0.09);
  --border-strong: rgba(15, 58, 86, 0.17);

  --text-primary: #10202e;
  --text-secondary: #4a6378;
  --text-muted: #768fa4;

  --noos-mint: #0d9488;
  --noos-cyan: #0891b2;
  --noos-blue: #2563eb;
  --noos-gradient: linear-gradient(135deg, #0d9488 0%, #0891b2 52%, #2563eb 100%);

  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-soft: rgba(8, 145, 178, 0.10);
  --accent-border: rgba(8, 145, 178, 0.30);
  --accent-glow: 0 4px 16px rgba(8, 145, 178, 0.22);
  --btn-primary-fg: #ffffff;

  --ok: #0d9488;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --tip: #0d9488;

  --tok-kw: #2563eb;
  --tok-str: #0f766e;
  --tok-num: #b45309;
  --tok-key: #0369a1;
  --tok-comment: #6e8396;
  --tok-var: #0e7490;
  --tok-punct: #64748b;

  --shadow-lg: 0 18px 48px rgba(12, 34, 54, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hidden {
  display: none !important;
}

/* ===== Layout Shell ===== */
.app-shell {
  display: flex;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left 0.2s ease, transform 0.22s ease;
  z-index: 30;
  user-select: none;
}

.app-shell.sidebar-collapsed .sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
  z-index: 25;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 12px rgba(78, 216, 245, 0.18);
}

.brand-wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.24em;
  background: var(--noos-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sidebar-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 6px;
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.sidebar-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-tab.active {
  background: var(--bg-active);
  color: var(--accent);
}

.sidebar-filter-wrap {
  padding: 4px 10px 8px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-filter {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.sidebar-filter:focus {
  border-color: var(--accent);
}

.sidebar-filter-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--text-muted);
  font-size: 15px;
  padding: 2px 5px;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Tree Items */
.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  min-height: 32px;
  transition: background 0.1s, color 0.1s;
}

.tree-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tree-row.active {
  background: var(--bg-active);
  color: var(--accent);
  font-weight: 500;
}

.tree-row.drag-over {
  outline: 1.5px dashed var(--accent);
  background: var(--accent-soft);
}

.tree-chevron {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.tree-chevron.open {
  transform: rotate(90deg);
}

.tree-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.72;
}

.tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-row-actions {
  display: none;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.tree-row:hover .tree-row-actions,
.tree-row.active .tree-row-actions {
  display: flex;
}

.tree-mini-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.tree-mini-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.tree-mini-btn.danger:hover {
  color: var(--danger);
}

.tree-children {
  padding-left: 14px;
}

/* Tags list in sidebar */
.tag-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tag-list-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tag-list-item.active {
  background: var(--bg-active);
  color: var(--accent);
  font-weight: 500;
}

.tag-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.tag-notes-sub {
  margin: 4px 0 10px 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

/* ===== Icon Buttons & Controls ===== */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn.active {
  background: var(--bg-active);
  color: var(--accent);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Main Workspace ===== */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-app);
}

.topbar {
  height: var(--topbar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-app);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
}

.breadcrumb-folder {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.breadcrumb-note {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 5px;
}

.breadcrumb-note:hover {
  background: var(--bg-hover);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Save indicator */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.save-status.dirty .save-dot { background: var(--warn); }
.save-status.saving .save-dot { background: var(--accent); animation: pulse 1s infinite; }
.save-status.conflict .save-dot,
.save-status.error .save-dot { background: var(--danger); }
.save-status.conflict { color: var(--danger); cursor: pointer; background: rgba(248, 113, 113, 0.12); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Mode Segmented Control */
.mode-switch {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Search button */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  transition: border-color 0.15s, color 0.15s;
}

.search-trigger:hover {
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ===== Markdown Toolbar ===== */
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.md-toolbar::-webkit-scrollbar { display: none; }

.tb-btn {
  height: 30px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tb-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tb-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ===== Workspace Panes ===== */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.editor-pane, .preview-pane {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.workspace.mode-preview .editor-pane { display: none; }
.workspace.mode-edit .preview-pane { display: none; }
.workspace.mode-split .editor-pane {
  border-right: 1px solid var(--border);
}

.editor-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.workspace.mode-split .editor-inner {
  max-width: none;
  padding: 18px 20px 40px;
}

.editor-textarea {
  flex: 1;
  width: 100%;
  min-height: calc(100% - 10px);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-primary);
  tab-size: 2;
}

.editor-pane.drop-active {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: var(--accent-soft);
}

/* ===== Preview Styling (Obsidian-inspired) ===== */
.preview-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.note-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* YAML Frontmatter Properties Card */
.frontmatter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
}

.frontmatter-card summary {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frontmatter-card summary::-webkit-details-marker { display: none; }

.frontmatter-grid {
  padding: 4px 14px 12px;
  display: grid;
  grid-template-columns: minmax(95px, auto) 1fr;
  gap: 7px 14px;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.fm-key {
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 2px;
}

.fm-val {
  color: var(--text-primary);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  word-break: break-word;
}

.fm-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Markdown Body Typography */
.md-body {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-primary);
  word-wrap: break-word;
}

.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  margin: 1.5em 0 0.55em;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: 1.85em; padding-bottom: 0.25em; border-bottom: 1px solid var(--border); }
.md-body h2 { font-size: 1.42em; }
.md-body h3 { font-size: 1.18em; }
.md-body h4 { font-size: 1.04em; color: var(--text-secondary); }

.md-body p {
  margin: 0.75em 0;
}

.md-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s, color 0.12s;
}

.md-body a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.md-wikilink {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid var(--accent-border);
}

.md-wikilink.is-unresolved {
  opacity: 0.68;
  border-bottom-style: dashed;
}

.md-embed-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.md-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--noos-mint);
  background: rgba(94, 242, 199, 0.11);
  border: 1px solid rgba(94, 242, 199, 0.18);
  vertical-align: baseline;
  transition: background 0.12s, border-color 0.12s;
}

[data-theme="light"] .md-tag {
  background: rgba(13, 148, 136, 0.10);
  border-color: rgba(13, 148, 136, 0.22);
}

.md-tag:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.md-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-inline-code);
}

.md-body mark {
  background: rgba(251, 191, 36, 0.28);
  color: inherit;
  padding: 0 3px;
  border-radius: 3px;
}

.md-body hr {
  border: none;
  border-top: 1px solid var(--border-strong);
  margin: 1.8em 0;
}

.md-body ul, .md-body ol {
  margin: 0.6em 0;
  padding-left: 1.55em;
}

.md-body li {
  margin: 0.28em 0;
}

/* Interactive Checkboxes */
.md-body ul.task-list {
  list-style: none;
  padding-left: 0.2em;
}

.task-item {
  list-style: none;
}

.task-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.md-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: 4px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.12s, border-color 0.12s;
}

.md-checkbox:hover {
  border-color: var(--accent);
}

.md-checkbox:checked {
  background: var(--noos-gradient);
  border-color: transparent;
}

.md-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--btn-primary-fg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-item.is-done > .task-label > span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Blockquotes & Obsidian Callouts */
.md-body blockquote {
  margin: 1em 0;
  padding: 6px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-surface);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}

.md-body blockquote > :first-child { margin-top: 0; }
.md-body blockquote > :last-child { margin-bottom: 0; }

.callout {
  --co-color: var(--info);
  margin: 1.1em 0;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--co-color) 28%, transparent);
  border-left: 4px solid var(--co-color);
  background: color-mix(in srgb, var(--co-color) 9%, transparent);
  overflow: hidden;
}

.co-note    { --co-color: #4ed8f5; }
.co-info    { --co-color: #4f94ff; }
.co-tip     { --co-color: #5ef2c7; }
.co-success { --co-color: #4ade80; }
.co-warn    { --co-color: #fbbf24; }
.co-danger  { --co-color: #f87171; }
.co-example { --co-color: #60a5fa; }
.co-quote   { --co-color: #8ca3b8; }

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--co-color);
}

details.callout > summary.callout-title {
  cursor: pointer;
  list-style: none;
}

details.callout > summary.callout-title::-webkit-details-marker { display: none; }

.callout-icon {
  flex-shrink: 0;
}

.callout-body {
  padding: 0 14px 12px 14px;
  font-size: 14.5px;
}

.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }

/* Code Blocks */
.md-codeblock {
  margin: 1.1em 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-code);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  min-height: 28px;
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.code-copy-btn {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.code-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.md-codeblock pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
}

.md-codeblock pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.tok-kw { color: var(--tok-kw); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-key { color: var(--tok-key); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-var { color: var(--tok-var); }
.tok-punct { color: var(--tok-punct); }

/* Tables */
.md-table-wrap {
  margin: 1.1em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.md-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.md-body th, .md-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.md-body th {
  background: var(--bg-surface);
  font-weight: 600;
  color: var(--text-primary);
}

.md-body tr:last-child td {
  border-bottom: none;
}

/* Images & Embeds */
.md-embed-img {
  display: block;
  margin: 1em 0;
}

.md-embed-img img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}

.md-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

/* Backlinks Section */
.backlinks-section {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.backlinks-section summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.backlinks-section summary::-webkit-details-marker { display: none; }

.backlinks-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backlink-card {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.12s, background 0.12s;
}

.backlink-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-elevated);
}

.backlink-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}

.backlink-snippet {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Welcome / Empty State (Noos) ===== */
.welcome-view {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 48px;
  background: radial-gradient(ellipse 680px 320px at 50% 0%, rgba(78, 216, 245, 0.06), transparent 72%);
}

[data-theme="light"] .welcome-view {
  background: radial-gradient(ellipse 680px 320px at 50% 0%, rgba(8, 145, 178, 0.07), transparent 72%);
}

.welcome-inner {
  max-width: 680px;
  margin: 0 auto;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 14px;
}

.welcome-logo-dark {
  display: block;
  width: min(360px, 86vw);
  height: auto;
  mix-blend-mode: lighten;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 0 22px rgba(78, 216, 245, 0.14));
}

.welcome-logo-light {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 6px;
}

[data-theme="light"] .welcome-logo-dark {
  display: none;
}

[data-theme="light"] .welcome-logo-light {
  display: flex;
}

.welcome-emblem {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(8, 145, 178, 0.22);
}

.welcome-wordmark {
  margin: 4px 0 0;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  background: var(--noos-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.noos-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
  margin: 2px 0;
}

.noos-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--noos-cyan), transparent);
}

.noos-divider i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--noos-cyan);
  box-shadow: 0 0 8px var(--noos-cyan);
}

.welcome-tagline {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-muted);
}

.welcome-stats {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 22px;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.1s;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-border);
}

.btn-primary {
  background: var(--noos-gradient);
  border-color: transparent;
  color: var(--btn-primary-fg);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--noos-gradient);
  border-color: transparent;
  filter: brightness(1.07);
  box-shadow: var(--accent-glow);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.24);
}

.recent-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

.recent-item:hover {
  border-color: var(--accent-border);
  background: var(--bg-elevated);
}

.recent-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-folder {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Wikilink Autocomplete Popup ===== */
.autocomplete-popup {
  position: fixed;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
}

.ac-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
}

.ac-item:hover, .ac-item.selected {
  background: var(--bg-active);
  color: var(--accent);
}

.ac-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ac-item.is-create {
  border-top: 1px solid var(--border);
  margin-top: 3px;
  padding-top: 8px;
  color: var(--accent);
  font-weight: 500;
}

.ac-item.is-create:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 7px;
}

/* ===== Editor Wikilink Floating Popover ===== */
.wikilink-popover {
  position: fixed;
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(440px, calc(100vw - 24px));
  padding: 6px 8px 6px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: fadeUp 0.12s ease;
}

.wl-pop-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 500;
}

.wl-pop-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.wl-pop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--noos-gradient);
  color: var(--btn-primary-fg);
  transition: filter 0.12s, box-shadow 0.12s;
}

.wl-pop-btn:hover {
  filter: brightness(1.08);
  box-shadow: var(--accent-glow);
}

.wl-pop-btn.is-existing {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.wl-pop-btn.is-existing:hover {
  background: rgba(78, 216, 245, 0.22);
}

/* ===== Discreet Editor Backlinks Bar ===== */
.editor-backlinks {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.editor-backlink-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.12s;
}

.editor-backlink-chip:hover {
  background: rgba(78, 216, 245, 0.22);
}

.editor-textarea.ctrl-link-cursor {
  cursor: pointer;
}

/* ===== Modals & Quick Search Palette ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 24px;
}

.modal-card {
  width: min(500px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-card {
  width: min(620px, 100%);
  max-height: 76dvh;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15.5px;
  color: var(--text-primary);
}

.search-results {
  overflow-y: auto;
  padding: 8px;
  max-height: 58dvh;
}

.search-row {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-row:hover, .search-row.selected {
  background: var(--bg-active);
}

.search-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-row-title {
  font-weight: 550;
  font-size: 14px;
  color: var(--text-primary);
}

.search-row-path {
  font-size: 11.5px;
  color: var(--text-muted);
}

.search-row-snippet {
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.modal-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.field-input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}

.field-input:focus {
  border-color: var(--accent);
}

.conflict-preview {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}

.lightbox-overlay img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: fadeUp 0.16s ease;
}

.toast.is-error { border-color: rgba(248, 113, 113, 0.5); color: var(--danger); }
.toast.is-ok { border-color: rgba(74, 222, 128, 0.45); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive Mobile Layout ===== */
@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(84vw, 310px);
    min-width: 0;
    margin-left: 0 !important;
    transform: translateX(-102%);
    box-shadow: var(--shadow-lg);
  }

  .app-shell.mobile-drawer-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.mobile-drawer-open .sidebar-backdrop {
    display: block;
  }

  .mode-btn[data-mode="split"] {
    display: none;
  }

  .search-trigger kbd,
  .search-trigger .search-label {
    display: none;
  }

  .search-trigger {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .tree-row {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 14.5px;
  }

  .tree-row-actions {
    display: flex;
  }

  .tree-mini-btn {
    width: 32px;
    height: 32px;
  }

  .breadcrumb-folder,
  .breadcrumb-sep {
    display: none;
  }

  .save-status-text {
    display: none;
  }

  .preview-inner {
    padding: 18px 16px 76px;
  }

  .editor-inner {
    padding: 14px 14px 60px;
  }

  .tb-btn {
    height: 36px;
    min-width: 38px;
    padding: 0 10px;
  }

  .modal-overlay {
    padding: 5vh 10px 16px;
  }
}

/* ===== Obsidian-inspired Interactive Graph View ===== */
.graph-view {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-app);
  user-select: none;
  touch-action: none;
}

.graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.graph-canvas:active {
  cursor: grabbing;
}

.graph-stats-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 10;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.graph-zoom-controls {
  position: absolute;
  left: 14px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.graph-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.graph-ctrl-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Floating Obsidian-style Settings Panel */
.graph-settings-panel {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 15;
  width: 268px;
  max-height: calc(100% - 26px);
  display: flex;
  flex-direction: column;
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-sidebar) 90%, transparent);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: width 0.16s ease;
}

.graph-settings-panel.collapsed {
  width: auto;
}

.graph-settings-panel.collapsed .graph-settings-body,
.graph-settings-panel.collapsed .graph-settings-toggle-label {
  display: none;
}

.graph-settings-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.graph-settings-panel.collapsed .graph-settings-toggle {
  border-bottom: none;
  padding: 9px;
}

.graph-settings-toggle:hover {
  color: var(--accent);
}

.graph-settings-body {
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.gs-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-scope-switch {
  display: flex;
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: var(--bg-app);
  border: 1px solid var(--border);
}

.gs-scope-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.gs-scope-btn:hover:not(:disabled) {
  color: var(--text-primary);
}

.gs-scope-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gs-scope-btn.active {
  background: var(--bg-active);
  color: var(--accent);
}

.gs-group {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.gs-group summary {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 4px;
}

.gs-group summary::-webkit-details-marker { display: none; }
.gs-group summary::after {
  content: "▸";
  font-size: 11px;
  transition: transform 0.14s;
}
.gs-group[open] summary::after {
  transform: rotate(90deg);
}

.gs-group-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.gs-search {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12.5px;
  outline: none;
}

.gs-search:focus {
  border-color: var(--accent);
}

.gs-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.gs-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 19px;
  border-radius: 99px;
  background: var(--bg-app);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.gs-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s, background 0.15s;
}

.gs-toggle input[type="checkbox"]:checked {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.gs-toggle input[type="checkbox"]:checked::after {
  transform: translateX(15px);
  background: var(--accent);
}

.gs-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gs-slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.gs-slider-row label span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.gs-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 4px;
}

.gs-full-btn {
  width: 100%;
  padding: 7px 10px;
  font-size: 12.5px;
  margin-top: 2px;
}

.gs-full-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.graph-folder-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 120px;
  overflow-y: auto;
}

.graph-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-app);
  border: 1px solid var(--border);
  max-width: 100%;
  transition: border-color 0.12s, color 0.12s;
}

.graph-legend-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-legend-chip:hover,
.graph-legend-chip.active {
  border-color: var(--accent-border);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.graph-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Mobile touch selected node preview card */
.graph-mobile-card {
  position: absolute;
  left: 60px;
  right: 14px;
  bottom: 16px;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.graph-mobile-info {
  min-width: 0;
  flex: 1;
}

.graph-mobile-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-mobile-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.graph-mobile-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 899px) {
  .graph-settings-panel {
    width: min(290px, calc(100vw - 24px));
  }
  .graph-ctrl-btn {
    width: 40px;
    height: 40px;
  }
}
