/* RealDodos Schreibnotizen */
:root {
  --accent: #ff8a3d;
  --accent2: #ff4f6d;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --ed-size: 16px;
  --radius: 14px;
  --side-w: 260px;
  --list-w: 340px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #151821;
  --bg3: #1c2030;
  --panel: #171a24;
  --line: #262b3b;
  --line2: #323850;
  --text: #eceef5;
  --text2: #a6abc0;
  --text3: #737a94;
  --hover: rgba(255, 255, 255, .05);
  --sel: rgba(255, 138, 61, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --code: #0b0d13;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f4f1;
  --bg2: #ffffff;
  --bg3: #f0ede8;
  --panel: #fbfaf8;
  --line: #e6e1d9;
  --line2: #d6cfc4;
  --text: #1d1b20;
  --text2: #5e5a66;
  --text3: #8f8a96;
  --hover: rgba(0, 0, 0, .045);
  --sel: rgba(255, 138, 61, .16);
  --shadow: 0 18px 50px rgba(60, 40, 20, .16);
  --code: #f3efe9;
  color-scheme: light;
}
/* Notizfarben */
.c-red { --nc: #f43f5e; } .c-orange { --nc: #fb923c; } .c-yellow { --nc: #facc15; } .c-green { --nc: #22c55e; }
.c-teal { --nc: #14b8a6; } .c-blue { --nc: #3b82f6; } .c-purple { --nc: #a855f7; } .c-pink { --nc: #ec4899; } .c-gray { --nc: #94a3b8; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------------------------------------------------------------- Laden */
.boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 22px; background: var(--bg); z-index: 100; transition: opacity .3s; }
.boot.out { opacity: 0; pointer-events: none; }
.boot-logo img { display: block; border-radius: 20px; animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
.boot-bar { width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 4px; animation: slide 1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes fadeUp { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- Buttons + Felder */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line2); background: var(--bg3); font-weight: 600; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--text3); }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.pri:hover { filter: brightness(1.07); }
.btn.danger { color: #fff; background: #e11d48; border: 0; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.ib { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--text2); flex: none; transition: background .15s, color .15s; }
.ib:hover { background: var(--hover); color: var(--text); }
.ib.on { color: var(--accent); background: var(--sel); }
.ib svg, .btn svg, .nav svg { width: 19px; height: 19px; flex: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text2); }
.inp { width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line2); background: var(--bg2); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.inp { height: auto; padding: 10px 13px; resize: vertical; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.inp { padding-right: 30px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text2); cursor: pointer; }
.chk input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.muted { color: var(--text3); }
.err { color: #fb7185; font-size: 14px; min-height: 20px; }
.kbd { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text2); }

/* ---------------------------------------------------------------- Login */
.auth { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; overflow: auto; }
.auth-hero { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 26px; overflow: hidden; background: radial-gradient(1000px 600px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), radial-gradient(800px 500px at 100% 100%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 60%), var(--bg2); border-right: 1px solid var(--line); }
.auth-hero h1 { font-size: clamp(32px, 4vw, 54px); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
.auth-hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { font-size: 18px; color: var(--text2); max-width: 560px; margin: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.hero-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 620px; }
.hero-feat { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); animation: fadeUp .5s both; }
.hero-feat b { display: block; font-size: 14px; }
.hero-feat span { font-size: 13px; color: var(--text2); }
.hero-feat i { font-style: normal; font-size: 22px; line-height: 1; }
.hero-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-plats span { font-size: 13px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); color: var(--text2); background: var(--bg2); }
.auth-box { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); animation: fadeUp .4s both; }
.auth-card h2 { margin: 0 0 6px; font-size: 26px; }
.auth-card .sub { margin: 0 0 24px; color: var(--text2); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--bg3); margin-bottom: 22px; }
.auth-tabs button { height: 36px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--text2); }
.auth-tabs button.on { background: var(--bg2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.pw-wrap { position: relative; }
.pw-wrap .ib { position: absolute; right: 3px; top: 3px; }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--text3); text-align: center; }
.auth-foot a { color: var(--text2); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: -6px; margin-bottom: 12px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------------------------------------------------------------- Hauptlayout */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: var(--side-w) var(--list-w) minmax(0, 1fr); padding-top: var(--safe-t); }
.app.no-side { grid-template-columns: 0 var(--list-w) minmax(0, 1fr); }
.app.focus { grid-template-columns: 0 0 minmax(0, 1fr); }
.app.no-side .side, .app.focus .side, .app.focus .list { visibility: hidden; overflow: hidden; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.side-top { display: flex; align-items: center; gap: 10px; padding: 14px 12px 8px 16px; }
.side-top .brand { font-size: 16px; flex: 1; min-width: 0; }
.side-top .brand img { width: 30px; height: 30px; border-radius: 9px; }
.new-btn { margin: 6px 12px 10px; height: 44px; font-size: 15px; }
.new-wrap { display: flex; gap: 6px; margin: 6px 12px 10px; }
.new-wrap .new-btn { margin: 0; flex: 1; }
.new-wrap .btn.tpl { width: 44px; height: 44px; padding: 0; }
.side-scroll { flex: 1; overflow: auto; padding: 0 8px 12px; }
.nav { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text2); text-align: left; font-weight: 500; position: relative; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--sel); color: var(--text); font-weight: 600; }
.nav.on::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .cnt { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.nav .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nc, var(--text3)); flex: none; margin: 0 4.5px; }
.nav .emo { width: 19px; text-align: center; flex: none; }
.nav.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.side-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.side-h .ib { width: 26px; height: 26px; }
.side-h .ib svg { width: 15px; height: 15px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line2); background: transparent; font-size: 12.5px; color: var(--text2); }
.tag:hover { border-color: var(--accent); color: var(--text); }
.tag.on { background: var(--sel); border-color: var(--accent); color: var(--text); }
.side-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; align-items: center; gap: 8px; }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 11px; background: transparent; text-align: left; }
.me-btn:hover { background: var(--hover); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); flex: none; font-size: 14px; }
.me-btn .who { min-width: 0; }
.me-btn .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn .who small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.sync-dot.busy { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.sync-dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }

