:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel2: #fafbfc;
  --line: #e4e7ec;
  --line2: #eef0f3;
  --text: #1a1d23;
  --muted: #697586;
  --accent: #6c5ce7;
  --accent-soft: #efedfd;
  --accent-ink: #ffffff;
  --teal: #0bb8a0;
  --ok: #16a34a;
  --warn: #b45309;
  --warn-soft: #fdf3e7;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- buttons ---------- */
.btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--panel2); border-color: #d3d8e0; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #5d4ce0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn.warnbtn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: -.2px; font-size: 15px; }
.brand span { color: var(--accent); }
.brand em { color: var(--muted); font-style: normal; font-weight: 500; font-size: 11px; margin-left: 8px;
  border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; }
.topactions { display: flex; align-items: center; gap: 8px; }
.who { font-size: 13px; color: var(--muted); margin-right: 4px; }
.who b { color: var(--text); font-weight: 600; }
.pubbadge { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--warn); color: var(--warn); background: var(--warn-soft); }
.pubbadge.armed { border-color: var(--ok); color: var(--ok); background: #eafaf0; }
.pubbadge:empty { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 57px); }
.sidebar { border-right: 1px solid var(--line); background: var(--panel); padding: 14px; display: flex; flex-direction: column; min-height: 0; }
/* Sidebar is navigation only; concrete document lists live in the main pane. */
.sidebar .navlabel, .colswitch, .settingsnav { flex-shrink: 0; }
.navlabel.settings-label { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line2); }

.colswitch { display: flex; flex-wrap: wrap; gap: 3px; background: var(--panel2); border: 1px solid var(--line); padding: 3px; border-radius: 9px; margin-bottom: 12px; }
.colswitch button { flex: 1 1 auto; white-space: nowrap; background: none; border: 0; color: var(--muted); padding: 7px 6px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 500; }
.colswitch button:hover { color: var(--text); }
.colswitch button.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }

.filter { width: 100%; padding: 9px 11px; margin-bottom: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; }
.filter:focus { outline: none; border-color: var(--accent); background: var(--panel); }

.navlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin: 4px 2px 8px; }
.settingsnav { display: flex; flex-direction: column; gap: 2px; }
.settingsnav button { text-align: left; background: none; border: 0; color: var(--text); padding: 8px 11px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; }
.settingsnav button:hover { background: var(--panel2); }
.settingsnav button.active { background: var(--accent-soft); color: var(--accent); }

