@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url(/static/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/dm-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500 700; font-display: swap; src: url(/static/fonts/dm-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Michroma"; font-weight: 400; font-display: swap; src: url(/static/fonts/michroma-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #0a0a0f;
  --bg-2: #111118;
  --surface: #1c1c24;
  --surface-2: #24242e;
  --line: #2a2a35;
  --text: #e8e8ed;
  --muted: #9ea3b0;
  --mint: #00d3aa;
  --mint-dim: rgba(0, 211, 170, .12);
  --blue: #00b0f0;
  --warn: #f5b84a;
  --danger: #ff6b7a;
  --radius: 12px;
  --side: 250px;
  --ribbon: 48px;
  --right: 280px;
  --status: 28px;
  --top: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.8em 0 .7em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grad { background: linear-gradient(90deg, var(--mint), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }

/* Wortmarke */
.wm { font-family: "Michroma", sans-serif; font-size: .78rem; letter-spacing: .2em; color: var(--text); white-space: nowrap; }
.wm b { color: var(--mint); font-weight: 400; }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(10, 10, 15, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-sub { font-family: "Space Grotesk"; font-weight: 700; font-size: .95rem; color: var(--muted); }
.icon-btn { display: none; background: none; border: 0; color: var(--text); padding: 8px; margin-left: -8px; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 500 .92rem "DM Sans", sans-serif; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #3a3a48; background: var(--surface-2); }
.btn-primary { background: var(--mint); border-color: var(--mint); color: #04130f; }
.btn-primary:hover { background: #19e0b9; border-color: #19e0b9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; height: 44px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--text); }

/* Layout */
.shell { display: grid; grid-template-columns: var(--ribbon) var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top) - var(--status)); }
body.has-right .shell { grid-template-columns: var(--ribbon) var(--side) minmax(0, 1fr) var(--right); }
.side {
  position: sticky; top: var(--top); height: calc(100vh - var(--top) - var(--status)); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 14px 10px 0; display: flex; flex-direction: column; background: var(--bg);
}
.side-links { display: none; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; }
.side-links a, .side-links button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font: 500 .9rem "DM Sans"; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; }
.side-links a:hover, .side-links button:hover { color: var(--text); text-decoration: none; }
@media (max-width: 760px) { .side-links { display: grid; } }
.no-js .side-links { display: grid; }
.tree { flex: 1; font-size: .92rem; }
.tree a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.tree a.active { color: var(--mint); background: var(--mint-dim); }
.tree summary { list-style: none; cursor: pointer; display: flex; align-items: center; border-radius: 6px; padding-left: 6px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); margin-right: 4px; transition: transform .15s; flex: none; }
.tree details[open] > summary::before { transform: rotate(45deg); }
.tree summary a { flex: 1; color: var(--text); font-weight: 500; padding-left: 4px; }
.tree-children { padding-left: 12px; border-left: 1px solid var(--line); margin-left: 9px; }
.side-foot { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 8px; display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--muted); margin: 10px -10px 0; padding-inline: 18px; }
.main { padding: 28px clamp(16px, 4vw, 48px) 80px; max-width: 900px; width: 100%; }
.main.wide { max-width: none; }
.scrim { display: none; }

/* Start */
.hero { padding: 12px 0 8px; }
.pill-label { display: inline-block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); border: 1px solid rgba(0, 211, 170, .45); border-radius: 999px; padding: 4px 12px; margin: 0 0 10px; }
.big-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; height: 54px; color: var(--muted); margin: 6px 0 18px; }
.big-search:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-dim); }
.big-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 400 1.05rem "DM Sans"; height: 100%; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.tile:hover { text-decoration: none; border-color: rgba(0, 211, 170, .5); }
.tile-n { font: 700 1.6rem "Space Grotesk"; color: var(--mint); line-height: 1.1; }
.tile-l { color: var(--muted); font-size: .9rem; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.more { display: inline-block; margin-top: 10px; font-size: .9rem; }

/* Listen */
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li a { display: flex; align-items: center; gap: 8px; color: var(--text); min-width: 0; }
.list li a svg { color: var(--muted); }
.list li .muted { font-size: .82rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.folders li a { font-weight: 500; }
.changes { list-style: none; padding: 0; margin: 0; }
.changes li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.ch-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ch-head time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.ch-msg { margin-top: 4px; font-size: .92rem; word-break: break-word; }
.ch-files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: .82rem; }
.ch-files .gone { color: var(--muted); text-decoration: line-through; }
.pill { font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--mint-dim); color: var(--mint); white-space: nowrap; }
.hits { list-style: none; padding: 0; }
.hits li a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; color: var(--text); border: 1px solid transparent; }
.hits li a:hover { background: var(--surface); border-color: var(--line); text-decoration: none; }
.hits .path { color: var(--mint); font-size: .8rem; }
.hits .ex { color: var(--muted); font-size: .9rem; }
mark { background: rgba(0, 211, 170, .25); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* Notiz */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.note-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.note-actions form { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.chip i { font-style: normal; color: var(--muted); }
.st-offen { border-color: rgba(245, 184, 74, .5); color: var(--warn); }
.st-aktiv { border-color: rgba(0, 176, 240, .5); color: var(--blue); }
.st-erledigt { border-color: rgba(0, 211, 170, .5); color: var(--mint); }
.backlinks { margin-top: 40px; padding-top: 6px; border-top: 1px solid var(--line); }
.backlinks h2 .muted { font: 400 .9rem "DM Sans"; }

/* Markdown */
.md { overflow-wrap: break-word; }
.md h1 { font-size: 1.9rem; margin-top: 0; }
.md h2 { font-size: 1.35rem; margin-top: 1.6em; }
.md h3 { font-size: 1.1rem; margin-top: 1.4em; }
.md p, .md ul, .md ol { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.3em; }
.md li { margin: .2em 0; }
.md li::marker { color: var(--mint); }
.md li.task { list-style: none; margin-left: -1.3em; display: flex; gap: 8px; align-items: baseline; }
.md li.task > p { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.md li.task.done { color: var(--muted); text-decoration: line-through; }
.cb { width: 15px; height: 15px; border: 1.6px solid var(--muted); border-radius: 4px; flex: none; transform: translateY(2px); }
.cb.on { background: var(--mint); border-color: var(--mint); }
.md blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--mint); background: var(--bg-2); border-radius: 0 8px 8px 0; color: var(--muted); }
.md code { background: var(--surface); padding: 2px 6px; border-radius: 5px; }
.md pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .92rem; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.md th { color: var(--muted); font-weight: 500; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.md a.wl { color: var(--mint); background: var(--mint-dim); padding: 0 4px; border-radius: 4px; }
.md a.wl.missing { color: var(--warn); background: rgba(245, 184, 74, .1); border-bottom: 1px dashed var(--warn); }

/* Formulare */
.form { display: grid; gap: 16px; max-width: 520px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint); }
.alert { background: rgba(255, 107, 122, .1); border: 1px solid rgba(255, 107, 122, .4); color: #ffb3bb; padding: 10px 14px; border-radius: 10px; }
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.toggle input { width: auto; }

/* Editor */
.editor { display: flex; flex-direction: column; gap: 10px; }
.editor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; top: var(--top); background: var(--bg); padding: 8px 0; z-index: 5; }
.tabs { display: none; background: var(--surface); border-radius: 999px; padding: 3px; }
.tab { background: none; border: 0; color: var(--muted); font: 500 .88rem "DM Sans"; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--bg); color: var(--text); }
.editor-tools { display: flex; gap: 4px; }
.tool { background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 36px; height: 34px; border-radius: 8px; cursor: pointer; font: 700 .85rem "DM Sans"; }
.tool:hover { border-color: var(--mint); }
.editor-save { margin-left: auto; display: flex; gap: 8px; }
.editor-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 65vh; }
.editor textarea { width: 100%; min-height: 65vh; resize: vertical; font: 15px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; tab-size: 2; }
.preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; overflow: auto; max-height: 80vh; }

