:root {
  --bg: #05070d;
  --bg-2: #0a0e18;
  --panel: rgba(14, 19, 32, 0.72);
  --panel-solid: #0e1320;
  --panel-hi: rgba(22, 29, 48, 0.85);
  --line: rgba(140, 160, 255, 0.09);
  --line-hi: rgba(140, 160, 255, 0.18);
  --text: #e8ecf6;
  --muted: #8a93a9;
  --faint: #5b6479;
  --cyan: #38bdf8;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #38bdf8 0%, #6366f1 55%, #8b5cf6 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --t-user: #38bdf8;
  --t-feedback: #f59e0b;
  --t-project: #a78bfa;
  --t-reference: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--cyan); }
::selection { background: rgba(99, 102, 241, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(140, 160, 255, .14); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Hintergrund ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb-a { width: 620px; height: 620px; background: radial-gradient(circle, rgba(56, 189, 248, .35), transparent 65%); top: -220px; left: -160px; animation: drift 22s ease-in-out infinite alternate; }
.orb-b { width: 720px; height: 720px; background: radial-gradient(circle, rgba(139, 92, 246, .32), transparent 65%); bottom: -300px; right: -200px; animation: drift 28s ease-in-out infinite alternate-reverse; }
.grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(140, 160, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 160, 255, .035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%); }
@keyframes drift { to { transform: translate(80px, 60px) scale(1.08); } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); backdrop-filter: blur(18px); border: 1px solid var(--line-hi); border-radius: 22px; padding: 36px 32px 30px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04); animation: rise .6s var(--ease); }
.auth-card h1 { font: 600 24px/1.2 var(--display); margin: 22px 0 6px; letter-spacing: -.01em; }
.auth-card p.sub { color: var(--muted); margin: 0 0 24px; }
.auth-card form { display: grid; gap: 14px; }
.auth-foot { margin-top: 22px; color: var(--faint); font-size: 12px; text-align: center; }
.qr-box { background: #fff; border-radius: 16px; padding: 14px; width: fit-content; margin: 4px auto 14px; box-shadow: 0 0 0 1px var(--line-hi), 0 20px 50px -10px rgba(56, 189, 248, .25); }
.qr-box img, .qr-box svg { display: block; width: 210px; height: 210px; }
.secret { font: 500 13px var(--mono); background: var(--bg-2); border: 1px dashed var(--line-hi); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; letter-spacing: .06em; color: var(--cyan); word-break: break-all; }
.steps { color: var(--muted); padding-left: 20px; margin: 0 0 16px; }
.steps li { margin: 4px 0; }
.code-input { font: 600 26px var(--mono) !important; letter-spacing: .5em; text-align: center; padding-left: .5em !important; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 24px -6px rgba(99, 102, 241, .6); position: relative; flex: none; }
.logo-mark::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .7); }
.logo-text { font: 700 16px/1.1 var(--display); letter-spacing: -.01em; }
.logo-text small { display: block; font: 500 11px var(--font); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }

