:root {
  --bg-0: #0d0f13;
  --bg-1: #12151b;
  --bg-2: #181c23;
  --bg-3: #20252e;
  --bg-4: #292f3a;
  --line: #303743;
  --line-soft: #252b34;
  --text: #f3f4f6;
  --text-2: #c4c9d2;
  --muted: #8f98a7;
  --accent: #21f36a;
  --accent-2: #8dffae;
  --accent-soft: rgba(33, 243, 106, .14);
  --green: #37c987;
  --red: #f05a65;
  --blue: #66a6ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg-0); color: var(--text); }
button, input, textarea { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field span { font-size: 12px; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  color: var(--text); background: var(--bg-1); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { min-height: 22px; color: #ff7d86 !important; margin: 12px 0 0 !important; font-size: 13px; }

.primary-button, .secondary-button, .link-button, .text-icon-button {
  border: 0; cursor: pointer; transition: .16s ease;
}
.primary-button {
  padding: 11px 16px; border-radius: 10px; background: var(--accent); color: #141619; font-weight: 800;
}
.primary-button:hover { background: var(--accent-2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary-button.wide { width: 100%; padding-block: 13px; }
.primary-button.compact { padding: 8px 12px; font-size: 13px; }
.secondary-button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2); font-weight: 700;
}
.secondary-button:hover { border-color: #46505f; color: var(--text); }
.link-button { width: 100%; background: none; color: var(--accent-2); margin-top: 16px; }
.link-button:hover { text-decoration: underline; }
.text-icon-button { background: none; color: var(--muted); padding: 8px; }
.text-icon-button:hover { color: var(--text); }

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 72px 250px minmax(0, 1fr) 240px;
  background: var(--bg-1);
}
.server-rail {
  background: #0b0d11;
  border-right: 1px solid #191d24;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}
.rail-divider { width: 34px; height: 1px; background: var(--line); margin: 2px 0; }
.rail-spacer { flex: 1; }
.nav-button {
  width: 46px; height: 46px; border: 0; border-radius: 16px; display: grid; place-items: center;
  background: var(--bg-2); color: var(--muted); cursor: pointer; transition: .18s ease;
}
.nav-button:hover, .nav-button.active { background: var(--accent); color: #15171b; border-radius: 13px; }
.nav-button.server-logo {
  font-size: 19px;
  font-weight: 900;
  overflow: hidden;
  padding: 4px;
  background: #07110b;
  border: 1px solid rgba(99, 255, 55, .34);
}
.nav-button.server-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(89, 255, 37, .28));
}
.nav-button.server-logo:hover,
.nav-button.server-logo.active {
  background: #0a180d;
  border-color: rgba(117, 255, 67, .68);
  box-shadow: 0 0 20px rgba(71, 255, 47, .16);
  border-radius: 13px;
}
.nav-button.danger-hover:hover { background: var(--red); color: white; }

.channel-panel {
  position: relative;
  display: grid;
  grid-template-rows: 58px 1fr 56px;
  min-width: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
}
.workspace-header {
  display: flex; justify-content: space-between; align-items: center; padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--line-soft); box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.workspace-header strong { font-size: 14px; }
.workspace-header small { display: block; color: var(--muted); margin-top: 2px; }
.icon-button {
  width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-button:hover { background: var(--bg-3); color: var(--text); }
.context-sidebar { overflow-y: auto; padding: 14px 8px 18px; }
.sidebar-label { display: flex; justify-content: space-between; align-items: center; margin: 10px 8px 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.sidebar-item {
  width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; margin: 2px 0; cursor: pointer; text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,.045); color: var(--text-2); }
.sidebar-item.active { background: var(--bg-4); color: var(--text); }
.sidebar-item svg { width: 17px; height: 17px; }
.sidebar-item .item-meta { min-width: 0; flex: 1; }
.sidebar-item .item-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 600; }
.sidebar-item .item-meta small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sidebar-item .voice-count { font-size: 11px; color: var(--muted); }
.user-bar {
  display: flex; align-items: center; gap: 9px; padding: 8px;
  background: #101319; border-top: 1px solid var(--line-soft);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), #0b9f48); color: #15171b; font-weight: 900;
}
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 13px; cursor: pointer; }
.user-meta strong:hover { color: var(--accent-2); }
.user-meta span { color: var(--muted); font-size: 11px; margin-top: 2px; }

.main-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  background: var(--bg-1);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line-soft); background: rgba(18,21,27,.94); z-index: 5;
}
.topbar-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-title > div { min-width: 0; }
.topbar-title strong, .topbar-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title strong { font-size: 15px; }
.topbar-title small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-icon { color: var(--muted); font-size: 24px; line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search-box, .vault-search {
  display: flex; align-items: center; gap: 7px; background: #0d1015; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 9px;
}
.search-box svg, .vault-search svg { width: 16px; height: 16px; color: var(--muted); }
.search-box input, .vault-search input { border: 0; outline: 0; background: transparent; color: var(--text); min-width: 180px; }
.view { display: none; min-height: 0; min-width: 0; position: relative; }
.view.active-view { display: block; }

#chatView.active-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.message-list { overflow-y: auto; padding: 22px 20px 12px; scroll-behavior: smooth; }
.channel-welcome { padding: 50px 12px 28px; max-width: 660px; }
.channel-welcome .welcome-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); font-size: 34px; font-weight: 800; }
.channel-welcome h2 { font-size: 31px; margin: 16px 0 8px; letter-spacing: -.03em; }
.channel-welcome p { margin: 0; color: var(--muted); line-height: 1.55; }
.message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 8px 10px; border-radius: 8px; }
.message:hover { background: rgba(255,255,255,.025); }
.message .avatar { width: 40px; height: 40px; margin-top: 1px; }
.message-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.message-head strong { font-size: 14px; }
.message-head time { color: var(--muted); font-size: 11px; }
.role-badge { font-size: 9px; font-weight: 900; letter-spacing: .08em; color: #121419; background: var(--accent); border-radius: 4px; padding: 2px 4px; }
.message-body { color: #d8dce3; line-height: 1.48; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.message-composer { margin: 0 16px 16px; min-height: 48px; display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 12px; background: var(--bg-3); border: 1px solid transparent; }
.message-composer:focus-within { border-color: #3a424f; }
.message-composer textarea { flex: 1; resize: none; max-height: 150px; min-height: 28px; border: 0; outline: 0; color: var(--text); background: transparent; padding: 6px 2px; line-height: 1.45; }
.composer-button, .send-button { width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; flex: none; }
.composer-button { background: var(--bg-4); color: var(--muted); }
.send-button { background: var(--accent); color: #15171b; cursor: pointer; }
.send-button:hover { background: var(--accent-2); }

#voiceView.active-view { display: block; overflow-y: auto; }
.voice-stage { padding: 28px; display: grid; gap: 28px; }
.voice-hero {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--line-soft); border-radius: 18px; background:
    radial-gradient(circle at center, rgba(33,243,106,.12), transparent 33%), var(--bg-2);
}
.voice-pulse { width: 94px; height: 94px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--accent); position: relative; }
.voice-pulse.connected::before, .voice-pulse.connected::after { content: ""; position: absolute; inset: -12px; border: 1px solid rgba(33,243,106,.32); border-radius: 50%; animation: pulse 2.4s infinite; }
.voice-pulse.connected::after { inset: -24px; animation-delay: .5s; }
.voice-pulse svg { width: 38px; height: 38px; stroke-width: 1.5; }
.voice-hero h2 { margin: 22px 0 6px; font-size: 27px; }
.voice-hero p { margin: 0; color: var(--muted); }
.voice-controls { display: flex; gap: 12px; margin-top: 24px; }
.round-control { width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--text); cursor: pointer; }
.round-control:hover { transform: translateY(-2px); }
.round-control:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.round-control.hangup { background: var(--red); }
.round-control.muted { background: var(--red); color: white; }
.section-heading, .card-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h3, .card-heading h3 { margin: 3px 0 0; font-size: 18px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.count-pill { min-width: 28px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 8px; background: var(--bg-4); color: var(--text-2); font-size: 12px; }
.participant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.participant-card { padding: 18px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--bg-2); display: flex; align-items: center; gap: 12px; }
.participant-card .avatar { width: 46px; height: 46px; }
.participant-card strong { display: block; font-size: 14px; }
.participant-card small { color: var(--muted); }
.empty-card { border: 1px dashed var(--line); border-radius: 12px; padding: 22px; color: var(--muted); text-align: center; }

#knowledgeView.active-view { display: block; }
.knowledge-view { overflow: hidden; }
.vault-shell { height: 100%; display: grid; grid-template-columns: 210px minmax(0, 1fr) 220px; }
.vault-files, .backlinks-panel { background: var(--bg-2); overflow-y: auto; }
.vault-files { border-right: 1px solid var(--line-soft); }
.backlinks-panel { border-left: 1px solid var(--line-soft); }
.vault-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 8px; }
.vault-toolbar > div { display: flex; }
.vault-search { margin: 4px 10px 10px; padding: 7px; }
.vault-search input { min-width: 0; width: 100%; }
.note-list { padding: 2px 7px 14px; }
.note-list-item { width: 100%; border: 0; background: transparent; color: var(--muted); text-align: left; padding: 9px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.note-list-item:hover { background: rgba(255,255,255,.04); color: var(--text-2); }
.note-list-item.active { background: var(--bg-4); color: var(--text); }
.note-list-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.note-workspace { min-width: 0; display: grid; grid-template-rows: 46px minmax(0, 1fr); }
.note-tabs { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: var(--bg-1); padding: 0 10px 0 0; }
.note-tab { height: 100%; min-width: 180px; max-width: 45%; display: flex; align-items: center; padding: 0 14px; color: var(--muted); border-right: 1px solid var(--line-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-tab.active { color: var(--text); border-top: 2px solid var(--accent); }
.note-actions { display: flex; align-items: center; gap: 4px; }
.editor-split { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.editor-split.preview-hidden { grid-template-columns: 1fr; }
.editor-split.preview-hidden .note-preview { display: none; }
.note-editor { min-width: 0; width: 100%; height: 100%; resize: none; border: 0; outline: 0; padding: 34px 42px; background: var(--bg-1); color: #dce0e7; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; line-height: 1.75; border-right: 1px solid var(--line-soft); }
.note-editor:disabled { opacity: .6; }
.note-preview { overflow-y: auto; padding: 34px 42px; background: #15181e; }
.prose { line-height: 1.75; color: #d8dde5; }
.prose h1, .prose h2, .prose h3 { color: var(--text); line-height: 1.25; letter-spacing: -.02em; }
.prose h1 { font-size: 30px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.prose h2 { font-size: 23px; margin-top: 30px; }
.prose h3 { font-size: 18px; margin-top: 26px; }
.prose p { margin: 12px 0; }
.prose code { background: var(--bg-4); color: var(--accent-2); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: #0e1116; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; color: #d9e1ec; }
.prose ul { padding-left: 22px; }
.wiki-link { color: var(--accent-2); cursor: pointer; border-bottom: 1px dashed currentColor; }
.knowledge-welcome { display: grid; place-items: center; text-align: center; min-height: 100%; color: var(--muted); }
.knowledge-welcome h2 { margin: 12px 0 4px; }
.knowledge-icon { font-size: 46px; color: var(--accent); }
.panel-section { padding: 16px 14px; border-bottom: 1px solid var(--line-soft); }
.backlink-list { margin-top: 10px; }
.backlink-item { display: block; width: 100%; text-align: left; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); padding: 8px; cursor: pointer; }
.backlink-item:hover { background: var(--bg-4); }
.properties-list { margin: 10px 0 0; display: grid; gap: 9px; }
.properties-list div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 12px; }
.properties-list dt { color: var(--muted); }
.properties-list dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-overlay { position: absolute; inset: 0; z-index: 20; padding: 28px; background: rgba(8,10,13,.76); backdrop-filter: blur(8px); }
.graph-window { width: 100%; height: 100%; background: #101319; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: grid; grid-template-rows: 66px minmax(0,1fr); overflow: hidden; }
.graph-header { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.graph-header h3 { margin: 3px 0 0; }
#knowledgeGraph { width: 100%; height: 100%; display: block; }

#fivemView.active-view { display: block; overflow-y: auto; }
.fivem-dashboard { padding: 26px; }
.server-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px;
  border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, var(--bg-2), #1d222b);
}
.server-banner h2 { font-size: 27px; margin: 5px 0 8px; }
.server-status-line { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(143,152,167,.12); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(55,201,135,.14); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 4px rgba(240,90,101,.14); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.stat-card { padding: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--bg-2); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.stat-card strong { display: block; font-size: 24px; margin: 10px 0 4px; }
.stat-card small { font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; }
.dashboard-card { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--bg-2); padding: 18px; }
.server-player-list { margin-top: 14px; max-height: 420px; overflow-y: auto; }
.server-player { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; }
.server-player:hover { background: rgba(255,255,255,.035); }
.server-player strong, .server-player small { display: block; }
.server-player small { color: var(--muted); margin-top: 2px; }
.player-ping { color: var(--muted); font-size: 12px; }
.control-card > p { color: var(--muted); line-height: 1.55; font-size: 13px; }
.server-controls { display: grid; gap: 10px; margin-top: 18px; }
.control-button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px; border-radius: 11px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); cursor: pointer; text-align: left; }
.control-button:hover { transform: translateY(-1px); border-color: #485260; }
.control-button svg { width: 24px; height: 24px; }
.control-button span { display: block; }
.control-button strong, .control-button small { display: block; }
.control-button small { color: var(--muted); margin-top: 3px; }
.control-button.start svg { color: var(--green); }
.control-button.restart svg { color: var(--accent); }
.control-button.stop svg { color: var(--red); }
.control-button:disabled { opacity: .45; cursor: wait; transform: none; }
.control-result { margin-top: 15px; border-top: 1px solid var(--line-soft); padding-top: 12px; font-size: 12px; line-height: 1.45; }

.members-panel { background: var(--bg-2); border-left: 1px solid var(--line-soft); overflow-y: auto; padding: 14px 8px; }
.members-section { margin-bottom: 20px; }
.members-section > .eyebrow { display: block; margin: 0 8px 8px; }
.member { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); }
.member:hover { background: rgba(255,255,255,.035); }
.member.offline { opacity: .45; }
.member .avatar { width: 32px; height: 32px; font-size: 12px; position: relative; }
.member .avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg-2); }
.member.offline .avatar::after { background: var(--muted); }
.member-details { min-width: 0; }
.member-details strong, .member-details small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-details strong { font-size: 13px; }
.member-details small { color: var(--muted); font-size: 10px; margin-top: 2px; }

.toast-region { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--bg-2); box-shadow: var(--shadow); color: var(--text-2); animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(5,7,10,.74); backdrop-filter: blur(5px); }
.modal-card { width: min(430px, 100%); border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); box-shadow: var(--shadow); padding: 18px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

@keyframes pulse { 0% { transform: scale(.92); opacity: .7; } 75%,100% { transform: scale(1.18); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }


/* Ein-/ausklappbare Mitgliederleiste */
.app-shell {
  transition: grid-template-columns .22s ease;
}
.members-panel {
  width: 240px;
  min-width: 0;
  opacity: 1;
  transform: translateX(0);
  transition: width .22s ease, padding .22s ease, opacity .16s ease, transform .22s ease, border-color .22s ease;
}
.app-shell.members-collapsed {
  grid-template-columns: 72px 250px minmax(0, 1fr) 0;
}
.app-shell.members-collapsed .members-panel {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-left-color: transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(100%);
}
#toggleMembersButton.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 1180px) {
  .app-shell, .app-shell.members-collapsed { grid-template-columns: 64px 230px minmax(0,1fr); }
  .members-panel, .app-shell.members-collapsed .members-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 240px; padding: 14px 8px; z-index: 30;
    border-left: 1px solid var(--line-soft); box-shadow: -20px 0 45px rgba(0,0,0,.28);
    opacity: 1; overflow-y: auto; pointer-events: auto; transform: translateX(100%); transition: transform .2s ease;
  }
  .members-panel.open, .app-shell.members-collapsed .members-panel.open { transform: translateX(0); }
  .vault-shell { grid-template-columns: 190px minmax(0,1fr); }
  .backlinks-panel { display: none; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 58px minmax(0,1fr); }
  .channel-panel { position: fixed; left: 58px; top: 0; bottom: 0; width: 245px; z-index: 25; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 40px rgba(0,0,0,.28); }
  .channel-panel.open { transform: translateX(0); }
  .main-panel { grid-column: 2; }
  .topbar::before { content: "☰"; display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--muted); cursor: pointer; }
  .topbar-title { margin-right: auto; }
  .search-box { display: none; }
  .vault-shell { grid-template-columns: 1fr; }
  .vault-files { position: absolute; inset: 0 auto 0 0; width: 220px; z-index: 7; box-shadow: 16px 0 35px rgba(0,0,0,.25); }
  .note-workspace { margin-left: 0; }
  .editor-split { grid-template-columns: 1fr; }
  .note-preview { display: none; }
  .editor-split.preview-mode .note-editor { display: none; }
  .editor-split.preview-mode .note-preview { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .server-rail { padding-inline: 6px; }
  .nav-button { width: 42px; height: 42px; }
  .app-shell { grid-template-columns: 54px minmax(0,1fr); }
  .main-panel { grid-column: 2; }
  .channel-panel { left: 54px; }
  .topbar { padding-inline: 10px; }
  .topbar-title small { display: none; }
  .voice-stage, .fivem-dashboard { padding: 16px; }
  .server-banner { align-items: flex-start; flex-direction: column; }
  .message-list { padding-inline: 8px; }
  .message-composer { margin-inline: 8px; }
  .graph-overlay { padding: 10px; }
}

/* Direkter index.html-Start */
html[data-static-preview="true"] .workspace-header::after {
  content: "LOKALE VORSCHAU";
  position: absolute;
  top: 48px;
  left: 14px;
  padding: 3px 7px;
  border: 1px solid rgba(33, 243, 106, .35);
  border-radius: 999px;
  color: #f4b45e;
  background: rgba(33, 243, 106, .08);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  pointer-events: none;
}

html[data-static-preview="true"] .context-sidebar {
  padding-top: 24px;
}

/* Login-System */
.auth-screen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr);
  background:
    radial-gradient(circle at 18% 15%, rgba(33,243,106,.16), transparent 26%),
    radial-gradient(circle at 68% 84%, rgba(64,91,132,.18), transparent 29%),
    #0b0d11;
  overflow: hidden;
}
.auth-visual {
  position: relative;
  min-width: 0;
  padding: clamp(42px, 7vw, 98px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
  isolation: isolate;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 7% 6%;
  z-index: -3;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(31,36,45,.85), rgba(13,16,22,.72));
  box-shadow: 0 44px 100px rgba(0,0,0,.38);
  transform: rotate(-2deg);
}
.auth-visual::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: -110px;
  bottom: -180px;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33,243,106,.22), transparent 68%);
  filter: blur(3px);
}
.auth-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(33,243,106,.17);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-one { width: 460px; height: 460px; right: -170px; top: -170px; }
.orbit-two { width: 280px; height: 280px; right: -35px; top: -25px; border-color: rgba(102,166,255,.12); }
.auth-brand-mark {
  width: min(360px, 68%);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: visible;
}
.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 24px 42px rgba(48, 255, 40, .24));
}
.auth-brand-copy { max-width: 680px; margin-top: 30px; }
.auth-brand-copy > span {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
}
.auth-brand-copy h1 {
  max-width: 650px;
  margin: 13px 0 15px;
  font-size: clamp(34px, 4.3vw, 64px);
  line-height: 1.03;
  letter-spacing: -.055em;
}
.auth-brand-copy p {
  max-width: 590px;
  margin: 0;
  color: #aab2bf;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.65;
}
.auth-feature-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 720px;
  margin-top: 42px;
}
.auth-feature-stack > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(10,13,18,.55);
  backdrop-filter: blur(8px);
}
.auth-feature-stack b {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent-2);
  background: var(--accent-soft);
  font-size: 17px;
}
.auth-feature-stack span, .auth-feature-stack strong, .auth-feature-stack small { display: block; min-width: 0; }
.auth-feature-stack strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-feature-stack small { margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 72px);
  background: rgba(15,18,24,.78);
}
.auth-card { width: min(480px, 100%); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-mobile-brand span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(33,243,106,.35);
  border-radius: 12px;
  background: #07110b;
}
.auth-mobile-brand span img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
  display: block;
}
.auth-heading h2 { margin: 7px 0 8px; font-size: 31px; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-tabs {
  display: flex;
  gap: 5px;
  margin: 30px 0 22px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #0d1015;
}
.auth-tab {
  flex: 1 1 0;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  transition: .16s ease;
}
.auth-tab:hover { color: var(--text-2); }
.auth-tab.active { color: #13161a; background: var(--accent); box-shadow: 0 8px 22px rgba(33,243,106,.16); }
.auth-form { display: grid; gap: 15px; }
.auth-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-field { display: grid; gap: 8px; }
.auth-field > span {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 14px;
  color: var(--text);
  background: #11151b;
  outline: none;
  transition: .16s ease;
}
.auth-field input::placeholder { color: #687180; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #141920; }
.auth-submit {
  height: 50px;
  margin-top: 3px;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #111318;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 15px 34px rgba(33,243,106,.16);
  transition: .18s ease;
}
.auth-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.auth-submit:disabled { opacity: .55; cursor: wait; transform: none; }
.auth-submit svg { width: 18px; height: 18px; stroke-width: 2.2; }
.auth-message { min-height: 22px; margin-top: 14px; color: var(--red); font-size: 13px; line-height: 1.5; white-space: pre-line; }
.auth-message:not(:empty) { padding: 12px 14px; border: 1px solid rgba(255, 102, 122, .32); border-radius: 10px; background: rgba(255, 80, 103, .08); }
.auth-message.success { color: var(--green); }
.auth-hint {
  margin: 11px 0 0;
  padding: 12px 13px;
  border: 1px solid rgba(33,243,106,.17);
  border-radius: 10px;
  color: #aab2bf;
  background: rgba(33,243,106,.055);
  font-size: 11px;
  line-height: 1.5;
}
.user-meta > strong { cursor: default; }
.user-meta > strong:hover { color: inherit; }
.user-meta > span { display: flex; align-items: center; gap: 5px; }
.user-meta > span > span { display: inline; margin: 0; }
.user-role {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 4px;
  color: #111318;
  background: var(--accent);
  font-size: 8px;
  line-height: 1;
  letter-spacing: .05em;
}
.user-role.member { color: #d9e0e9; background: #323a46; }
.logout-button:hover { color: #ff7d86; background: rgba(240,90,101,.1); }

@media (max-width: 980px) {
  .auth-screen { grid-template-columns: 1fr; overflow-y: auto; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .auth-mobile-brand { display: flex; }
}

@media (max-width: 520px) {
  .auth-panel { padding: 24px 18px; align-items: start; padding-top: 44px; }
  .auth-field-grid { grid-template-columns: 1fr; }
  .auth-heading h2 { font-size: 27px; }
}

.auth-login-only { margin-top: 30px; }
.password-field { position: relative; }
.password-field input { padding-right: 50px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: rgba(255,255,255,.055); }
.password-toggle svg { width: 18px; height: 18px; }
body.auth-open .toast-region { z-index: 300; }

/* SQL / Team-Server Erweiterungen */
.form-note { margin: -3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.invite-preview {
  display: grid; gap: 5px; padding: 14px 15px; border: 1px solid rgba(33,243,106,.25);
  border-radius: 12px; background: rgba(33,243,106,.07);
}
.invite-preview strong { font-size: 18px; }
.invite-preview small { color: var(--muted); }

.team-view { overflow-y: auto; }
.team-dashboard { width: min(1320px, 100%); margin: 0 auto; padding: 26px; }
.team-banner p { margin: 8px 0 0; color: var(--muted); }
.team-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr); gap: 18px; margin-top: 18px; align-items: start; }
.team-admin-column { display: grid; gap: 18px; }
.team-member-list, .invite-list { display: grid; gap: 8px; }
.team-member-row, .invite-row {
  display: grid; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-soft);
  border-radius: 11px; background: rgba(255,255,255,.02);
}
.team-member-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
.team-member-row .avatar { width: 40px; height: 40px; }
.team-member-meta { min-width: 0; }
.team-member-meta strong, .team-member-meta small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-member-meta small { margin-top: 4px; color: var(--muted); }
.team-member-actions { display: flex; gap: 7px; }
.mini-button {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text-2);
  background: var(--bg-3); cursor: pointer; font-size: 11px; font-weight: 800;
}
.mini-button:hover { color: var(--text); border-color: #4b5666; }
.mini-button.danger:hover { color: #ff9098; border-color: rgba(240,90,101,.55); background: rgba(240,90,101,.08); }
.role-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.role-chip.admin { color: #17191d; background: var(--accent); }
.role-chip.member { color: var(--text-2); background: #303743; }
.role-chip.owner { color: #15171a; background: var(--accent-2); }

.settings-form { display: grid; gap: 13px; }
.settings-form .field { margin: 0; }
.settings-form select, .settings-form input, .created-invite input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  color: var(--text); background: var(--bg-1); outline: none;
}
.settings-form select:focus, .settings-form input:focus, .created-invite input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.check-field input { width: 17px; height: 17px; accent-color: var(--accent); }
.created-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.invite-list { margin-top: 15px; }
.invite-row { grid-template-columns: minmax(0,1fr) auto; }
.invite-row strong, .invite-row small { display: block; }
.invite-row small { margin-top: 4px; color: var(--muted); }
.invite-row.inactive { opacity: .5; }

@media (max-width: 1100px) {
  .team-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .team-dashboard { padding: 15px; }
  .settings-grid { grid-template-columns: 1fr; }
  .team-member-row { grid-template-columns: 38px minmax(0,1fr); }
  .team-member-actions { grid-column: 1 / -1; }
}


/* Dynamische Kanalverwaltung */
.sidebar-item-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 3px;
}
.sidebar-item-row .sidebar-item { min-width: 0; }
.channel-remove-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: transparent;
  background: transparent;
  cursor: pointer;
  transition: .15s ease;
}
.sidebar-item-row:hover .channel-remove-button,
.channel-remove-button:focus-visible { color: var(--muted); }
.channel-remove-button:hover { color: var(--red); background: rgba(240,90,101,.1); }
.channel-remove-button svg { width: 14px; height: 14px; }
.channel-empty-card {
  display: grid;
  gap: 7px;
  margin: 8px 7px;
  padding: 14px;
  border: 1px dashed rgba(33,243,106,.2);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(33,243,106,.035);
  text-align: left;
}
.channel-empty-card strong { color: var(--text-2); font-size: 13px; }
.channel-empty-card span { font-size: 11px; line-height: 1.45; }
.channel-empty-card .mini-button { justify-self: start; margin-top: 3px; }
.empty-channel-welcome .primary-button { margin-top: 22px; }
.message-composer textarea:disabled { cursor: not-allowed; opacity: .55; }
.send-button:disabled { cursor: not-allowed; opacity: .35; }
.field span small { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }

@media (max-width: 980px) {
  .auth-brand-mark { width: min(360px, 80%); }
}

/* Wissensgraph, scrollbare Inhaltsseiten und Benutzerkonto */
.app-shell,
.app-shell > *,
.main-panel,
.main-panel > .view {
  min-height: 0;
}

.main-panel {
  height: 100vh;
  overflow: hidden;
}

.view.active-view {
  height: 100%;
}

#fivemView.active-view,
#teamView.active-view,
#userView.active-view {
  display: block;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.fivem-dashboard,
.team-dashboard,
.user-dashboard {
  padding-bottom: 72px;
}

.user-meta > strong {
  cursor: pointer;
}
.user-meta > strong:hover {
  color: var(--accent-2);
}

.secondary-button.compact {
  padding: 8px 11px;
  font-size: 12px;
}
.secondary-button.compact svg {
  width: 16px;
  height: 16px;
}

.graph-overlay {
  padding: 20px;
  background: rgba(8, 10, 13, .86);
  backdrop-filter: blur(10px);
}
.graph-window {
  grid-template-rows: 70px minmax(0, 1fr);
  background: #101319;
}
.graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--line-soft);
}
.graph-header h3 {
  margin: 4px 0 0;
  font-size: 20px;
}
.graph-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.graph-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
}
.graph-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(33,243,106,.055), transparent 30%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    #101319;
  background-size: auto, 42px 42px, 42px 42px, auto;
}
#knowledgeGraph {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
}
#knowledgeGraph.is-interactive {
  cursor: pointer;
}
.graph-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.graph-note-panel {
  min-width: 0;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(26,30,38,.98), rgba(18,21,27,.98));
}
.graph-note-panel.is-empty {
  display: grid;
  align-items: center;
}
.graph-note-empty {
  text-align: center;
  color: var(--muted);
}
.graph-note-empty strong {
  display: block;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 16px;
}
.graph-note-empty p {
  margin: 8px auto 0;
  max-width: 250px;
  line-height: 1.55;
  font-size: 12px;
}
.graph-note-dot {
  width: 13px;
  height: 13px;
  display: inline-block;
  border-radius: 50%;
  background: #66758b;
  box-shadow: 0 0 0 6px rgba(102,117,139,.12);
}
.graph-note-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(33,243,106,.13), 0 0 20px rgba(33,243,106,.35);
}
.graph-note-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.graph-note-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.graph-note-title-row strong,
.graph-note-title-row small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.graph-note-title-row strong {
  font-size: 17px;
}
.graph-note-title-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.graph-note-preview {
  flex: 1;
  min-height: 180px;
  padding: 18px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.graph-note-preview h1 {
  margin-top: 0;
  font-size: 22px;
}
.graph-note-preview h2 {
  font-size: 18px;
}
.graph-note-preview p,
.graph-note-preview li {
  line-height: 1.6;
}
.graph-note-footer {
  position: sticky;
  bottom: -24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -4px -4px;
  padding: 16px 4px 4px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(18,21,27,0), #12151b 28%);
}
.graph-note-file {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.user-dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px;
}
.user-banner-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}
.user-banner-profile h2 {
  margin: 3px 0 2px;
}
.user-banner-profile p {
  margin: 0;
  color: var(--muted);
}
.user-page-avatar {
  width: 58px;
  height: 58px;
  font-size: 19px;
  box-shadow: 0 0 0 7px rgba(33,243,106,.08);
}
.user-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.user-settings-card {
  scroll-margin-top: 18px;
}
.settings-description {
  margin: 9px 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

@media (max-width: 980px) {
  .graph-body {
    grid-template-columns: minmax(0, 1fr) 285px;
  }
  .user-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .graph-overlay {
    padding: 8px;
  }
  .graph-window {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .graph-header {
    min-height: 68px;
    padding: 10px 10px 10px 14px;
  }
  .graph-header h3 {
    font-size: 16px;
  }
  #centerGraphButton {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .graph-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(300px, 1fr) minmax(180px, 42%);
  }
  .graph-note-panel {
    padding: 16px;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .user-dashboard {
    padding: 15px;
  }
}

/* Gemeinsame Chat-/Sprachkategorien und Sortierung mit rechter Maustaste */
.channel-sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 6px 0 0;
}
.channel-sidebar-label { margin-top: 6px; margin-bottom: 6px; }
.category-action-button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.category-action-button:hover { color: var(--text); background: rgba(255,255,255,.055); }
.category-action-button.danger:hover { color: var(--red); background: rgba(240,90,101,.1); }
.category-action-button svg { width: 14px; height: 14px; }
.channel-sort-hint {
  margin: 1px 8px 10px;
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  font-size: 10px;
  line-height: 1.35;
}
.channel-category { margin: 6px 0 13px; border-radius: 9px; }
.channel-category-header {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 4px 0 5px;
  border-radius: 7px;
}
.channel-category-header[data-drag-kind="category"] { cursor: context-menu; }
.channel-category-header:hover { background: rgba(255,255,255,.025); }
.channel-category-toggle {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 2px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.channel-category-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-category-toggle svg { width: 13px; height: 13px; transition: transform .15s ease; }
.channel-category.collapsed .channel-category-toggle svg { transform: rotate(-90deg); }
.channel-category-actions { display: flex; align-items: center; opacity: .25; transition: opacity .15s ease; }
.channel-category-header:hover .channel-category-actions,
.channel-category-header:focus-within .channel-category-actions { opacity: 1; }
.channel-category-body {
  min-height: 8px;
  padding-top: 1px;
  border-radius: 8px;
}
.channel-category.collapsed .channel-category-body { display: none; }
.channel-category.uncategorized .channel-category-toggle { color: #7f8795; }
.category-empty-row {
  margin: 3px 8px;
  padding: 7px 9px;
  border: 1px dashed rgba(255,255,255,.07);
  border-radius: 7px;
  color: #737c8c;
  font-size: 10px;
  line-height: 1.35;
}
.channel-sidebar-entry { border-radius: 8px; }
.channel-sidebar-entry > .sidebar-item:only-child { grid-column: 1 / -1; }
.channel-sidebar-entry[data-drag-kind="channel"] { cursor: context-menu; }
.right-mouse-sorting,
.right-mouse-sorting * { cursor: grabbing !important; user-select: none !important; }
.right-dragging {
  position: relative;
  z-index: 30;
  opacity: .72;
  outline: 1px solid rgba(33,243,106,.5);
  background: rgba(33,243,106,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.channel-category.right-dragging { opacity: .82; }
.modal-help { margin: -2px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.right-dragging { pointer-events: none; }

/* Wissenskategorien & 3D-Graph */
.vault-toolbar > div{display:flex;gap:4px}.knowledge-category{margin:3px 4px 8px;border-radius:8px}.knowledge-category-header{height:32px;display:grid;grid-template-columns:22px 1fr 24px;align-items:center;color:#aab7ca;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;border-radius:7px;padding:0 4px;cursor:default}.knowledge-category-header:hover{background:rgba(255,255,255,.035)}.knowledge-category-toggle,.knowledge-category-delete{border:0;background:transparent;color:#74839a;cursor:pointer}.knowledge-category-delete{opacity:0}.knowledge-category-header:hover .knowledge-category-delete{opacity:1}.knowledge-category-body.is-collapsed{display:none}.knowledge-category-empty{padding:7px 12px;color:#5f6c7e;font-size:11px;font-style:italic}.note-file-icon{font-size:12px;color:#8fa5c3}.knowledge-drop-target{outline:1px dashed var(--accent);background:rgba(33,243,106,.06)}body.right-dragging,body.right-dragging *{cursor:grabbing!important;user-select:none!important}#knowledgeGraph{cursor:grab;touch-action:none}#knowledgeGraph.is-rotating{cursor:grabbing}.graph-canvas-wrap:before{content:'3D-ANSICHT';position:absolute;left:18px;top:16px;z-index:2;padding:7px 10px;border:1px solid rgba(33,243,106,.32);border-radius:999px;color:#b9ffd0;background:rgba(7,18,13,.72);font-size:10px;font-weight:800;letter-spacing:.12em}.graph-canvas-wrap{position:relative}


/* Notizen sicher löschen und Graph-Aktionen */
.danger-note-button {
  border: 1px solid rgba(240, 90, 101, .45);
  border-radius: 8px;
  padding: 8px 11px;
  color: #ff9ca4;
  background: rgba(240, 90, 101, .08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: .16s ease;
}
.danger-note-button:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(240, 90, 101, .8);
  background: rgba(240, 90, 101, .22);
}
.danger-note-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.graph-note-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* Wissensnotizen: zuverlässiges Verschieben mit gedrückter rechter Maustaste */
.note-list-item,
.knowledge-category-header {
  position: relative;
  touch-action: none;
}
.knowledge-drag-source {
  opacity: .38 !important;
  filter: saturate(.65);
}
.knowledge-drag-ghost {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 9px 12px;
  border: 1px solid rgba(33,243,106,.55);
  border-radius: 9px;
  background: rgba(15,20,27,.96);
  color: #eaf2ff;
  box-shadow: 0 14px 36px rgba(0,0,0,.38), 0 0 24px rgba(33,243,106,.12);
  pointer-events: none;
  transform: translateZ(0);
  font-size: 12px;
}
.knowledge-drag-ghost span { color: var(--accent); }
.knowledge-drag-ghost strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.knowledge-drop-before::before,
.knowledge-drop-after::after {
  content: "";
  position: absolute;
  z-index: 10;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(33,243,106,.65);
  pointer-events: none;
}
.note-list-item.knowledge-drop-before::before { top: -2px; }
.note-list-item.knowledge-drop-after::after { bottom: -2px; }
.knowledge-category.knowledge-drop-before::before { top: -4px; }
.knowledge-category.knowledge-drop-after::after { bottom: -4px; }
.knowledge-drop-inside {
  outline: 1px dashed rgba(33,243,106,.78) !important;
  outline-offset: -2px;
  background: rgba(33,243,106,.07) !important;
  min-height: 34px;
}
body.right-dragging,
body.right-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* Mitgliederleiste über das Nutzer-Symbol ein- und ausklappen */
@media (min-width: 1181px) {
  .app-shell.members-collapsed .main-panel { min-width: 0; }
  .app-shell.members-collapsed .members-panel { visibility: hidden; }
}

/* Eigene Rollen, Rollenkategorien und Mitgliedermenü */
.roles-card { scroll-margin-top: 18px; }
.role-form { margin-top: 14px; }
.role-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .55fr); gap: 12px; }
.role-color-control { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
.role-color-control input[type="color"] {
  min-width: 48px; width: 48px; height: 44px; padding: 4px; border-radius: 10px; cursor: pointer;
}
.role-form-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.role-management-list { display: grid; gap: 8px; max-height: 390px; overflow-y: auto; margin-top: 16px; padding-right: 3px; }
.role-management-row {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: 11px;
  padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255,255,255,.02);
}
.role-color-dot { display: block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 12px color-mix(in srgb, currentColor 55%, transparent); flex: 0 0 auto; }
.role-management-meta { min-width: 0; }
.role-management-meta strong, .role-management-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-management-meta small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.role-assigned-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.role-management-actions { display: flex; gap: 6px; }
.team-member-role-chips, .member-profile-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.custom-role-chip {
  --role-color: #99aab5;
  display: inline-flex; align-items: center; gap: 5px; max-width: 180px; border: 1px solid color-mix(in srgb, var(--role-color) 52%, transparent);
  border-radius: 999px; padding: 3px 7px; color: var(--role-color); background: color-mix(in srgb, var(--role-color) 11%, transparent);
  font-size: 9px; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.custom-role-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--role-color); flex: 0 0 auto; }
.profile-role-chip { font-size: 11px; padding: 5px 9px; }
.team-member-row { cursor: default; }
.team-member-row:hover { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.035); }

.role-member-sections:empty { display: none; }
.role-members-section { margin-bottom: 18px; }
.role-members-heading { display: block; margin: 0 8px 8px; text-shadow: 0 0 15px color-mix(in srgb, currentColor 40%, transparent); }
.member .avatar[style*="--member-role-color"] { box-shadow: 0 0 0 1px color-mix(in srgb, var(--member-role-color) 70%, transparent), 0 0 14px color-mix(in srgb, var(--member-role-color) 22%, transparent); }

.member-context-menu,
.member-roles-menu {
  position: fixed; z-index: 1900; min-width: 220px; padding: 7px; border: 1px solid var(--line);
  border-radius: 11px; background: #1b2029; box-shadow: 0 18px 48px rgba(0,0,0,.48); color: var(--text-2);
}
.member-context-menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 7px;
  padding: 10px 11px; color: var(--text-2); background: transparent; font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.member-context-menu button:hover, .member-context-menu button:focus-visible { color: var(--text); background: rgba(255,255,255,.065); outline: none; }
.member-context-separator { height: 1px; margin: 5px 4px; background: var(--line-soft); }
.member-context-menu .submenu-trigger > span:last-child { color: var(--muted); font-size: 20px; line-height: 12px; }
.member-roles-menu { width: min(330px, calc(100vw - 16px)); padding: 0; overflow: hidden; }
.member-roles-menu-header { padding: 12px 13px 10px; border-bottom: 1px solid var(--line-soft); }
.member-roles-menu-header strong, .member-roles-menu-header small { display: block; }
.member-roles-menu-header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.member-roles-menu-list { max-height: min(430px, calc(100vh - 120px)); overflow-y: auto; padding: 7px; }
.member-role-option {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) 24px; align-items: center; gap: 9px;
  min-height: 39px; padding: 6px 8px; border-radius: 7px; cursor: pointer;
}
.member-role-option:hover { background: rgba(255,255,255,.055); }
.member-role-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.member-role-option input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.member-role-option input:disabled { cursor: not-allowed; opacity: .55; }
.member-role-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; text-align: center; }

.member-profile-card { width: min(460px, calc(100vw - 26px)); }
.member-profile-body { display: flex; align-items: center; gap: 15px; margin: 4px 0 20px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.025); }
.member-profile-avatar { width: 64px; height: 64px; font-size: 21px; }
.member-profile-meta { min-width: 0; }
.member-profile-meta strong, .member-profile-meta > span { display: block; }
.member-profile-meta strong { font-size: 18px; }
.member-profile-meta > span:not(.role-chip) { margin: 3px 0 9px; color: var(--muted); }