/* Graph */
.graph-wrap { position: relative; height: calc(100vh - 220px); min-height: 380px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 70% 20%, rgba(0, 176, 240, .06), transparent 50%), var(--bg-2); overflow: hidden; touch-action: none; }
#graph { width: 100%; height: 100%; display: block; cursor: grab; }
#graph.drag { cursor: grabbing; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; }
.net { position: absolute; top: -20px; right: -40px; width: min(620px, 90vw); color: var(--mint); opacity: .45; pointer-events: none; }
.login { width: 100%; max-width: 420px; padding: 16px; position: relative; }
.login-card { background: rgba(28, 28, 36, .85); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; backdrop-filter: blur(8px); }
.login-card h1 { font-size: 1.7rem; margin: 22px 0 6px; }
.login-card > .muted { margin: 0 0 20px; }
.login-form { display: grid; gap: 14px; }
.login-form input { width: 100%; }
.continue { margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Mobil */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; gap: 0; }
  .editor-panes { grid-template-columns: 1fr; }
  .tabs { display: inline-flex; }
  .editor-panes .preview { display: none; max-height: none; min-height: 60vh; }
  .editor-panes.show-preview textarea { display: none; }
  .editor-panes.show-preview .preview { display: block; }
}
@media (max-width: 760px) {
  :root { --top: 56px; }
  .shell { grid-template-columns: 1fr; }
  .icon-btn { display: inline-flex; }
  .brand-sub { display: none; }
  .wm { font-size: .68rem; letter-spacing: .16em; }
  .top { gap: 8px; padding: 0 12px; }
  .btn-new span { display: none; }
  .btn-new { width: 38px; padding: 0; }
  .side { position: fixed; left: 0; top: var(--top); bottom: 0; width: min(86vw, 320px); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; height: auto; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .55); z-index: 35; }
  .main { padding: 18px 16px 60px; }
  .editor-bar { flex-wrap: wrap; }
  .editor-save { margin-left: 0; width: 100%; }
  .editor-save .btn { flex: 1; }
  .list li .muted { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ===== Obsidian-artige Elemente ===== */
.ribbon { position: sticky; top: var(--top); height: calc(100vh - var(--top) - var(--status)); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-right: 1px solid var(--line); background: var(--bg); }
.ribbon a, .ribbon button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.ribbon a:hover, .ribbon button:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.ribbon a.on { color: var(--mint); background: var(--mint-dim); }
.ribbon svg { width: 20px; height: 20px; }
.ribbon-spacer { flex: 1; }
.side-head { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 4px 8px 10px; }

.switcher-btn { flex: 1; max-width: 560px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; cursor: text; text-align: left; }
.switcher-btn:hover { border-color: #3a3a48; }
.switcher-btn span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 500 .7rem "DM Sans", sans-serif; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--bg-2); white-space: nowrap; }
.btn kbd { margin-left: 4px; border-color: rgba(0,0,0,.25); color: inherit; background: rgba(0,0,0,.12); }