/* Liste */
.list { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.list-top { padding: 14px 14px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: center; gap: 6px; }
.list-title h2 { flex: 1; margin: 0; font-size: 19px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--text3); pointer-events: none; }
.search .inp { padding-left: 38px; height: 40px; background: var(--bg3); border-color: transparent; }
.search .inp:focus { background: var(--bg2); }
.search .kbd { position: absolute; right: 10px; top: 10px; }
.list-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text3); }
.list-meta select { border: 0; background: transparent; color: var(--text2); font-size: 12.5px; cursor: pointer; outline: none; }
.list-scroll { flex: 1; overflow: auto; padding: 8px; }
.list-scroll.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 10px 8px 6px; grid-column: 1 / -1; }
.card { position: relative; display: block; width: 100%; text-align: left; padding: 12px 14px 12px 16px; border-radius: 12px; border: 1px solid transparent; background: transparent; margin-bottom: 2px; transition: background .12s, border-color .12s; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--nc, transparent); }
.card:hover { background: var(--hover); }
.card.on { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.card.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.card h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.card h3 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h3 svg { width: 14px; height: 14px; color: var(--text3); flex: none; }
.card h3 svg.pin { color: var(--accent); }
.card p { margin: 0; font-size: 13px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card .meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--text3); flex-wrap: wrap; }
.card .meta .prog { display: inline-flex; align-items: center; gap: 5px; }
.card .meta .prog i { display: inline-block; width: 34px; height: 4px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.card .meta .prog i b { display: block; height: 100%; background: #22c55e; }
.card .meta .mini-tag { color: var(--accent); }
.card .thumb { float: right; width: 52px; height: 52px; border-radius: 9px; object-fit: cover; margin: 0 0 4px 10px; background: var(--bg3); }
.list-scroll.grid .card { margin: 0; min-height: 150px; border-color: var(--line); background: var(--panel); padding: 14px; }
.list-scroll.grid .card::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 4px; border-radius: 0; }
.list-scroll.grid .card p { -webkit-line-clamp: 5; }
.list-scroll.grid .card .thumb { float: none; width: 100%; height: 80px; margin: 0 0 8px; }
mark { background: color-mix(in srgb, var(--accent) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { text-align: center; padding: 50px 20px; color: var(--text3); grid-column: 1 / -1; }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.empty b { display: block; color: var(--text2); font-size: 15px; margin-bottom: 4px; }
.bulk { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg3); font-size: 13px; }
.bulk span { flex: 1; }

/* Editor */
.ed { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg); position: relative; }
.ed-bar { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); min-height: 54px; }
.ed-bar .sp { flex: 1; }
.ed-status { font-size: 12px; color: var(--text3); margin: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg3); margin: 0 4px; }
.seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.fmt { display: flex; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.fmt::-webkit-scrollbar { display: none; }
.fmt .ib { width: 34px; height: 34px; }
.fmt .ib svg { width: 18px; height: 18px; }
.fmt .div { width: 1px; height: 20px; background: var(--line2); margin: 0 6px; flex: none; }
.ed-body { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; }
.ed-body.split { grid-template-columns: 1fr 1fr; }
.ed-body.split .preview { border-left: 1px solid var(--line); }
.ed-pane { overflow: auto; min-height: 0; }
.ed-inner { max-width: 820px; margin: 0 auto; padding: 28px 36px 120px; }
.ed-title { width: 100%; border: 0; background: transparent; outline: none; font-size: 30px; font-weight: 800; letter-spacing: -.01em; padding: 0; margin-bottom: 8px; resize: none; line-height: 1.25; overflow: hidden; }
.ed-title::placeholder { color: var(--text3); }
.ed-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 12.5px; color: var(--text3); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--bg3); border: 1px solid transparent; color: var(--text2); font-size: 12.5px; }
button.chip:hover { border-color: var(--line2); color: var(--text); }
.chip svg { width: 14px; height: 14px; }
.chip.tagc { color: var(--accent); background: var(--sel); }
.chip.tagc .x { border: 0; background: none; padding: 0; margin-left: 2px; color: inherit; opacity: .6; font-size: 14px; line-height: 1; }
.chip.warn { color: #f59e0b; }
.tag-add { border: 0; background: transparent; outline: none; width: 110px; height: 26px; font-size: 12.5px; color: var(--text2); }
.ed-text { width: 100%; min-height: 60vh; border: 0; outline: none; background: transparent; resize: none; font-size: var(--ed-size); line-height: 1.7; padding: 0; tab-size: 4; overflow: hidden; }
.ed-text.mono { font-family: var(--mono); font-size: calc(var(--ed-size) - 1px); }
.ed-text.serif { font-family: var(--serif); font-size: calc(var(--ed-size) + 1px); }
.ed-text::placeholder { color: var(--text3); }
.ed-foot { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding: 6px 16px calc(6px + var(--safe-b)); border-top: 1px solid var(--line); font-size: 12px; color: var(--text3); }
.ed-foot .who { margin-right: auto; }
.ed-none { flex: 1; display: grid; place-content: center; text-align: center; color: var(--text3); gap: 14px; padding: 30px; }
.ed-none img { width: 90px; height: 90px; margin: 0 auto; opacity: .9; border-radius: 24px; }
.ed-none h3 { margin: 0; color: var(--text); font-size: 20px; }
.ed-none .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ed-none .tips { display: grid; gap: 6px; font-size: 13px; }
.drop-hint { position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 18px; background: color-mix(in srgb, var(--bg) 80%, transparent); display: grid; place-items: center; font-size: 18px; font-weight: 700; z-index: 5; pointer-events: none; }
.locked-box { max-width: 420px; margin: 70px auto; text-align: center; display: grid; gap: 14px; padding: 30px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.locked-box .big { font-size: 46px; }
.readonly-bar { padding: 8px 16px; font-size: 13px; background: var(--sel); color: var(--text2); border-bottom: 1px solid var(--line); }

/* Markdown-Vorschau */
.md { font-size: var(--ed-size); line-height: 1.7; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.3; margin: 1.4em 0 .5em; }
.md h1 { font-size: 1.75em; } .md h2 { font-size: 1.4em; } .md h3 { font-size: 1.18em; }
.md h2 { padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.md p { margin: .7em 0; }
.md a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.md a.wiki { background: var(--sel); border: 0; padding: 0 4px; border-radius: 5px; }
.md a.wiki.missing { color: var(--text3); text-decoration: line-through; }
.md img, .md video { max-width: 100%; border-radius: 12px; display: block; margin: 10px 0; }
.md audio { width: 100%; margin: 6px 0; }
.md blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--accent); background: var(--bg3); border-radius: 0 10px 10px 0; color: var(--text2); }
.md code { font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--code); border: 1px solid var(--line); }
.md pre { background: var(--code); border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; overflow: auto; position: relative; }
.md pre code { padding: 0; border: 0; background: none; font-size: .85em; }
.md pre .copy { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; }
.md pre:hover .copy { opacity: 1; }
.md table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .94em; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line2); padding: 7px 12px; text-align: left; }
.md th { background: var(--bg3); }
.md hr { border: 0; height: 1px; background: var(--line2); margin: 2em 0; }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .2em 0; }
.md li.task { list-style: none; margin-left: -1.4em; display: flex; gap: 10px; align-items: flex-start; }
.md li.task input { width: 18px; height: 18px; margin-top: .3em; accent-color: var(--accent); flex: none; cursor: pointer; }
.md li.task.done > span { text-decoration: line-through; color: var(--text3); }
.md .file-card { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg3); text-decoration: none; color: var(--text); margin: 4px 0; }
.md .hashtag { color: var(--accent); background: var(--sel); padding: 0 5px; border-radius: 5px; font-size: .92em; cursor: pointer; }