.reflist { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; overflow-y: auto; min-height: 60px; }
.reflist li { padding: 9px 11px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.reflist li:hover { background: var(--panel2); }
.reflist li.active { background: var(--accent-soft); }
.reflist li.active .rname { color: var(--accent); }
.reflist .rname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reflist .badges { display: flex; gap: 4px; flex-shrink: 0; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.badge.de, .badge.en { color: var(--text); background: var(--panel2); }
.badge.missing { opacity: .3; }

/* ---------- editor ---------- */
.editor { overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.empty { display: grid; place-items: center; height: 100%; color: var(--muted); }
#editorBody { display: flex; flex-direction: column; height: 100%; }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.editor-head h1 { font-size: 17px; margin: 0; letter-spacing: -.2px; }
.tabs { display: flex; gap: 3px; background: var(--panel2); border: 1px solid var(--line); padding: 3px; border-radius: 8px; }
.tab { background: none; border: 0; color: var(--muted); padding: 6px 16px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 500; }
.tab.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }

.panes { display: grid; grid-template-columns: 1fr 320px; gap: 0; flex: 1; min-height: 0; }
.form-pane { overflow-y: auto; padding: 20px 22px; }
.side-pane { overflow-y: auto; padding: 18px; background: var(--panel); border-left: 1px solid var(--line); }

.fm { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-bottom: 8px; }
.field { display: block; margin-bottom: 14px; }
.field.col-full { grid-column: 1 / -1; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.upload-guide {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.upload-guide b { color: var(--text); font-weight: 600; }
.upload-guide span { color: var(--muted); }
.upload-guide code {
  font-size: 11.5px;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-all;
}
.fm input, .fm select, .fm textarea, .body, .newform input, .newform select, .login-card input {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit;
}
.fm input:focus, .fm select:focus, .fm textarea:focus, .body:focus, .newform input:focus, .login-card input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.fm textarea { resize: vertical; }
.fm .check { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.fm .check input { width: auto; width: 16px; height: 16px; accent-color: var(--accent); }
.fm .check .lbl { margin: 0; }
.locked input { background: var(--panel2); color: var(--muted); }
.imgrow { display: flex; gap: 6px; }
.imgrow input { flex: 1; }
.thumb { margin-top: 6px; }
.thumb img { max-height: 60px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line2); }
.savestate { font-size: 12px; color: var(--muted); }

.banner { padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.banner.warn { background: var(--warn-soft); border: 1px solid #f0d9bd; color: var(--warn); }
.banner.info { background: var(--accent-soft); border: 1px solid #cbd7ff; color: var(--text); }

/* ---------- rich text editor ---------- */
.bodyhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bodyhead .lbl { margin: 0; }
.rtmode { display: flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line); padding: 2px; border-radius: 7px; }
.rtmode .seg { background: none; border: 0; color: var(--muted); padding: 4px 11px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 500; }
.rtmode .seg.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }

.rt-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; background: var(--panel2); border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; }
.rt-toolbar button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 13px; }
.rt-toolbar button:hover { background: var(--panel); border-color: var(--line); }
.rt-toolbar .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rt-editor {
  min-height: 320px; max-height: 56vh; overflow-y: auto; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 0 0 9px 9px;
}
.rt-editor:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.rt-editor:empty::before { content: "Inhalt schreiben…"; color: var(--muted); }
.body { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.6; border-radius: 9px; }

/* prose (editor + previews) */
.prose { color: #1f2329; }
.prose h2 { font-size: 19px; margin: 16px 0 7px; font-weight: 650; }
.prose h3 { font-size: 16px; margin: 14px 0 6px; font-weight: 600; }
.prose p { margin: 9px 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 9px 0; }
.prose li { margin: 3px 0; }
.prose img { max-width: 100%; border-radius: 6px; }
.prose figure { margin: 12px 0; }
.prose a { color: var(--accent); }
.prose table { border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 5px 9px; }

/* ---------- lint / copy-check ---------- */
.side-pane h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.lintbody { display: flex; flex-direction: column; gap: 7px; }
.issue { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; border-left: 3px solid var(--line); background: var(--panel2); }
.issue.error { border-left-color: var(--err); background: var(--err-soft); }
.issue.warning { border-left-color: var(--warn); background: var(--warn-soft); }
.issue.fix { border-left-color: var(--ok); background: #eafaf0; }
.issue .ctx { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; margin-top: 4px; word-break: break-word; }
.issue .tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; opacity: .7; }
.lint.ok h3 { color: var(--ok); }

.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); color: var(--err); }

/* ---------- settings views ---------- */
.settings-body { overflow-y: auto; padding: 20px 24px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.settings-head h1 { font-size: 18px; margin: 0; }
.priceform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; max-width: 720px; margin-top: 14px; }
.priceform input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font: inherit; }
.priceform input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.faq-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.faq-item .faq-row { display: flex; gap: 10px; align-items: start; }
.faq-item input, .faq-item textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: var(--panel); }
.faq-item textarea { resize: vertical; min-height: 56px; }
.faq-item .faq-cat { max-width: 240px; }
.faq-item .faq-del { color: var(--err); border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; }