.right { position: sticky; top: var(--top); height: calc(100vh - var(--top) - var(--status)); overflow-y: auto; border-left: 1px solid var(--line); padding: 8px 10px; background: var(--bg); font-size: .9rem; }
.rp { border-bottom: 1px solid var(--line); padding: 4px 0 10px; margin-bottom: 6px; }
.rp summary { cursor: pointer; list-style: none; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; display: flex; align-items: center; gap: 6px; }
.rp summary::-webkit-details-marker { display: none; }
.rp summary::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.rp[open] > summary::before { transform: rotate(45deg); }
.rp .count { margin-left: auto; color: var(--text); font-weight: 500; letter-spacing: 0; }
.props { display: grid; gap: 2px; }
.prop { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 5px 6px; border-radius: 6px; align-items: baseline; }
.prop:hover { background: var(--bg-2); }
.prop-k { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.prop-v { color: var(--text); overflow-wrap: anywhere; }
.prop-v.st-offen { color: var(--warn); } .prop-v.st-aktiv { color: var(--blue); } .prop-v.st-erledigt { color: var(--mint); }
.outline { list-style: none; margin: 0; padding: 0; }
.outline li a { display: block; padding: 4px 6px; border-radius: 6px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.outline li a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.outline .lvl1 a { color: var(--text); font-weight: 500; }
.outline .lvl2 { padding-left: 12px; } .outline .lvl3 { padding-left: 24px; } .outline .lvl4 { padding-left: 36px; }
.backlist { list-style: none; margin: 0; padding: 0; }
.backlist li { padding: 5px 6px; border-radius: 6px; display: grid; }
.backlist li:hover { background: var(--bg-2); }
.backlist .muted { font-size: .78rem; }
.rp p.small { padding: 0 6px; }

.statusbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--status); display: flex; align-items: center; gap: 18px; padding: 0 14px; font-size: .75rem; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); z-index: 20; }
.status-path { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding-bottom: calc(60px + var(--status)); }