@media (max-width: 720px) {
  .role-form-grid { grid-template-columns: 1fr; }
  .role-management-row { grid-template-columns: 14px minmax(0, 1fr); }
  .role-assigned-count, .role-management-actions { grid-column: 2; }
  .role-management-actions { flex-wrap: wrap; }
}

/* Einstellungen als eigenständige Seiten */
.settings-dashboard { max-width: 1220px; }
.settings-page { display: none; min-height: 100%; }
.settings-page.active-settings-page { display: block; animation: settingsPageIn .18s ease-out; }
.settings-page > .dashboard-card { margin-top: 18px; }
.settings-page-banner { min-height: 132px; }
#teamAdminArea:not(.is-hidden) { display: block; }
@keyframes settingsPageIn { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Private Nachrichten und Ping-Anzeige */
.private-chat-button { position: relative; overflow: visible; }
.private-chat-status-dot {
  position: absolute; right: 5px; bottom: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg-2), 0 0 10px rgba(33,243,106,.8);
}
.private-chat-unread {
  position: absolute; right: -7px; top: -7px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #07140b;
  border: 2px solid var(--bg-2); font-size: 10px; line-height: 1; font-weight: 900;
  box-shadow: 0 0 14px rgba(33,243,106,.55);
}
.private-chat-button.has-unread { color: var(--accent); background: rgba(33,243,106,.07); }