.msg-tools { display: flex; gap: 10px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.msg-table { display: flex; flex-direction: column; gap: 2px; }
.msg-group { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; margin: 14px 0 4px; }
.msg-row { display: grid; grid-template-columns: 230px 1fr 1fr; gap: 8px; align-items: center; padding: 3px 0; }
.msg-row .mk { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: var(--panel); }
.msg-row input:focus { outline: none; border-color: var(--accent); }
.msg-row input.changed { border-color: var(--accent); background: var(--accent-soft); }
.msg-row .ro { color: var(--muted); font-style: italic; font-size: 12px; }
.lochead { display: flex; gap: 8px; font-size: 11px; color: var(--muted); padding: 0 0 0 238px; }
.lochead span { flex: 1; }

.legal-list { display: flex; gap: 8px; margin: 12px 0; }
.legal-list button { padding: 8px 16px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; font: inherit; }
.legal-list button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- dialogs ---------- */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(460px, 92vw); box-shadow: 0 20px 60px rgba(16,24,40,.2); }
dialog::backdrop { background: rgba(16, 24, 40, .35); backdrop-filter: blur(2px); }
.newform h2 { margin: 0 0 16px; font-size: 18px; }
.pubdialog { width: min(820px, 94vw); }
.pubhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pubhead h2 { margin: 0; font-size: 16px; }
.pubactions { display: flex; align-items: center; gap: 8px; }
#pubOpen { text-decoration: none; color: var(--accent); border-color: var(--accent); }
#pubOpen[hidden] { display: none; }
.publog { background: #0e1116; color: #d7e0ea; border-radius: 10px; padding: 14px; height: 54vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500; font-size: 13px; }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

/* ---------- presentation slide editor ---------- */
.slide-editor { margin-top: 6px; }
.slide-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.slide-list { display: flex; flex-direction: column; gap: 12px; }
.slide-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel2); padding: 12px; }
.slide-card-head { display: flex; align-items: center; gap: 10px; }
.slide-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.slide-layout { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px; }
.slide-ctrls { display: flex; gap: 4px; }
.slide-ctrls button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; }
.slide-ctrls button:hover { background: var(--panel2); border-color: #d3d8e0; }
.slide-ctrls button.danger { color: var(--err); }
.slide-html { width: 100%; margin-top: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.ref-picker { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin-top: 6px; }
.ref-pick { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #f4f5f7, #ecebfb); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; width: min(380px, 92vw); box-shadow: 0 20px 60px rgba(16,24,40,.12); }
.login-brand { font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.login-brand span { color: var(--accent); }
.login-sub { color: var(--muted); margin: 4px 0 22px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { margin-top: 6px; }
.login-err { color: var(--err); font-size: 13px; min-height: 18px; margin: 12px 0 0; }

/* ---------- Konto & Benutzer ---------- */
.settingsnav .medialink { display: block; text-decoration: none; color: var(--accent); padding: 8px 11px; border-radius: 8px; font-weight: 500; }
.settingsnav .medialink:hover { background: var(--panel2); }
.userform { display: grid; gap: 12px; max-width: 460px; margin-top: 14px; }
.userform.inline { grid-template-columns: 1fr; }
.userform .field { margin: 0; }
.userform input, .userform select { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font: inherit; box-sizing: border-box; }
.userform input:focus, .userform select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.subhead { font-size: 15px; margin: 26px 0 2px; }
.usertable { width: 100%; border-collapse: collapse; margin-top: 12px; max-width: 720px; }
.usertable th, .usertable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.usertable th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.usertable select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font: inherit; }
.usertable .useractions { display: flex; gap: 6px; white-space: nowrap; }
.usertable .btn.danger { color: var(--err); }

/* Anfragen / Posteingang */
.sub-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; max-width: 820px; }
.sub-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 13px 15px; box-shadow: var(--shadow); }
.sub-card.unread { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.sub-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sub-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); }
.sub-who { font-size: 14px; margin-bottom: 4px; }
.sub-who a { color: var(--accent); text-decoration: none; }
.sub-who a:hover { text-decoration: underline; }
.sub-meta { margin-bottom: 6px; word-break: break-word; }
.sub-msg { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin: 6px 0 10px; }
.sub-actions { display: flex; gap: 8px; }

/* ---------- 2026 admin refresh ---------- */
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel2: #f7f9fc;
  --panel3: #edf6f4;
  --line: #dbe2ea;
  --line2: #edf0f5;
  --text: #17202c;
  --muted: #647286;
  --accent: #2854c5;
  --accent-soft: #eaf0ff;
  --accent-ink: #ffffff;
  --teal: #0f766e;
  --teal-soft: #e6f7f3;
  --ok: #14804a;
  --ok-soft: #e7f7ee;
  --warn: #a85f00;
  --warn-soft: #fff4df;
  --err: #c82020;
  --err-soft: #ffecec;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .06);
}