/* Notiz-Kopf mit Umschalter */
.note-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.note-title { margin: 0 0 .4em; }
.note-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-top: 4px; }
.mode { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mode-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.mode-btn:hover { color: var(--text); text-decoration: none; }
.mode-btn.on { background: var(--mint); color: #04130f; }
.mode-btn svg { width: 16px; height: 16px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.icon-btn-sm { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; letter-spacing: 1px; }
.menu-list { position: absolute; right: 0; top: 40px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 2px; z-index: 15; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list form { margin: 0; }
.menu-danger { color: var(--danger) !important; }
.note .md h1:first-child { display: none; } /* Titel steht schon in der Kopfzeile */
.backlinks-inline { margin-top: 40px; padding-top: 6px; border-top: 1px solid var(--line); }
body.has-right .backlinks-inline { display: none; } /* steht rechts, am Desktop nicht doppelt */
.editor-bar { top: calc(var(--top)); }

/* Modale */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 5, 10, .6); backdrop-filter: blur(4px); display: grid; place-items: start center; padding: 10vh 16px 16px; }
.modal[hidden] { display: none; }
.modal-box { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; }
.modal-box > input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 16px 18px; font-size: 1.05rem; }
.modal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.modal-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.modal-list li.sel { background: var(--mint-dim); }
.modal-list li.create .m-label { color: var(--mint); }
.modal-list li.fulltext .m-label { color: var(--muted); }
.modal-list li.empty { color: var(--muted); cursor: default; }
.m-label { color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-sub { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.modal-hint { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.help-box { padding: 26px 26px 22px; }
.help-box h2 { margin: 0 0 14px; }
.help-steps { padding-left: 1.2em; margin: 0 0 14px; display: grid; gap: 10px; }
.help-steps li::marker { color: var(--mint); font-weight: 700; }

/* Anpassungen */
@media (max-width: 1100px) {
  body.has-right .shell { grid-template-columns: var(--ribbon) var(--side) minmax(0, 1fr); }
  .right { position: fixed; right: 0; top: var(--top); bottom: var(--status); width: min(86vw, 320px); transform: translateX(100%); transition: transform .2s ease; z-index: 40; box-shadow: -10px 0 30px rgba(0,0,0,.4); }
  body.right-open .right { transform: none; }
  body.has-right .backlinks-inline { display: block; }
}
.right-btn { display: none; }
@media (max-width: 1100px) { .right-btn { display: inline-flex; margin-left: 0; } }
@media (max-width: 760px) {
  .shell, body.has-right .shell { grid-template-columns: 1fr; }
  .ribbon { display: none; }
  .switcher-btn { flex: none; width: 38px; height: 38px; padding: 0; justify-content: center; margin-left: auto; }
  .switcher-btn span, .switcher-btn kbd { display: none; }
  .note-bar { flex-direction: column; gap: 8px; }
  .mode-btn span { display: inline; }
  .statusbar span:not(.status-path) { display: none; }
  .statusbar .status-path { margin-left: 0; }
  .modal { padding: 4vh 10px 10px; }
  .side-foot { bottom: var(--status); }
}
.big-search.as-button { width: 100%; cursor: pointer; text-align: left; font: inherit; }
.big-search.as-button span { flex: 1; color: var(--muted); font-size: 1.05rem; }
.onboarding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 10px; margin-bottom: 20px; }
.onboarding h2 { margin-top: 0; }