.direct-view { min-height: 0; overflow: hidden; }
.direct-empty-state {
  height: 100%; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 32px;
  color: var(--muted); text-align: center;
}
.direct-empty-state h2 { margin: 4px 0 0; color: var(--text); }
.direct-empty-state p { margin: 0; max-width: 440px; }
.direct-empty-icon {
  width: 74px; height: 74px; display: grid; place-items: center; border-radius: 24px;
  color: var(--accent); background: rgba(33,243,106,.08); border: 1px solid rgba(33,243,106,.25);
  font-size: 30px; box-shadow: 0 0 32px rgba(33,243,106,.08);
}
.direct-conversation { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.direct-conversation-header {
  display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.012);
}
.direct-conversation-header strong, .direct-conversation-header small { display: block; }
.direct-conversation-header small { margin-top: 3px; color: var(--muted); }
.direct-target-avatar { width: 42px; height: 42px; }
.direct-message-list { min-height: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.direct-message { align-self: flex-start; max-width: min(72%, 720px); }
.direct-message.own-message { align-self: flex-end; }
.direct-message-meta { display: flex; align-items: center; gap: 9px; margin: 0 5px 5px; color: var(--muted); font-size: 10px; }
.direct-message.own-message .direct-message-meta { justify-content: flex-end; }
.direct-message-meta strong { color: var(--text-2); font-size: 11px; }
.direct-message-bubble {
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 13px; border-radius: 12px 12px 12px 4px;
  color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line-soft); line-height: 1.45;
}
.direct-message.own-message .direct-message-bubble {
  border-radius: 12px 12px 4px 12px; color: #07140b; background: var(--accent); border-color: rgba(33,243,106,.65);
}
.direct-message.own-message .chat-mention { color: #072f14; background: rgba(255,255,255,.28); }
.direct-message-composer { margin-top: 0; }
.direct-thread-empty { margin: auto; padding: 36px; color: var(--muted); text-align: center; }
.direct-thread-empty > div { color: var(--accent); font-size: 30px; }
.direct-thread-empty h3 { margin: 10px 0 4px; color: var(--text); }
.direct-thread-empty p { margin: 0; }
.direct-sidebar-search {
  display: flex; align-items: center; gap: 8px; margin: 0 7px 10px; padding: 8px 10px;
  color: var(--muted); background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
}
.direct-sidebar-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.direct-sidebar-empty { margin: 0 7px; padding: 14px; font-size: 12px; }
.direct-contact-item > span:first-child {
  width: 25px !important; height: 25px; border-radius: 50%; color: #07140b; background: var(--accent);
  font-size: 9px; font-weight: 900;
}
.direct-contact-item .voice-count {
  min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px;
  color: #07140b; background: var(--accent); font-weight: 900;
}

.chat-mention {
  display: inline-block; margin: 0 1px; padding: 0 4px; border-radius: 4px;
  color: #b9c9ff; background: rgba(88,101,242,.20); font-weight: 700;
}
.chat-mention.is-self {
  color: #07140b; background: var(--accent); box-shadow: 0 0 10px rgba(33,243,106,.24);
}

@media (max-width: 720px) {
  .direct-message { max-width: 88%; }
  .direct-message-list { padding: 15px 10px; }
  .private-chat-unread { right: -3px; }
}
.private-chat-button.active-direct-chat { color: var(--accent); background: rgba(33,243,106,.10); }


/* Echte FiveM-Serveranbindung */
.fivem-settings-form { gap: 16px; }
.fivem-settings-block { border: 1px solid var(--line-soft); border-radius: 13px; background: rgba(7,10,14,.26); padding: 15px; display: grid; gap: 13px; }
.fivem-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.fivem-settings-heading h4 { margin: 3px 0 0; font-size: 16px; }
.settings-help { color: var(--muted); font-size: 11px; text-align: right; max-width: 300px; line-height: 1.45; }
.settings-inline-grid { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(120px,.55fr) minmax(120px,.55fr); gap: 12px; }
.settings-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.settings-note code, .agent-config-box code { color: var(--accent); }
.agent-config-box { border: 1px solid rgba(33,243,106,.32); background: rgba(33,243,106,.055); border-radius: 11px; padding: 13px; display: grid; gap: 10px; }
.agent-config-box > div strong, .agent-config-box > div small { display: block; }
.agent-config-box > div small { color: var(--muted); margin-top: 4px; }
.agent-config-box pre { margin: 0; padding: 12px; border-radius: 9px; background: #0b0e13; border: 1px solid var(--line-soft); color: #bfffd0; font: 12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.fivem-connection-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.fivem-test-result { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: rgba(8,11,15,.35); }
.fivem-test-row { display: grid; grid-template-columns: 12px minmax(0,1fr); align-items: center; gap: 10px; padding: 11px 13px; }
.fivem-test-row + .fivem-test-row { border-top: 1px solid var(--line-soft); }
.fivem-test-row strong, .fivem-test-row small { display: block; }
.fivem-test-row small { color: var(--muted); margin-top: 3px; line-height: 1.4; }
.test-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(143,152,167,.10); }
.test-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(55,201,135,.14); }
.test-dot.error { background: var(--red); box-shadow: 0 0 0 4px rgba(240,90,101,.14); }
.test-dot.wait { background: var(--accent); box-shadow: 0 0 0 4px rgba(33,243,106,.10); animation: pulse-fivem-test 1s infinite alternate; }
@keyframes pulse-fivem-test { to { opacity: .35; } }
@media (max-width: 820px) {
  .settings-inline-grid { grid-template-columns: 1fr 1fr; }
  .settings-inline-grid .field:first-child { grid-column: 1 / -1; }
  .fivem-settings-heading { align-items: flex-start; flex-direction: column; }
  .settings-help { text-align: left; }
}
@media (max-width: 520px) {
  .settings-inline-grid { grid-template-columns: 1fr; }
  .settings-inline-grid .field:first-child { grid-column: auto; }
  .fivem-connection-actions > button { width: 100%; }
}


/* Download des txAdmin Connectors direkt aus den Servereinstellungen */
.connector-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(33,243,106,.30);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(33,243,106,.085), rgba(33,243,106,.025));
}
.connector-download-copy { min-width: 0; }
.connector-download-copy strong,
.connector-download-copy small { display: block; }
.connector-download-copy small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.connector-download-copy code { color: var(--accent); }
.connector-download-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .connector-download-card { align-items: stretch; flex-direction: column; }
  .connector-download-button { width: 100%; }
}