/* ---------- Formularelemente ---------- */
label.field { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; background: rgba(5, 8, 15, .7); border: 1px solid var(--line-hi); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: rgba(56, 189, 248, .6); box-shadow: 0 0 0 4px rgba(56, 189, 248, .12); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
textarea.code { font: 13px/1.6 var(--mono); min-height: 360px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a93a9' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
select option { background: var(--panel-solid); }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-hi); background: var(--panel-hi); border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 600; font-size: 13px; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { border-color: rgba(140, 160, 255, .32); background: rgba(30, 38, 62, .9); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 28px -10px rgba(99, 102, 241, .8); }
.btn.primary:hover { box-shadow: 0 14px 34px -10px rgba(99, 102, 241, 1); filter: brightness(1.08); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(140, 160, 255, .07); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.block { width: 100%; padding: 12px; }
.btn svg { width: 16px; height: 16px; }
.error-msg { color: var(--err); font-size: 13px; min-height: 18px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(6, 9, 16, .6); backdrop-filter: blur(16px); }
.sidebar .logo { padding: 0 8px 18px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; transition: background .2s, color .2s; position: relative; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { color: var(--text); background: rgba(140, 160, 255, .06); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(56, 189, 248, .14), rgba(139, 92, 246, .06)); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav .count { margin-left: auto; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav .count.live { color: var(--cyan); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.bridge-pill { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(14, 19, 32, .6); font-size: 12px; color: var(--muted); }
.bridge-pill b { color: var(--text); font-weight: 600; display: block; font-size: 12.5px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #1e293b, #312e81); display: grid; place-items: center; font-weight: 700; font-family: var(--display); border: 1px solid var(--line-hi); flex: none; }
.user-chip .who { line-height: 1.25; min-width: 0; }
.user-chip .who b { display: block; font-weight: 600; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }
.user-chip .btn { margin-left: auto; }

.main { min-width: 0; padding: 30px 38px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font: 600 28px/1.15 var(--display); margin: 0; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.view { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Karten ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h3 { margin: 0; font: 600 14px var(--display); letter-spacing: .01em; }
.card-body { padding: 16px 18px 18px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .label svg { width: 15px; height: 15px; opacity: .7; }
.stat .value { font: 600 30px/1 var(--display); margin-top: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--faint); margin-top: 6px; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--glow, rgba(56, 189, 248, .18)), transparent 70%); }

.hero { padding: 26px 26px 22px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero h2 { font: 600 22px/1.25 var(--display); margin: 0 0 4px; letter-spacing: -.01em; }
.hero h2 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 18px; color: var(--muted); }
.quick { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.quick textarea { min-height: 52px; }
.quick-opts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick-opts select { width: auto; padding: 7px 32px 7px 11px; font-size: 12.5px; }

/* ---------- Listen ---------- */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); cursor: pointer; transition: background .15s; min-width: 0; }
.row:first-child { border-top: 0; }
.row:hover { background: rgba(140, 160, 255, .04); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { color: var(--faint); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 18px; text-align: center; color: var(--faint); }
.empty svg { width: 34px; height: 34px; opacity: .5; display: block; margin: 0 auto 10px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, .6); }
.dot.err { background: var(--err); }
.dot.warn { background: var(--warn); }
.dot.live { background: var(--cyan); box-shadow: 0 0 0 0 rgba(56, 189, 248, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(56, 189, 248, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.3; white-space: nowrap; }
.badge.t-user { color: var(--t-user); background: rgba(56, 189, 248, .08); }
.badge.t-feedback { color: var(--t-feedback); background: rgba(245, 158, 11, .08); }
.badge.t-project { color: var(--t-project); background: rgba(167, 139, 250, .08); }
.badge.t-reference { color: var(--t-reference); background: rgba(52, 211, 153, .08); }
.badge.s-running, .badge.s-waiting, .badge.s-queued { color: var(--cyan); background: rgba(56, 189, 248, .08); }
.badge.s-done { color: var(--ok); background: rgba(52, 211, 153, .08); }
.badge.s-error { color: var(--err); background: rgba(248, 113, 113, .08); }
.badge.s-stopped { color: var(--muted); background: rgba(140, 160, 255, .05); }
.badge.muted { color: var(--muted); border-color: var(--line-hi); }

.feed-item { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 18px; border-top: 1px solid var(--line); font-size: 13px; }
.feed-item:first-child { border-top: 0; }
.feed-item .dot { transform: translateY(-1px); }
.feed-item .when { color: var(--faint); font-size: 11.5px; white-space: nowrap; }

/* ---------- Agents ---------- */
.agents-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; height: calc(100vh - 150px); min-height: 520px; }
.agent-list { overflow: auto; }
.agent-item { padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; display: grid; gap: 4px; transition: background .15s; }
.agent-item:first-child { border-top: 0; }
.agent-item:hover { background: rgba(140, 160, 255, .04); }
.agent-item.active { background: linear-gradient(90deg, rgba(56, 189, 248, .1), transparent); box-shadow: inset 2px 0 0 var(--cyan); }
.agent-item .top { display: flex; align-items: center; gap: 9px; }
.agent-item .name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-item .snippet { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-item .info { color: var(--faint); font-size: 11.5px; }

.console { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.console-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.console-head h3 { margin: 0; font: 600 16px var(--display); }
.console-head .meta { color: var(--muted); font-size: 12px; }
.console-head .actions { margin-left: auto; display: flex; gap: 8px; }
.transcript { flex: 1; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg-user { align-self: flex-end; max-width: 78%; background: linear-gradient(135deg, rgba(56, 189, 248, .16), rgba(139, 92, 246, .16)); border: 1px solid rgba(99, 102, 241, .3); border-radius: 16px 16px 4px 16px; padding: 10px 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg-ai { max-width: 92%; }
.msg-ai .md { background: rgba(10, 14, 24, .6); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 12px 16px; }
.msg-tool { display: flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--muted); padding: 6px 10px; border-radius: 8px; background: rgba(140, 160, 255, .05); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow: hidden; }
.msg-tool b { color: var(--violet); font-weight: 500; }
.msg-tool span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.tool-result { font: 12px var(--mono); color: var(--faint); margin-top: -8px; }
details.tool-result summary { cursor: pointer; padding: 2px 10px; list-style: none; }
details.tool-result summary::before { content: '↳ '; }
details.tool-result pre { margin: 6px 0 0; padding: 10px 12px; background: rgba(0, 0, 0, .35); border-radius: 8px; overflow: auto; max-height: 260px; white-space: pre-wrap; color: var(--muted); }
details.tool-result.err summary { color: var(--err); }
.msg-system { align-self: center; font-size: 11.5px; color: var(--faint); letter-spacing: .02em; }
.msg-result { align-self: center; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-hi); }
.msg-result.err { color: var(--err); border-color: rgba(248, 113, 113, .35); white-space: pre-wrap; border-radius: 12px; max-width: 90%; }
.waiting-note { align-self: center; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--cyan); padding: 10px 16px; border-radius: 12px; background: rgba(56, 189, 248, .06); border: 1px dashed rgba(56, 189, 248, .35); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.composer { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 46px; max-height: 200px; }

/* ---------- Markdown ---------- */
.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--display); letter-spacing: -.01em; margin: 1.2em 0 .5em; line-height: 1.3; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.08em; }
.md p { margin: .6em 0; }
.md code { font: .9em var(--mono); background: rgba(140, 160, 255, .1); padding: .12em .4em; border-radius: 5px; color: #c4b5fd; }
.md pre { background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; }
.md pre code { background: none; padding: 0; color: var(--text); }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md blockquote { margin: .8em 0; padding: .2em 1em; border-left: 3px solid var(--violet); color: var(--muted); }
.md table { border-collapse: collapse; width: 100%; font-size: .95em; margin: .8em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-hi); padding: 6px 10px; text-align: left; }
.md th { background: rgba(140, 160, 255, .06); }
.md a.wikilink { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed rgba(56, 189, 248, .5); }
.md strong { color: #fff; }

/* ---------- Gedächtnis ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 340px; padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a93a9' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-hi); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); }
.chip.active { color: #fff; background: rgba(99, 102, 241, .22); border-color: rgba(99, 102, 241, .6); }
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mem-card { padding: 16px 16px 14px; cursor: pointer; display: grid; gap: 8px; align-content: start; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.mem-card:hover { transform: translateY(-2px); border-color: var(--line-hi); box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .8); }
.mem-card .top { display: flex; align-items: center; gap: 8px; }
.mem-card .when { margin-left: auto; font-size: 11px; color: var(--faint); }
.mem-card h4 { margin: 0; font: 600 14.5px/1.35 var(--display); }
.mem-card p { margin: 0; color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mem-card .links { font-size: 11.5px; color: var(--faint); }

/* ---------- Seitenleiste (Drawer) & Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2, 4, 10, .6); backdrop-filter: blur(4px); z-index: 50; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--panel-solid); border-left: 1px solid var(--line-hi); z-index: 51; display: flex; flex-direction: column; animation: slidein .35s var(--ease); box-shadow: -30px 0 80px -20px rgba(0, 0, 0, .8); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font: 600 20px/1.3 var(--display); }
.drawer-head .desc { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.drawer-head .actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 40px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 20px; z-index: 51; padding: 24px; animation: pop .3s var(--ease); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
.modal h2 { margin: 0 0 4px; font: 600 20px var(--display); }
.modal .sub { color: var(--muted); margin: 0 0 20px; }
.modal form { display: grid; gap: 14px; }
.modal .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.safety { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; background: rgba(52, 211, 153, .06); border: 1px solid rgba(52, 211, 153, .22); color: #a7f3d0; font-size: 12.5px; }
.safety svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- Netz ---------- */
.graph-wrap { position: relative; height: calc(100vh - 230px); min-height: 480px; overflow: hidden; }
.graph-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph-wrap canvas.dragging { cursor: grabbing; }
.graph-legend { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.graph-legend i.solid { background: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, .2); }
.graph-legend i.ring { background: rgba(167, 139, 250, .22); border: 1.5px solid rgba(167, 139, 250, .8); }
.graph-legend { pointer-events: none; background: rgba(10, 14, 24, .7); padding: 6px 10px; border-radius: 10px; }
.chip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.chip:not(.active) .chip-dot { opacity: .35; }
.graph-tip em { display: block; font-style: normal; font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
.graph-tip { position: absolute; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 10px; padding: 8px 11px; font-size: 12px; max-width: 280px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .8); display: none; }
.graph-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.graph-tip span { color: var(--muted); }

/* ---------- Speicher ---------- */
.speicher-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; height: calc(100vh - 150px); min-height: 480px; }
.tree { overflow: auto; padding: 10px 8px; font-size: 13px; }
.tree .node { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; cursor: pointer; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree .node:hover { background: rgba(140, 160, 255, .06); color: var(--text); }
.tree .node.active { background: rgba(56, 189, 248, .12); color: var(--text); }
.tree .node svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.tree .node.dir { color: var(--text); font-weight: 500; }
.tree .kids { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 15px; }
.viewer { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.viewer-head .path { font: 12.5px var(--mono); color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { flex: 1; overflow: auto; padding: 20px 24px; }
.viewer-body pre.raw { font: 12.5px/1.6 var(--mono); white-space: pre-wrap; margin: 0; color: var(--muted); }

/* ---------- Protokoll & Einstellungen ---------- */
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--line); }
table.log td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.log tr:last-child td { border-bottom: 0; }
table.log td.when { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.log td.detail { color: var(--muted); word-break: break-word; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .3); color: #fde68a; font-size: 13px; }
.banner .btn { margin-left: auto; }
.banner > svg { flex: none; width: 20px; height: 20px; }

/* ---------- Überblick: letzter Arbeitsstand ---------- */
.hero-brain { border-top: 1px solid var(--line); margin: 0 -26px -22px; padding: 18px 26px 22px; background: rgba(5, 8, 15, .35); border-radius: 0 0 var(--radius) var(--radius); }
.hero-log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hero-log { max-height: 280px; overflow: auto; font-size: 13.5px; mask-image: linear-gradient(#000 85%, transparent); padding-bottom: 12px; }
.hero-log .md h2 { font-size: 1.02em; margin: 1em 0 .3em; color: var(--cyan); }
.hero-log .md h2:first-child { margin-top: 0; }

/* ---------- Arbeitslog ---------- */
.journal-layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; height: calc(100vh - 150px); min-height: 480px; }
.journal-days { overflow: auto; padding: 8px; display: grid; gap: 2px; align-content: start; }
.journal-day { display: grid; gap: 1px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); transition: background .15s; }
.journal-day b { font-weight: 600; font-variant-numeric: tabular-nums; }
.journal-day span { font-size: 12px; color: var(--muted); }
.journal-day:hover { background: rgba(140, 160, 255, .06); }
.journal-day.active { background: linear-gradient(90deg, rgba(56, 189, 248, .14), rgba(139, 92, 246, .06)); box-shadow: inset 2px 0 0 var(--cyan); }
.journal-page { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.journal-body { flex: 1; overflow: auto; padding: 20px 26px 40px; }
.journal-body .md h1 { font-size: 1.35em; }
.journal-body .md h2 { font-size: 1.05em; color: var(--cyan); padding-top: 14px; border-top: 1px solid var(--line); margin-top: 18px; }
.journal-body .md h2:first-of-type { border-top: 0; padding-top: 0; }

/* ---------- Wachstums-Replay ---------- */
.graph-clock { position: absolute; top: 16px; left: 18px; display: none; background: rgba(10, 14, 24, .85); border: 1px solid var(--line-hi); border-radius: 12px; padding: 10px 14px; backdrop-filter: blur(8px); max-width: 60%; }
.graph-clock b { font: 600 22px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-right: 6px; }
.graph-clock span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 860px) {
  .journal-layout { grid-template-columns: 1fr; height: auto; }
  .journal-days { max-height: 220px; }
  .journal-page { min-height: 70vh; }
  .hero-brain { margin: 0 -18px -18px; padding: 16px 18px; }
}

/* ---------- Verbrauch ---------- */
.grid-2.even { grid-template-columns: 1fr 1fr; }
.bars { position: relative; height: 260px; padding: 6px 0 26px 58px; }
.bars-grid { position: absolute; left: 58px; right: 0; top: 6px; bottom: 26px; pointer-events: none; }
.bars-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.bars-tick span { position: absolute; right: calc(100% + 10px); top: -8px; font-size: 11px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; cursor: default; min-width: 0; }
.bar-col:hover { background: rgba(140, 160, 255, .05); border-radius: 4px 4px 0 0; }
.bar { background: #38bdf8; border-radius: 4px 4px 0 0; min-height: 0; transition: height .4s var(--ease); }
.bar-col:hover .bar { filter: brightness(1.15); }
.bar-x { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--faint); white-space: nowrap; }
.table-toggle { margin-top: 10px; font-size: 13px; }
.table-toggle summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.table-toggle table { margin-top: 10px; }
.hbar { display: grid; gap: 5px; margin-bottom: 14px; }
.hbar:last-child { margin-bottom: 0; }
.hbar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hbar-label span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; background: rgba(140, 160, 255, .07); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: #38bdf8; border-radius: 4px; transition: width .4s var(--ease); }
@media (max-width: 860px) { .grid-2.even { grid-template-columns: 1fr; } .bars { padding-left: 50px; } .bars-grid { left: 50px; } }

/* ---------- Fragen ---------- */
.q-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.q-nav { padding: 10px; display: grid; gap: 2px; position: sticky; top: 20px; }
.q-progress { padding: 8px 10px 14px; display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.q-progress b { color: var(--text); font: 600 18px var(--display); }
.q-sec { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.q-sec svg { width: 17px; height: 17px; flex: none; }
.q-sec span { flex: 1; }
.q-sec em { font-style: normal; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.q-sec:hover { background: rgba(140, 160, 255, .06); color: var(--text); }
.q-sec.active { color: var(--text); background: linear-gradient(90deg, rgba(56, 189, 248, .14), rgba(139, 92, 246, .06)); box-shadow: inset 2px 0 0 var(--cyan); }
.q-page { display: flex; flex-direction: column; }
.q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.q-head h2 { margin: 0; font: 600 20px var(--display); }
.q-body { padding: 8px 24px 20px; }
.q-item { display: grid; gap: 9px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-item > label { font-weight: 600; font-size: 14px; }
.q-scale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.q-scale span { font-size: 12px; color: var(--muted); }
.q-scale .chip { min-width: 38px; }
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .q-layout { grid-template-columns: 1fr; } .q-nav { position: static; } .q-head, .q-body, .q-foot { padding-left: 16px; padding-right: 16px; } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 100; pointer-events: none; } /* Hinweise blockieren keine Klicks auf Knöpfe darunter */
.toast { background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 12px; padding: 11px 15px; font-size: 13px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); display: flex; align-items: center; gap: 10px; animation: toastin .35s var(--ease); max-width: 360px; }
.toast.err { border-color: rgba(248, 113, 113, .45); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

.loading { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(140, 160, 255, .15); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-top { display: none; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .3s var(--ease); background: var(--panel-solid); }
  .shell.nav-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, .7); }
  .mobile-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: rgba(5, 7, 13, .85); backdrop-filter: blur(14px); }
  .main { padding: 20px 16px 50px; }
  .page-head h1 { font-size: 23px; }
  .agents-layout, .speicher-layout { grid-template-columns: 1fr; height: auto; }
  .agent-list, .tree { max-height: 260px; }
  .console, .viewer { min-height: 70vh; }
  .quick { grid-template-columns: 1fr; }
  .modal .row-2 { grid-template-columns: 1fr; }
  .msg-user { max-width: 92%; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 24px; }
  .auth-card { padding: 28px 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Bereich „Nutzer“: Kalender, Budget, Kunden, Hard- & Software ---------- */
.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h3, .cal-nav b { min-width: 150px; text-align: center; font: 600 15px var(--display); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; color: var(--faint); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-day { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 5px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: background .15s; min-width: 0; }
.cal-day:hover { background: rgba(140, 160, 255, .05); }
.cal-day.other { opacity: .4; }
.cal-day.today { border-color: rgba(56, 189, 248, .6); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .35); }
.cal-day .n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day.today .n { color: var(--cyan); font-weight: 700; }
.cal-ev { font-size: 11px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { filter: brightness(1.25); }
.cal-more { font-size: 10.5px; color: var(--faint); padding-left: 4px; }
.value.m-ok, .money.m-ok { color: var(--ok); }
.value.m-err, .money.m-err { color: var(--err); }
.ntable td.money { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ntable tr[data-id] { cursor: pointer; }
.ntable tr[data-id]:hover td { background: rgba(140, 160, 255, .04); }
.ntable td svg { width: 14px; height: 14px; vertical-align: -2px; }
.bars-list { display: grid; gap: 12px; }
.bbar { cursor: pointer; }
.bbar.total { cursor: default; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bbar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.bbar-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bbar-track { height: 8px; border-radius: 99px; background: rgba(140, 160, 255, .1); overflow: hidden; }
.bbar-track i { display: block; height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1px solid var(--line-hi); background: var(--panel-hi); color: var(--text); font: 500 12.5px var(--font); cursor: pointer; transition: all .15s; }
.tpl span { font-size: 24px; }
.tpl:hover { border-color: rgba(99, 102, 241, .6); background: rgba(99, 102, 241, .14); transform: translateY(-1px); }
.inv-h { font: 600 15px var(--display); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.inv-details { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.inv-details b { color: var(--faint); font-weight: 500; }
.mem-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mem-card .foot svg { width: 13px; height: 13px; vertical-align: -2px; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-hi); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; }
.file-chip a { display: inline-flex; align-items: center; gap: 5px; color: var(--text); text-decoration: none; }
.file-chip svg { width: 13px; height: 13px; }
.file-chip .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 6px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; display: flex; }
.field.check input { width: auto; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .cal-day { min-height: 58px; } .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 6px; } .cal-more { display: none; } }

/* ---------- Whiteboard ---------- */
.wb-view .page-head .actions { align-items: center; }
.wb-select { min-width: 180px; }
.wb-wrap { position: relative; height: calc(100vh - 170px); min-height: 460px; overflow: hidden; padding: 0; }
.wb-tools { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(10, 14, 24, .88); border: 1px solid var(--line-hi); backdrop-filter: blur(10px); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8); max-width: calc(100% - 24px); overflow-x: auto; }
.wb-tool { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.wb-tool svg { width: 18px; height: 18px; }
.wb-tool:hover { color: var(--text); background: rgba(140, 160, 255, .08); }
.wb-tool.active { color: #fff; background: rgba(99, 102, 241, .28); border-color: rgba(99, 102, 241, .6); }
.wb-sep { width: 1px; height: 22px; background: var(--line-hi); margin: 0 4px; flex: none; }
.wb-colors { display: flex; gap: 4px; }
.wb-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); cursor: pointer; flex: none; padding: 0; }
.wb-color.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(99, 102, 241, .8); }
.wb-state { font-size: 11.5px; color: var(--faint); padding: 0 8px; white-space: nowrap; min-width: 84px; }
.wb-stage { position: absolute; inset: 0; overflow: hidden; cursor: default; touch-action: none; --grid: 24px;
  background-image: radial-gradient(circle, rgba(140, 160, 255, .16) 1px, transparent 1.2px); background-size: var(--grid) var(--grid); }
.wb-stage[data-tool=pen], .wb-stage[data-tool=rect], .wb-stage[data-tool=arrow] { cursor: crosshair; }
.wb-stage[data-tool=note], .wb-stage[data-tool=text] { cursor: copy; }
.wb-stage[data-tool=eraser] { cursor: not-allowed; }
.wb-stage.panning { cursor: grabbing; }
.wb-stage.drop { outline: 2px dashed rgba(56, 189, 248, .7); outline-offset: -8px; }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wb-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.wb-line { cursor: pointer; }
.wb-line.sel { filter: drop-shadow(0 0 4px rgba(56, 189, 248, .9)); }
.wb-el { position: absolute; box-sizing: border-box; user-select: none; }
.wb-el.sel { outline: 2px solid rgba(56, 189, 248, .9); outline-offset: 3px; }
.wb-note { border-radius: 4px 4px 14px 4px; color: #1f2937; padding: 12px 12px 16px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .7); font: 500 14px/1.4 var(--font); overflow: hidden; }
.wb-text { font-family: var(--display); font-weight: 600; line-height: 1.25; white-space: pre-wrap; }
.wb-txt { outline: none; white-space: pre-wrap; word-break: break-word; min-height: 1em; height: 100%; }
.wb-txt[contenteditable=true] { cursor: text; user-select: text; }
.wb-text .wb-txt { min-width: 20px; }
.wb-rect { border: 3px solid; border-radius: 10px; background: transparent; }
.wb-file img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8); pointer-events: none; }
.wb-filecard { display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 100%; padding: 12px 14px 12px 46px; position: relative; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-hi); color: var(--text); text-decoration: none; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8); }
.wb-filecard svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--cyan); }
.wb-filecard b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-filecard span { font-size: 11.5px; color: var(--muted); }
.wb-handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px; background: var(--cyan); border: 2px solid var(--panel-solid); cursor: nwse-resize; display: none; }
.wb-el.sel .wb-handle { display: block; }
.wb-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(10, 14, 24, .88); border: 1px solid var(--line-hi); font-size: 12px; color: var(--muted); }
.wb-zoom span { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.wb-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wb-empty > div { display: grid; justify-items: center; gap: 6px; color: var(--faint); text-align: center; max-width: 320px; }
.wb-empty svg { width: 40px; height: 40px; opacity: .5; }
.wb-empty b { color: var(--muted); }
@media (max-width: 860px) { .wb-wrap { height: calc(100vh - 210px); } .wb-tools { top: 8px; } }
.wb-el.editing { outline: 2px dashed rgba(56, 189, 248, .9); outline-offset: 4px; }
.wb-txt:empty::before { content: 'Text eingeben …'; opacity: .45; }
.wb-note .wb-txt:empty::before { content: 'Notiz …'; }
.fix-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 10px; border-bottom: 1px solid var(--line); }
.fix-tools select { width: auto; padding: 6px 10px; font-size: 12.5px; }
.fix-tools .chip { padding: 5px 10px; font-size: 12px; }
.fix-sum { padding: 10px 18px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-align: right; }
.fix-sum b { color: var(--text); }
.meta .m-err { color: var(--err); font-weight: 600; }

/* Whiteboard-System: Board-Liste, Auswahl-Leiste, Vorlagen */
.wb-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; }
.wb-boards { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 460px; padding: 0; overflow: hidden; }
.wb-boards-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; font: 600 14px var(--display); }
.wb-blist { flex: 1; overflow: auto; padding: 0 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; }
.wb-bitem { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 10px 10px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.wb-bitem:hover { background: rgba(140, 160, 255, .06); }
.wb-bitem.active { background: rgba(99, 102, 241, .16); border-color: rgba(99, 102, 241, .45); }
.wb-bitem .grow { flex: 1; min-width: 0; }
.wb-bitem .t { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-bitem .m { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.wb-bacts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.wb-bitem:hover .wb-bacts, .wb-bitem.active .wb-bacts { opacity: 1; }
.wb-bacts button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.wb-bacts button:hover { background: rgba(140, 160, 255, .12); color: var(--text); }
.wb-bacts button.danger:hover { background: rgba(248, 113, 113, .14); color: var(--err); }
.wb-bacts svg { width: 14px; height: 14px; }
.wb-bnew { margin: 8px; justify-content: center; border: 1px dashed var(--line-hi) !important; }
.wb-seltools { position: absolute; z-index: 6; transform: translateX(-50%) translateY(6px); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 11px; background: rgba(10, 14, 24, .94); border: 1px solid var(--line-hi); box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .9); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; }
.wb-seltools.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.wb-seltools button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.wb-seltools button:hover { background: rgba(140, 160, 255, .12); color: var(--text); }
.wb-seltools button.danger:hover { background: rgba(248, 113, 113, .16); color: var(--err); }
.wb-seltools svg { width: 16px; height: 16px; }
.wb-seltools .wb-sep { height: 18px; }
.wb-title { position: absolute; left: 14px; bottom: 14px; z-index: 5; font: 600 13px var(--display); color: var(--muted); background: rgba(10, 14, 24, .75); padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); pointer-events: none; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-title:empty { display: none; }
.wb-tplopt { position: relative; }
.wb-tplopt b { font-size: 13px; }
.wb-tplopt small { color: var(--muted); font-size: 11px; text-align: center; line-height: 1.3; }
.wb-tplopt.active { border-color: rgba(99, 102, 241, .8); background: rgba(99, 102, 241, .2); box-shadow: 0 0 0 1px rgba(99, 102, 241, .5); }
.wb-list-toggle { display: none; }
.wb-note { transition: box-shadow .15s; }
.wb-note:hover { box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .8); }
@media (max-width: 980px) {
  .wb-shell { grid-template-columns: 1fr; position: relative; }
  .wb-list-toggle { display: inline-flex; }
  .wb-boards { position: absolute; z-index: 20; left: 0; top: 0; width: min(290px, 85vw); height: calc(100vh - 210px); transform: translateX(-110%); transition: transform .2s var(--ease); background: var(--panel-solid); }
  .wb-shell.list-open .wb-boards { transform: none; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .9); }
}

/* ---------- Planung: Projekte & Ideen ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--line-hi); background: var(--panel-hi); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font: 500 12.5px var(--font); padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.seg button svg { width: 15px; height: 15px; }
.seg button.active { background: rgba(99, 102, 241, .25); color: #fff; }
.prj-done { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; cursor: pointer; }
.prj-done input { width: auto; }
.prj-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.prj-col { background: rgba(14, 19, 32, .55); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 200px; transition: border-color .15s, background .15s; }
.prj-col.over { border-color: rgba(99, 102, 241, .7); background: rgba(99, 102, 241, .08); }
.prj-colh { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font: 600 13px var(--display); border-bottom: 2px solid var(--c); margin-bottom: 10px; }
.prj-colh em { font-style: normal; font-size: 11.5px; color: var(--faint); background: rgba(140, 160, 255, .08); padding: 1px 8px; border-radius: 99px; }
.prj-drop { display: grid; gap: 10px; }
.prj-empty { text-align: center; color: var(--faint); font-size: 12px; padding: 14px 0; border: 1px dashed var(--line-hi); border-radius: 12px; }
.prj-card { background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 13px; padding: 12px 12px 10px; cursor: pointer; display: grid; gap: 7px; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.prj-card:hover { transform: translateY(-2px); border-color: rgba(140, 160, 255, .32); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .9); }
.prj-card.drag { opacity: .45; }
.prj-top { display: flex; align-items: center; gap: 8px; }
.prj-top b { flex: 1; font: 600 14px/1.3 var(--display); min-width: 0; }
.prj-emoji { font-size: 18px; }
.prio { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prj-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }
.prj-meta .m-err { color: var(--err); font-weight: 600; }
.prj-next { font-size: 12px; color: #cbd2e4; line-height: 1.35; }
.prj-next.muted { color: var(--muted); }
.prj-bar { height: 6px; border-radius: 99px; background: rgba(140, 160, 255, .12); overflow: hidden; }
.prj-bar.big { height: 10px; }
.prj-bar i { display: block; height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.prj-pct { font-size: 11px; color: var(--faint); text-align: right; margin-top: -4px; font-variant-numeric: tabular-nums; }
.prj-steps { display: grid; gap: 6px; }
.prj-step { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(140, 160, 255, .05); cursor: pointer; font-size: 13.5px; }
.prj-step input { width: 17px; height: 17px; margin-top: 1px; flex: none; accent-color: #34d399; }
.prj-step.done span { text-decoration: line-through; color: var(--faint); }
.prj-add { display: flex; gap: 8px; margin-top: 10px; }
.prj-add input { flex: 1; }
.idea-quick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px; }
.idea-quick span { font-size: 22px; }
.idea-quick input { flex: 1; border: 0; background: transparent; font-size: 15px; }
.idea-quick input:focus { outline: none; }
.idea-quick select { width: auto; }
.idea .stars { color: #fbbf24; letter-spacing: 1px; }
@media (max-width: 700px) { .idea-quick { flex-wrap: wrap; } .idea-quick input { min-width: 100%; } }

/* ---------- Gedanken-Netz v2 ---------- */
.netz-wrap { position: relative; height: calc(100vh - 230px); min-height: 520px; overflow: hidden; padding: 0; background: #04060c; }
.netz-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.netz-wrap canvas.dragging { cursor: grabbing; }
.netz-info { position: absolute; left: 14px; top: 14px; width: 250px; z-index: 4; background: rgba(8, 11, 22, .78); border: 1px solid rgba(140, 160, 255, .16); border-radius: 14px; backdrop-filter: blur(10px); padding: 12px 14px; font-size: 12px; transition: width .2s var(--ease); }
.netz-info.closed { width: 38px; padding: 6px; }
.netz-info.closed .netz-info-b { display: none; }
.netz-info-t { position: absolute; right: 8px; top: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.netz-info.closed .netz-info-t { position: static; width: 26px; height: 24px; }
.netz-h { display: block; font: 600 11px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 2px 0 8px; }
.netz-leg { display: grid; gap: 5px; color: var(--muted); margin-bottom: 12px; }
.netz-leg span { display: flex; align-items: center; gap: 8px; }
.netz-leg i { width: 11px; height: 11px; flex: none; display: inline-block; }
.netz-leg .dot-g { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #a78bfa 45%); box-shadow: 0 0 8px #a78bfa; }
.netz-leg .dia { background: #f472b6; transform: rotate(45deg) scale(.8); box-shadow: 0 0 8px #f472b6; }
.netz-leg .ln { height: 2px; background: linear-gradient(90deg, #38bdf8, #a78bfa); }
.netz-leg .pulse { border-radius: 50%; border: 2px solid #34d399; animation: netzPulse 1.6s infinite; }
.netz-leg .dim { border-radius: 50%; background: rgba(167, 139, 250, .35); }
@keyframes netzPulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }
.netz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.netz-stats div { background: rgba(140, 160, 255, .06); border-radius: 9px; padding: 7px 6px; text-align: center; display: grid; }
.netz-stats b { font: 700 17px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.netz-stats span { font-size: 10.5px; color: var(--faint); }
.netz-top, .netz-nb { display: grid; gap: 3px; }
.netz-top button, .netz-nb button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: 500 12px var(--font); padding: 6px 7px; border-radius: 8px; cursor: pointer; }
.netz-top button:hover, .netz-nb button:hover { background: rgba(140, 160, 255, .1); }
.netz-top i, .netz-nb i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.netz-top em { margin-left: auto; font-style: normal; color: var(--faint); font-size: 11px; }
.netz-nb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.netz-side { position: absolute; right: 14px; top: 14px; bottom: 14px; width: 300px; z-index: 5; background: rgba(8, 11, 22, .9); border: 1px solid rgba(140, 160, 255, .18); border-radius: 16px; backdrop-filter: blur(12px); padding: 18px 16px; overflow: auto; transform: translateX(340px); opacity: 0; transition: transform .3s var(--ease), opacity .2s; pointer-events: none; }
.netz-side.open { transform: none; opacity: 1; pointer-events: auto; }
.netz-side h3 { margin: 6px 0 8px; font: 600 18px/1.3 var(--display); }
.netz-side p { margin: 0 0 10px; color: #cbd2e4; font-size: 13px; line-height: 1.5; }
.netz-type { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.netz-meta { font-size: 11.5px; color: var(--faint); margin-bottom: 12px; }
.netz-side .btn { margin-bottom: 16px; }
.netz-x { position: absolute; right: 8px; top: 8px; }
@media (max-width: 860px) { .netz-side { left: 14px; width: auto; top: auto; max-height: 55%; transform: translateY(110%); } .netz-side.open { transform: none; } .netz-info { width: 210px; } }

/* Budget: Schnell-Buchen-Menü am „buchen“-Knopf */
.popmenu { position: fixed; z-index: 60; min-width: 250px; max-width: 320px; background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: var(--radius-sm); padding: 6px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .85); animation: pmIn .14s ease-out; }
@keyframes pmIn { from { opacity: 0; transform: translateY(-4px); } }
.popmenu .pm-head { font: 600 12px var(--display); color: var(--muted); padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.popmenu button:hover, .popmenu button:focus-visible { background: var(--panel-hi); outline: none; }
.popmenu button svg { width: 18px; height: 18px; flex: none; color: var(--cyan); }
.popmenu button:first-of-type svg { color: var(--ok); }
.popmenu button span { display: flex; flex-direction: column; min-width: 0; }
.popmenu button b { font-weight: 600; font-size: 13.5px; }
.popmenu button small { color: var(--muted); font-size: 12px; }
.popmenu .pm-foot { border-top: 1px solid var(--line); margin-top: 4px; padding: 7px 10px 3px; color: var(--faint); font-size: 11.5px; }

/* Konten & Guthaben */
.k-tpls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.k-tpls .hint { margin-right: 4px; }
.konto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.konto { padding: 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.konto.warn { border-color: rgba(248, 113, 113, .4); }
.konto.aus { opacity: .55; }
.konto .k-top { display: flex; align-items: center; gap: 12px; }
.konto .k-top h4 { margin: 0; font: 600 16px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.konto .k-top .grow { min-width: 0; }
.k-emoji { font-size: 22px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-hi); border: 1px solid var(--line); flex: none; }
#bkonten .k-emoji { width: 30px; height: 30px; font-size: 17px; border-radius: 9px; }
#bkonten .row { text-decoration: none; color: inherit; }
.konto .k-saldo { font: 600 30px/1.1 var(--display); letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.k-vs { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; display: grid; gap: 5px; border: 1px solid var(--line); }
.k-vs.ok { background: rgba(52, 211, 153, .06); border-color: rgba(52, 211, 153, .25); }
.k-vs.ok b { color: var(--ok); }
.k-vs.bad { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .35); }
.k-vs.bad > b { color: var(--err); }
.k-vs span { display: block; color: var(--muted); }
.k-zu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.k-mov { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; font-size: 12.5px; }
.k-mov > div { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.k-mov > div > span:first-child { color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.k-mov .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.k-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }
.zu-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; }
.zu-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-hi); }
.zu-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.zu-main span { display: flex; flex-direction: column; min-width: 0; }
.zu-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zu-auto { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.zu-auto.off { opacity: .4; cursor: not-allowed; }
@media (max-width: 640px) { .zu-row { flex-direction: column; align-items: stretch; } }

/* Schnellaktionen: runder ＋-Knopf, nur auf dem Handy */
.fab-wrap { display: none; }
@media (max-width: 860px) {
  .fab-wrap { display: block; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 55; }
  .fab { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 34px -8px rgba(99, 102, 241, .7); cursor: pointer; transition: transform .25s var(--ease); }
  .fab svg { width: 26px; height: 26px; }
  .fab-wrap.open .fab { transform: rotate(45deg); }
  .fab-menu { position: absolute; right: 0; bottom: 72px; display: grid; gap: 8px; justify-items: end; pointer-events: none; opacity: 0; transform: translateY(8px); transition: all .2s var(--ease); }
  .fab-wrap.open .fab-menu { pointer-events: auto; opacity: 1; transform: none; }
  .fab-menu button { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--panel-solid); color: var(--text); font: 600 14px var(--font); white-space: nowrap; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); cursor: pointer; }
  .fab-menu button svg { width: 18px; height: 18px; color: var(--cyan); }
  .fab-menu button b { font-weight: 400; font-size: 17px; line-height: 1; }
  .main { padding-bottom: 110px; }
  #toasts { bottom: 92px; left: 16px; right: 16px; }
  /* Als App (Homescreen): Platz für die Statusleiste */
  .mobile-top { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* Handy: breiter Inhalt (Tabellen, Kanban) darf die Seite nicht aufdrücken – er scrollt in sich selbst */
.shell > div, .main, .view, .grid-2 > *, .stack > * { min-width: 0; }