/* Menüs, Dialoge */
.menu { position: fixed; z-index: 60; min-width: 220px; max-width: 320px; padding: 6px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: pop .14s ease-out; max-height: 70vh; overflow: auto; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: 14px; }
.menu button:hover, .menu button.act { background: var(--hover); }
.menu button svg { width: 17px; height: 17px; color: var(--text2); }
.menu button.dang { color: #fb7185; }
.menu button.dang svg { color: #fb7185; }
.menu button .r { margin-left: auto; color: var(--text3); font-size: 12px; }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 4px; }
.menu .colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px; }
.menu .colors button { height: 30px; padding: 0; border-radius: 50%; justify-content: center; background: var(--nc, var(--bg3)); border: 2px solid transparent; width: 30px; }
.menu .colors button.on { border-color: var(--text); }
.menu .mh { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); padding: 8px 10px 4px; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5, 6, 10, .55); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dlg { width: min(520px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; border-radius: 20px; background: var(--bg2); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: pop .18s cubic-bezier(.2, 1.2, .4, 1); overflow: hidden; }
.dlg.wide { width: min(860px, 100%); }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.dlg-h h3 { margin: 0; font-size: 19px; flex: 1; }
.dlg-b { padding: 4px 20px 20px; overflow: auto; }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.dlg p { color: var(--text2); margin: 0 0 14px; }
.set { display: grid; grid-template-columns: 200px 1fr; min-height: 480px; }
.set-nav { border-right: 1px solid var(--line); padding: 8px; display: grid; align-content: start; gap: 2px; }
.set-body { padding: 4px 22px 22px; overflow: auto; }
.set-body h4 { margin: 18px 0 10px; font-size: 15px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row > div { min-width: 0; }
.set-row b { display: block; font-size: 14px; }
.set-row small { color: var(--text3); font-size: 12.5px; }
.sw { position: relative; width: 44px; height: 26px; flex: none; }
.sw input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: var(--line2); transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(18px); }
.accents { display: flex; flex-wrap: wrap; gap: 8px; }
.accents button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.accents button.on { border-color: var(--text); }
.sess { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sess > div { flex: 1; min-width: 0; }
.sess small { color: var(--text3); display: block; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--sel); color: var(--accent); }
.qr { width: 190px; height: 190px; background: #fff; padding: 8px; border-radius: 12px; margin: 0 auto 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.code { font: 14px var(--mono); padding: 8px 12px; border-radius: 9px; background: var(--code); border: 1px solid var(--line); word-break: break-all; user-select: all; }
.ver { display: grid; grid-template-columns: 240px 1fr; gap: 0; height: 60vh; }
.ver-list { overflow: auto; border-right: 1px solid var(--line); padding-right: 8px; }
.ver-list button { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; }
.ver-list button:hover { background: var(--hover); }
.ver-list button.on { background: var(--sel); }
.ver-list small { display: block; color: var(--text3); font-size: 12px; }
.ver-view { overflow: auto; padding: 0 0 0 16px; }
.diff { font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.diff .add { background: rgba(34, 197, 94, .16); display: block; }
.diff .del { background: rgba(244, 63, 94, .16); display: block; text-decoration: line-through; opacity: .8; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.share-row > div { flex: 1; min-width: 0; }
.share-row > svg, .sess > svg { width: 20px; height: 20px; flex: none; color: var(--text2); }.share-row small { color: var(--text3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: flex; gap: 8px; }
.inline .inp { flex: 1; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-grid button { text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); display: grid; gap: 4px; }
.tpl-grid button:hover { border-color: var(--accent); }
.tpl-grid i { font-style: normal; font-size: 24px; }
.tpl-grid b { font-size: 14px; }
.tpl-grid small { color: var(--text3); font-size: 12px; }

/* Befehlspalette */
.pal { position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 10, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .12s; }
.pal-box { width: min(640px, 100%); border-radius: 18px; background: var(--bg2); border: 1px solid var(--line2); box-shadow: var(--shadow); overflow: hidden; animation: pop .14s; }
.pal-box .inp { height: 56px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 17px; padding: 0 20px; background: transparent; box-shadow: none; }
.pal-res { max-height: 50vh; overflow: auto; padding: 6px; }
.pal-res button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.pal-res button.act { background: var(--sel); }
.pal-res button svg { width: 18px; height: 18px; color: var(--text2); flex: none; }
.pal-res button div { flex: 1; min-width: 0; }
.pal-res button b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-res button small { display: block; color: var(--text3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-res .h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 10px 12px 4px; }

/* Toasts */
.toasts { position: fixed; bottom: calc(18px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; border-radius: 13px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: fadeUp .2s; max-width: min(520px, 92vw); }
.toast button { border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 4px 6px; border-radius: 6px; }
.toast.err { background: #e11d48; color: #fff; }
.toast.err button { color: #fff; }
.offline-bar { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 50; padding: 6px 14px; border-radius: 99px; background: #b45309; color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }

.m-back, .m-only { display: none; }
.fab { display: none; }

/* ---------------------------------------------------------------- Tablet */
@media (max-width: 1180px) {
  :root { --side-w: 230px; --list-w: 300px; }
  .ed-inner { padding: 24px 26px 120px; }
  .ed-body.split { grid-template-columns: 1fr; }
  .ed-body.split .preview { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: var(--list-w) minmax(0, 1fr); }
  .app .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow); padding-top: var(--safe-t); }
  .app.side-open .side { transform: none; visibility: visible; }
  .app.no-side { grid-template-columns: var(--list-w) minmax(0, 1fr); }
  .app.no-side .side { visibility: visible; }
  .side-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .45); }
  .m-only { display: inline-grid; }
  .hide-narrow { display: none; }
}
/* ---------------------------------------------------------------- Handy */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: calc(28px + var(--safe-t)) 22px 26px; border-right: 0; border-bottom: 1px solid var(--line); gap: 16px; }
  .auth-hero p { font-size: 15px; }
  .hero-feats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-feat { padding: 10px; gap: 8px; }
  .hero-feat span { display: none; }
  .auth-box { padding: 26px 20px calc(30px + var(--safe-b)); place-items: start center; }
  .app, .app.no-side, .app.focus { grid-template-columns: 100% !important; }
  .app .list, .app .ed { grid-row: 1; grid-column: 1; }
  .app.m-ed .list { visibility: hidden; }
  .app:not(.m-ed) .ed { display: none; }
  .m-back { display: inline-grid; }
  .ed-bar .hide-m { display: none; }
  .ed-inner { padding: 18px 18px 140px; }
  .ed-title { font-size: 24px; }
  .fmt { padding: 4px 6px; }
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(20px + var(--safe-b)); width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--grad); color: #fff; box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); z-index: 20; }
  .fab svg { width: 26px; height: 26px; }
  .app.m-ed .fab { display: none; }
  .list-scroll { padding-bottom: 100px; }
  .card { padding: 13px 14px 13px 16px; }
  .set { grid-template-columns: 1fr; }
  .set-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .set-nav .nav { width: auto; flex: none; }
  .set-nav .nav.on::before { display: none; }
  .scrim { padding: 0; align-items: end; }
  .dlg, .dlg.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); }
  .ver { grid-template-columns: 1fr; height: auto; }
  .ver-list { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ver-view { padding: 12px 0 0; }
  .pal { padding-top: calc(var(--safe-t) + 12px); }
  .search .kbd { display: none; }
  .ed-foot { display: none; }
}
@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .side, .list, .ed-bar, .fmt, .ed-foot, .toasts, .fab, .ed-chips, .readonly-bar { display: none !important; }
  .app { position: static; display: block; }
  .ed, .ed-body, .ed-pane { overflow: visible; display: block; }
  .ed-body > .ed-pane:not(.preview) { display: none !important; }
  .ed-body .preview { display: block !important; }
  .ed-inner { max-width: none; padding: 0; }
}