body {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0) 260px),
    var(--bg);
  color: var(--text);
}

.topbar {
  min-height: 64px;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.brand { display: flex; align-items: baseline; gap: 8px; font-size: 16px; letter-spacing: 0; }
.brand strong { font-weight: 800; }
.brand span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.topactions { flex-wrap: wrap; justify-content: flex-end; }
.who {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  min-height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: #2148aa; }
.btn.warnbtn { background: var(--warn); border-color: var(--warn); }
.btn.small { min-height: 30px; }
.btn.block { display: flex; }

.layout {
  grid-template-columns: 304px minmax(0, 1fr);
  height: calc(100vh - 65px);
}
.sidebar {
  padding: 16px 14px;
  gap: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
}
.navlabel {
  margin: 6px 4px 8px;
  color: #7a8798;
  letter-spacing: .08em;
}
.settingsnav { gap: 4px; }
.settingsnav button,
.settingsnav .medialink {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #273242;
}
.settingsnav button .pubbadge { margin-left: auto; }
.settingsnav button:hover,
.settingsnav .medialink:hover {
  background: #f1f5f9;
}
.settingsnav button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c8d2df;
  flex: 0 0 auto;
}
.settingsnav button.active .nav-dot { background: var(--accent); }

.colswitch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.colswitch button {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #273242;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.colswitch button:hover { background: #f1f5f9; }
.colswitch button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.colswitch button.active .nav-dot {
  background: var(--accent);
}
.filter {
  min-height: 38px;
  margin-bottom: 6px;
  background: #fff;
}
.listmeta {
  min-height: 18px;
  margin: 0 2px 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.reflist { padding-right: 2px; }
.reflist li {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.reflist li:hover { border-color: var(--line2); background: #f8fafc; }
.reflist li.active { border-color: #cbd8ff; background: var(--accent-soft); }
.badge { border-radius: 6px; }
.pubbadge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0;
}

.editor { background: transparent; }
.empty {
  padding: 40px;
  text-align: center;
}
.empty h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0;
}
.empty p { margin: 0; }
#editorBody,
.settings-body {
  min-width: 0;
}
.editor-head {
  min-height: 64px;
  padding: 16px 24px;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
  gap: 14px;
}
.editor-head h1,
.settings-head h1 {
  font-size: 20px;
  letter-spacing: 0;
}
.editor-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.editor-title h1 {
  min-width: 0;
}
.editor-tools {
  margin-left: auto;
}
.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.preview-actions a {
  text-decoration: none;
}
.panes { grid-template-columns: minmax(0, 1fr) 336px; }
.form-pane { padding: 24px; }
.side-pane { background: rgba(255,255,255,.92); }
.fm input,
.fm select,
.fm textarea,
.body,
.newform input,
.newform select,
.login-card input,
.priceform input,
.faq-item input,
.faq-item textarea,
.msg-row input,
.userform input,
.userform select {
  min-height: 38px;
  border-radius: 8px;
}
.field { margin-bottom: 16px; }
.lbl { color: #5c6878; }
.rt-toolbar,
.rtmode,
.tabs,
.legal-list button,
.faq-item,
.slide-card,
.sub-card {
  border-radius: 8px;
}
.rt-editor,
.body {
  min-height: 380px;
}
.actions { flex-wrap: wrap; }

.settings-body {
  padding: 24px;
}
.settings-head {
  min-height: 44px;
  gap: 14px;
}
.priceform,
.userform,
.sub-list,
.usertable {
  max-width: none;
}
.usertable {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.usertable th,
.usertable td { padding: 11px 12px; }
.usertable tr:last-child td { border-bottom: 0; }
.sub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.sub-card.unread {
  background: linear-gradient(90deg, var(--accent-soft), #fff 45%);
}

/* Dashboard */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 55%, #eefaf7 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.dash-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}
.dash-head p { margin: 6px 0 0; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-dot span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa8ba;
}
.status-dot.ok span { background: var(--ok); }
.status-dot.warn span { background: var(--warn); }
.status-dot b { font-size: 12px; }
.status-dot em {
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-grid,
.collection-grid,
.task-grid,
.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric-card,
.collection-card,
.task-card,
.system-card,
.docs-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric-card {
  min-height: 118px;
  padding: 16px;
  border-top: 3px solid #9aa8ba;
}
.metric-card.hot { border-top-color: var(--err); background: linear-gradient(180deg, #fff, var(--err-soft)); }
.metric-card.warn { border-top-color: var(--warn); background: linear-gradient(180deg, #fff, var(--warn-soft)); }
.metric-card.ok { border-top-color: var(--ok); background: linear-gradient(180deg, #fff, var(--ok-soft)); }
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric-value {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}
.metric-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}
.task-card {
  min-height: 132px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-left: 3px solid #9aa8ba;
}
.task-card.hot { border-left-color: var(--err); }
.task-card.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.task-card.quiet { border-left-color: var(--teal); }
.task-card h2,
.collection-card h2,
.system-card h3,
.docs-preview h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}
.task-card p,
.system-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.collection-card {
  min-height: 142px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.collection-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.collection-card-head span {
  min-width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.collection-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
}
.collection-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.docs-preview {
  padding: 14px;
}
.docs-preview h3 { margin-bottom: 10px; }
.docs-preview button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line2);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.docs-preview button:hover { color: var(--accent); }
.docs-preview button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-preview button em {
  color: var(--muted);
  font-style: normal;
  font-size: 11.5px;
}
.system-card {
  min-height: 128px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.system-card .btn { margin-top: auto; }
.system-card a { text-decoration: none; color: var(--text); }

/* Content collection pages */
.collection-view,
.settings-home {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.collection-head .actions {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.collection-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.collection-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.collection-tools .filter {
  max-width: 420px;
  margin: 0;
}
.collection-tools .listmeta {
  margin: 0;
  min-height: auto;
  white-space: nowrap;
}
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.doc-row:hover {
  border-color: #c9d5e6;
  background: #fbfdff;
}
.doc-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-main strong,
.doc-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-main span {
  color: var(--muted);
  font-size: 12px;
}
.doc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.doc-actions a {
  text-decoration: none;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.settings-card {
  min-height: 150px;
}

/* Notifications */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notification-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 15px;
}
.notification-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line2);
}
.notification-item-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}
.notification-item-head p { margin: 4px 0 0; }
.notification-head-actions,
.notification-checks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notification-toggle {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.notification-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}
.notification-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.notification-grid .col-span-2 {
  grid-column: span 2;
}
.notification-locales {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.notification-locale {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  padding: 12px;
}
.notification-locale h3 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.notification-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.notification-item input:not([type="checkbox"]),
.notification-item select,
.notification-item textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.notification-item textarea {
  resize: vertical;
  min-height: 82px;
}
.notification-item input:not([type="checkbox"]):focus,
.notification-item select:focus,
.notification-item textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-body {
  background:
    radial-gradient(circle at top left, rgba(15,118,110,.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(40,84,197,.14), transparent 32rem),
    var(--bg);
}
.login-card {
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-brand span { color: var(--teal); }

@media (max-width: 1180px) {
  .metric-grid,
  .collection-grid,
  .task-grid,
  .system-grid,
  .settings-grid,
  .collection-metrics,
  .notification-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notification-locales { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panes { grid-template-columns: 1fr; }
  .side-pane { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  .topactions { justify-content: flex-start; }
  .layout { display: block; height: auto; min-height: calc(100vh - 65px); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 62vh; overflow-y: auto; }
  .dash-head,
  .settings-head,
  .editor-head { flex-direction: column; align-items: stretch; }
  .editor-tools { margin-left: 0; }
  .dash-actions { justify-content: flex-start; }
  .metric-grid,
  .collection-grid,
  .task-grid,
  .system-grid,
  .settings-grid,
  .collection-metrics,
  .status-strip,
  .dash-split,
  .notification-grid,
  .fm,
  .priceform { grid-template-columns: 1fr; }
  .collection-tools { align-items: stretch; flex-direction: column; }
  .collection-tools .filter { max-width: none; }
  .doc-row { grid-template-columns: 1fr; align-items: stretch; }
  .doc-row .badges { justify-content: flex-start; }
  .doc-actions { justify-content: flex-start; }
  .notification-cta-grid { grid-template-columns: 1fr; }
  .notification-item-head { flex-direction: column; align-items: stretch; }
  .notification-grid .col-span-2 { grid-column: auto; }
  .settings-body,
  .form-pane { padding: 16px; }
  .sub-list { grid-template-columns: 1fr; }
  .msg-row { grid-template-columns: 1fr; }
  .lochead { display: none; }
  .usertable { display: block; overflow-x: auto; }
}

/* ---------- toggles: generic boolean switch ---------- */
.fm .check.toggle { cursor: pointer; user-select: none; }
.fm .check.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch {
  flex: 0 0 auto;
  position: relative;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .16s ease;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.25);
  transition: transform .16s ease;
}
.check.toggle input:checked + .switch { background: var(--accent); }
.check.toggle input:checked + .switch .switch-thumb { transform: translateX(18px); }
.check.toggle input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Sichtbarkeit: Live/Offline status toggle ---------- */
.statusField {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, background .18s ease;
}
.statusField.is-live {
  border-color: #bfe6d3;
  background: linear-gradient(180deg, #fff, var(--ok-soft));
}
.statusToggle { display: flex; align-items: center; gap: 14px; cursor: pointer; user-select: none; margin: 0; }
.statusToggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.statusToggle-switch {
  flex: 0 0 auto;
  position: relative;
  width: 52px; height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.statusToggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.3);
  transition: transform .18s ease;
}
.statusToggle input:checked + .statusToggle-switch { background: var(--ok); }
.statusToggle input:checked + .statusToggle-switch .statusToggle-thumb { transform: translateX(24px); }
.statusToggle input:focus-visible + .statusToggle-switch { box-shadow: 0 0 0 3px var(--accent-soft); }
.statusField-labels { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.statusField-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.statusToggle-text { font-weight: 800; font-size: 16px; color: var(--muted); }
.statusField.is-live .statusToggle-text { color: var(--ok); }
.statusToggle-sub { font-size: 12px; color: var(--muted); }
.statusField-hint { margin-top: 12px; margin-bottom: 0; }

/* ---------- list: Live/Offline badge + quick toggle ---------- */
.badge.status { font-weight: 700; }
.badge.status.live { color: var(--ok); border-color: #bfe6d3; background: var(--ok-soft); }
.badge.status.offline { color: var(--warn); border-color: #f0d9bd; background: var(--warn-soft); }
.badge.status.mixed { color: var(--warn); border-color: #f0d9bd; background: var(--warn-soft); }
.statusBtn { font-weight: 600; }
.statusBtn.go-live { color: var(--ok); border-color: #bfe6d3; }
.statusBtn.go-live:hover { background: var(--ok-soft); color: var(--ok); }
.statusBtn.go-offline { color: var(--warn); border-color: #f0d9bd; }
.statusBtn.go-offline:hover { background: var(--warn-soft); color: var(--warn); }
.statusBtn:disabled { opacity: .6; }

/* ---------- Linktree-Statistik ---------- */
.lt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lt-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lt-filters select { padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font: inherit; color: var(--text); }
.lt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.lt-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lt-kpi b { font-size: 26px; font-variant-numeric: tabular-nums; }
.lt-chart { padding: 14px 16px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.lt-chart svg { width: 100%; height: 160px; display: block; }
.lt-chart rect.lt-v, .lt-key.lt-v { fill: var(--accent-soft); background: var(--accent-soft); }
.lt-chart rect.lt-c, .lt-key.lt-c { fill: var(--accent); background: var(--accent); }
.lt-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.lt-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.lt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 22px; }
.lt-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lt-bars li { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.lt-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-bar { height: 8px; background: var(--line2); border-radius: 999px; overflow: hidden; }
.lt-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lt-bar-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-scroll { overflow-x: auto; }
.lt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
