@import url("fonts/fonts.css");

:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel-2: #faf9f6;
  --ink: #17171b;
  --ink-2: #55555f;
  --ink-3: #8a8a94;
  --line: #e6e4de;
  --line-2: #d8d5cd;
  --accent: #4b3cf0;
  --accent-ink: #ffffff;
  --accent-soft: #ecebff;
  --ok: #148a55;
  --ok-soft: #e4f5ec;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --bad: #c42b2b;
  --bad-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .08);
  --shadow-lg: 0 24px 64px rgba(20, 20, 30, .22);
  --r: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114; --panel: #1a1a1f; --panel-2: #202026; --ink: #f1f0ec; --ink-2: #b7b6be; --ink-3: #7d7c86;
    --line: #2c2c34; --line-2: #3a3a44; --accent: #8a7dff; --accent-ink: #0f0f14; --accent-soft: #26233f;
    --ok: #4cc58a; --ok-soft: #13291f; --warn: #f0b04a; --warn-soft: #2c2412; --bad: #ff7a7a; --bad-soft: #321919;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons & Inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 550; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--panel-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=url], input[type=search], textarea, select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel);
  outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin: 14px 0 4px; letter-spacing: -.02em; }
.auth-card p { color: var(--ink-2); margin: 0 0 22px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.045em; font-size: 17px; }
.logo i { width: 22px; height: 22px; display: inline-block; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 64%22%3E%3Cdefs%3E%3ClinearGradient id=%22l%22 gradientUnits=%22userSpaceOnUse%22 x1=%2214%22 y1=%228%22 x2=%2250%22 y2=%2258%22%3E%3Cstop offset=%220%22 stop-color=%22%235b4cff%22/%3E%3Cstop offset=%22.42%22 stop-color=%22%23e44ad8%22/%3E%3Cstop offset=%22.7%22 stop-color=%22%23ff6a3d%22/%3E%3Cstop offset=%221%22 stop-color=%22%23ffc53d%22/%3E%3C/linearGradient%3E%3Cfilter id=%22glow%22 x=%22-40%25%22 y=%22-40%25%22 width=%22180%25%22 height=%22180%25%22%3E%3CfeGaussianBlur stdDeviation=%222.6%22 result=%22b%22/%3E%3CfeColorMatrix in=%22b%22 type=%22matrix%22 values=%221 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 .55 0%22 result=%22bb%22/%3E%3CfeMerge%3E%3CfeMergeNode in=%22bb%22/%3E%3CfeMergeNode in=%22SourceGraphic%22/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg fill=%22none%22 stroke=%22url%28%23l%29%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 filter=%22url%28%23glow%29%22%3E%3Cpath d=%22M44 12.5c-10-3-17 1.5-17 11.5v29%22 stroke-width=%2212%22/%3E%3Cpath d=%22M17 30h19%22 stroke-width=%2210.5%22/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }   /* formbar-Logo (weiches f), steht still */
@keyframes blob { 0%, 100% { border-radius: 42% 58% 63% 37% / 45% 38% 62% 55%; transform: rotate(0); }
  33% { border-radius: 63% 37% 41% 59% / 58% 55% 45% 42%; } 66% { border-radius: 38% 62% 55% 45% / 40% 62% 38% 60%; transform: rotate(120deg); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: 54px 1fr; height: 100vh; height: 100dvh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); min-width: 0; }
.top .sep { width: 1px; height: 22px; background: var(--line); }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 4px; }
.nav-btn { width: 46px; height: 46px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; display: grid;
  place-items: center; color: var(--ink-2); position: relative; }
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn:hover { background: var(--panel-2); color: var(--ink); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); }
.nav-btn .tip { position: absolute; left: 54px; background: var(--ink); color: var(--bg); padding: 4px 9px; border-radius: 7px; font-size: 12px;
  font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: .12s; z-index: 50; }
.nav-btn:hover .tip { opacity: 1; transform: none; }
.side .spacer { flex: 1; }
main { min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.view { height: 100%; overflow: auto; }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 28px 60px; }
.page h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
.page .lead { color: var(--ink-2); margin: 0 0 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.vernav { display: flex; align-items: center; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.vernav .lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0 8px; white-space: nowrap; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: var(--chat-w, 430px) 6px 1fr; height: 100%; }
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.split { cursor: col-resize; background: var(--line); transition: background .15s; }
.split:hover, .split.drag { background: var(--accent); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-head b { font-size: 14px; }
.msgs { flex: 1; overflow: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { max-width: 92%; }
.msg.user { align-self: flex-end; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 4px 16px; padding: 9px 13px; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant { align-self: flex-start; width: 92%; }
.msg.assistant .bubble { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 11px 14px; word-wrap: break-word; }
.msg.divider { align-self: center; text-align: center; color: var(--ink-3); font-size: 12px; max-width: 80%; padding: 6px 0; border-top: 1px dashed var(--line-2); }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-size: 14px; margin: 10px 0 4px; }
.bubble code { background: rgba(127, 127, 127, .15); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.bubble pre { background: rgba(127, 127, 127, .12); padding: 10px; border-radius: 8px; overflow: auto; font-size: 12px; }
.bubble table { border-collapse: collapse; margin: 6px 0; font-size: 13px; } .bubble td, .bubble th { border: 1px solid var(--line-2); padding: 3px 7px; }
.msg-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; margin-top: 5px; }
.msg-chips img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.steps { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.steps summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
.steps[open] summary::before { transform: rotate(90deg); }
.steps ol { margin: 6px 0 0; padding-left: 18px; }
.live-steps { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.live-steps div { display: flex; gap: 7px; align-items: center; animation: fadein .25s ease; }
.live-steps div:last-child::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
.live-steps div:not(:last-child)::before { content: "✓"; color: var(--ok); width: 10px; font-weight: 700; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); 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: .25; } 40% { opacity: 1; } }
.msg-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.choice { border: 1px solid var(--accent); color: var(--accent); background: var(--panel); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 550; font-size: 13px; }
.choice:hover, .choice.on { background: var(--accent); color: var(--accent-ink); }
.plan-card { margin-top: 10px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 12px; }
.plan-card b { display: block; margin-bottom: 8px; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 8px 11px; margin-top: 8px; font-size: 13px; }

.welcome { background: linear-gradient(135deg, var(--accent-soft), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.welcome h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.01em; }
.welcome p { margin: 0 0 14px; color: var(--ink-2); }
.welcome .row { flex-wrap: wrap; }

.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--panel); }
.drop-hint { outline: 2px dashed var(--accent); outline-offset: -8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px 4px 3px 4px; font-size: 12px; max-width: 100%; }
.chip img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.chip .ico { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 15px; padding: 0 4px; }
.inputbox { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.inputbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inputbox textarea { border: 0; box-shadow: none !important; resize: none; min-height: 44px; max-height: 220px; padding: 11px 13px 4px; background: transparent; }
.inputbox .bar { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px; }

.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.pv-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.pv-url svg { width: 15px; height: 15px; flex: none; }
.pv-url { flex: 1; min-width: 60px; display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 32px; color: var(--ink-2); font-size: 13px; overflow: hidden; white-space: nowrap; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; height: 26px; width: 32px; border-radius: 7px; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.pv-stage { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 16px; position: relative; }
.pv-frame { background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; width: 100%; height: 100%; transition: width .25s ease; border: 1px solid var(--line); flex: none; }
.pv-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-empty { position: absolute; inset: 16px; display: grid; place-items: center; pointer-events: none; text-align: center; color: var(--ink-3); }
.pv-empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }
.pv-busy { position: absolute; top: 26px; right: 30px; }

/* ---------- Kontextmenü, Toast, Modal, Popup ---------- */
.ctx { position: fixed; z-index: 1000; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .12s ease; }
.ctx .h { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 4px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx button { display: flex; width: 100%; gap: 9px; align-items: center; border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.ctx button:hover { background: var(--accent-soft); color: var(--accent); }
.ctx button.danger { color: var(--bad); } .ctx button.danger:hover { background: var(--bad-soft); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.ctx svg { width: 16px; height: 16px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 550; animation: pop .15s ease; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 15, 22, .45); backdrop-filter: blur(3px); z-index: 900; display: grid; place-items: center; padding: 20px; animation: fadein .15s; }
.modal { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(1080px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-h h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.md-doc { line-height: 1.6; } .md-doc h1 { font-size: 22px; } .md-doc h2 { font-size: 17px; margin-top: 20px; } .md-doc h3 { font-size: 15px; }

.popup { position: fixed; z-index: 800; width: 380px; max-width: calc(100vw - 20px); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 70vh; animation: pop .15s; }
.popup-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: move; user-select: none; }
.popup-h b { flex: 1; font-size: 13.5px; }
.popup-b { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.popup-ans { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.popup .inputbox textarea { min-height: 64px; }

/* ---------- Medien ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile .img { aspect-ratio: 4/3; background: var(--panel-2) center/cover no-repeat; }
.tile .meta { padding: 8px 10px; font-size: 12px; }
.tile .meta b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .more { position: absolute; top: 6px; right: 6px; opacity: 0; transition: .15s; background: var(--panel); }
.tile:hover .more, .tile:focus-within .more { opacity: 1; }
.tile .badge { position: absolute; top: 8px; left: 8px; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--ink-2); margin-bottom: 18px; transition: .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.picker-grid .tile .img { aspect-ratio: 1; }
.tile.sel { outline: 3px solid var(--accent); }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 1500; background: rgba(8, 8, 12, .93); display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: 1fr auto; animation: fadein .15s ease; color: #f4f3ef; }
.lb-fig { grid-column: 2; grid-row: 1; margin: 0; display: grid; place-items: center; min-height: 0; padding: 56px 0 12px; }
.lb-img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); transition: filter .2s; user-select: none; -webkit-user-drag: none; }
.lb.loading .lb-img { filter: blur(1.5px) saturate(.9); }
.lb-btn { border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-x { position: absolute; top: 14px; right: 16px; width: 42px; height: 42px; z-index: 2; }
.lb-nav { width: 48px; height: 48px; align-self: center; justify-self: center; grid-row: 1; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-bar { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 16px; align-items: center; padding: 12px 20px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .35)); flex-wrap: wrap; }
.lb-info { flex: 1; min-width: 200px; }
.lb-info b { display: block; font-size: 15px; }
.lb-info span { font-size: 12.5px; opacity: .7; }
.lb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; font-weight: 550; font-size: 13px; }
.lb-act:hover { background: rgba(255, 255, 255, .16); }
.lb-act.danger { color: #ff9a9a; }
.lb-act svg { width: 15px; height: 15px; }
.lb-count { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .lb { grid-template-columns: 1fr; }
  .lb-fig { grid-column: 1; padding: 60px 8px 8px; }
  .lb-nav { position: absolute; top: 45%; width: 40px; height: 40px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-act { height: 30px; padding: 0 9px; }
}

/* ---------- Verlauf ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-2); }
.tl-item.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-item.cur::before { background: var(--accent); border-color: var(--accent); }
.tl-item .files { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Daten / Tabellen ---------- */
.data-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.coll-list button { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 1px solid transparent; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; text-align: left; font-weight: 550; }
.coll-list button.on { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 650; background: var(--panel-2); }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }

/* ---------- Lizenz ---------- */
.meter { height: 12px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #8f6bff); border-radius: 99px; transition: width .4s; }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.pkg { text-align: center; padding: 22px; }
.pkg .n { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.pkg .c { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 0; }
.pkg .p { color: var(--ink-2); margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.kpi .l { color: var(--ink-3); font-size: 12px; font-weight: 600; }

/* ---------- Briefing-Wizard ---------- */
.modal.wizm { overflow: hidden; display: flex; flex-direction: column; }
.modal.wizm .modal-b { flex: 1; min-height: 0; }
.wiz { display: grid; grid-template-rows: auto 1fr auto; height: min(calc(90vh - 60px), 820px); }
.wiz-steps { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wiz-steps button { border: 0; background: none; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; cursor: pointer; color: var(--ink-3); font-weight: 600; white-space: nowrap; font-size: 13px; }
.wiz-steps button i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-style: normal; font-size: 11px; }
.wiz-steps button.on { color: var(--ink); background: var(--accent-soft); }
.wiz-steps button.on i, .wiz-steps button.done i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wiz-body { overflow: auto; padding: 22px 24px; }
.wiz-body h4 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; }
.wiz-body .lead { color: var(--ink-2); margin: 0 0 18px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.opt { border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; overflow: hidden; text-align: left; padding: 0; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.opt:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt.on::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.opt .cap { padding: 9px 12px 11px; }
.opt .cap b { display: block; font-size: 13.5px; }
.opt .cap span { font-size: 12px; color: var(--ink-3); }
.tagopts { display: flex; flex-wrap: wrap; gap: 8px; }
.tagopt { border: 1.5px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 550; }
.tagopt.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

/* Stil-Mini-Mockups */
.mock { height: 128px; position: relative; overflow: hidden; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.mock .nav { display: flex; justify-content: space-between; align-items: center; font-size: 7px; }
.mock .nav i { display: inline-block; width: 14px; height: 3px; margin-left: 4px; background: currentColor; opacity: .5; border-radius: 2px; }
.mock .h { font-size: 17px; line-height: 1.05; margin-top: 6px; max-width: 70%; }
.mock .b { display: inline-block; font-size: 7px; padding: 4px 8px; margin-top: auto; align-self: flex-start; }
.mock .pic { position: absolute; right: 10px; bottom: 10px; width: 38%; height: 52%; }
.m-minimal { background: #fff; color: #111; font-family: Inter; } .m-minimal .h { font-weight: 500; letter-spacing: -.03em; } .m-minimal .b { border: 1px solid #111; } .m-minimal .pic { background: #eee; }
.m-editorial { background: #f3efe6; color: #1b1b1b; font-family: "Playfair Display"; } .m-editorial .h { font-style: italic; font-size: 19px; } .m-editorial .b { font-family: Inter; background: #1b1b1b; color: #f3efe6; } .m-editorial .pic { background: linear-gradient(#bfb7a6, #8c8472); filter: grayscale(1); }
.m-warm { background: #f6ebdd; color: #5a2e1c; font-family: Fraunces; } .m-warm .h { font-weight: 700; } .m-warm .b { background: #c8553d; color: #fff; border-radius: 99px; } .m-warm .pic { background: #e0a26f; border-radius: 40px 40px 8px 40px; }
.m-luxe { background: #0e0d0b; color: #d9bf82; font-family: "Cormorant Garamond"; } .m-luxe .h { font-weight: 500; letter-spacing: .02em; color: #f3ead6; } .m-luxe .nav { letter-spacing: .3em; } .m-luxe .b { border: 1px solid #d9bf82; letter-spacing: .2em; } .m-luxe .pic { background: linear-gradient(135deg, #2a261e, #57492c); }
.m-playful { background: #fff4c7; color: #1d1a5e; font-family: "Bricolage Grotesque"; } .m-playful .h { font-weight: 800; } .m-playful .b { background: #ff5ca8; color: #fff; border-radius: 99px; box-shadow: 2px 2px 0 #1d1a5e; } .m-playful .pic { background: #6f5cff; border-radius: 50%; width: 32%; box-shadow: -18px 10px 0 #36d1a4; }
.m-brutal { background: #ffe500; color: #000; font-family: "JetBrains Mono"; } .m-brutal .h { font-family: "Archivo Black"; text-transform: uppercase; font-size: 16px; } .m-brutal .b { background: #000; color: #ffe500; } .m-brutal .pic { background: #fff; border: 3px solid #000; box-shadow: 5px 5px 0 #000; }
.m-tech { background: radial-gradient(circle at 80% 20%, #3b2a8c, #0a0b1e 60%); color: #e6e8ff; font-family: "Space Grotesk"; } .m-tech .h { font-weight: 600; background: linear-gradient(90deg, #fff, #9fa8ff); -webkit-background-clip: text; background-clip: text; color: transparent; } .m-tech .b { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; } .m-tech .pic { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; backdrop-filter: blur(4px); }
.m-nature { background: #eef1e6; color: #22341f; font-family: "DM Serif Display"; } .m-nature .b { font-family: "DM Sans"; background: #3f6b3a; color: #fff; border-radius: 6px; } .m-nature .pic { background: #8fae7c; border-radius: 60% 40% 55% 45%; }
.m-retro { background: #f4dfb6; color: #5b2a12; font-family: "Bricolage Grotesque"; } .m-retro .h { font-weight: 800; color: #d9531e; letter-spacing: -.03em; } .m-retro .b { background: #5b2a12; color: #f4dfb6; border-radius: 99px; } .m-retro .pic { background: repeating-linear-gradient(0deg, #d9531e 0 8px, #f0a202 8px 16px, #7a9e3a 16px 24px); border-radius: 60px 60px 0 0; }
.m-corporate { background: #f5f7fb; color: #0f2547; font-family: Manrope; } .m-corporate .h { font-weight: 800; } .m-corporate .nav { background: #0f2547; color: #fff; margin: -12px -12px 0; padding: 7px 12px; } .m-corporate .b { background: #1f6feb; color: #fff; border-radius: 4px; } .m-corporate .pic { background: #d5deec; border-radius: 4px; }
.m-dark-minimal { background: #111; color: #f2f2f2; font-family: Syne; } .m-dark-minimal .h { font-weight: 700; } .m-dark-minimal .b { background: #f2f2f2; color: #111; } .m-dark-minimal .pic { background: #2a2a2a; }
.m-kinetic { background: #ff4d2e; color: #fff; font-family: "Bebas Neue"; } .m-kinetic .h { font-size: 28px; line-height: .9; } .m-kinetic .b { font-family: Inter; background: #fff; color: #ff4d2e; } .m-kinetic .pic { background: #1a1a1a; transform: rotate(-6deg); }

.swatches { display: flex; height: 58px; }
.swatches i { flex: 1; }
.fontprev { padding: 16px 14px 10px; min-height: 110px; }
.fontprev .fh { font-size: 26px; line-height: 1.05; margin-bottom: 6px; }
.fontprev .fb { font-size: 12.5px; color: var(--ink-2); }
.anim-demo { height: 96px; background: var(--panel-2); position: relative; overflow: hidden; display: grid; place-items: center; }
.anim-demo .blk { width: 60px; height: 38px; border-radius: 8px; background: var(--accent); }
.a-fade .blk { animation: a-fade 2.4s ease-out infinite; }
@keyframes a-fade { 0% { opacity: 0; transform: translateY(18px); } 35%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.a-parallax .l1, .a-parallax .l2 { position: absolute; left: 20%; width: 60%; height: 16px; border-radius: 4px; }
.a-parallax .l1 { background: var(--line-2); top: 30%; animation: a-par1 3s ease-in-out infinite alternate; }
.a-parallax .l2 { background: var(--accent); top: 55%; animation: a-par2 3s ease-in-out infinite alternate; }
@keyframes a-par1 { to { transform: translateY(-10px); } } @keyframes a-par2 { to { transform: translateY(-30px); } }
.a-hover .blk { animation: a-hover 2s ease-in-out infinite; } @keyframes a-hover { 50% { transform: translateY(-6px) scale(1.06); box-shadow: 0 12px 20px rgba(75, 60, 240, .35); } }
.a-reveal .txt { font-weight: 800; font-size: 20px; letter-spacing: -.02em; animation: a-reveal 2.6s ease infinite; }
@keyframes a-reveal { 0% { clip-path: inset(0 100% 0 0); } 40%, 85% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
.a-marquee .track { position: absolute; white-space: nowrap; font-weight: 800; font-size: 18px; animation: a-marq 5s linear infinite; color: var(--accent); }
@keyframes a-marq { from { transform: translateX(40%); } to { transform: translateX(-60%); } }
.a-count .txt { font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.a-zoom .pic { position: absolute; inset: 10px 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #ff8a5b); animation: a-zoom 5s ease-in-out infinite alternate; }
@keyframes a-zoom { to { transform: scale(1.15); } }
.a-page .p1, .a-page .p2 { position: absolute; inset: 14px 40px; border-radius: 8px; }
.a-page .p1 { background: var(--line-2); } .a-page .p2 { background: var(--accent); animation: a-page 3s ease-in-out infinite; }
@keyframes a-page { 0%, 30% { clip-path: circle(0 at 50% 50%); } 60%, 100% { clip-path: circle(80% at 50% 50%); } }
.a-sticky .bar { position: absolute; left: 20px; width: 10px; top: 16px; bottom: 16px; background: var(--line-2); border-radius: 5px; }
.a-sticky .bar::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 30%; background: var(--accent); border-radius: 5px; animation: a-stick 3s ease-in-out infinite; }
.a-sticky .card2 { width: 90px; height: 50px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-2); animation: a-stick2 3s ease-in-out infinite; }
@keyframes a-stick { 50% { height: 100%; } } @keyframes a-stick2 { 50% { transform: scale(.94); opacity: .6; } }
.a-cursor .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); position: absolute; animation: a-cur 3.5s ease-in-out infinite; }
@keyframes a-cur { 0% { transform: translate(-40px, 10px); } 33% { transform: translate(30px, -18px) scale(1.6); } 66% { transform: translate(10px, 20px); } 100% { transform: translate(-40px, 10px); } }
.a-gradient { background: linear-gradient(120deg, var(--accent), #ff8a5b, #33c28a, var(--accent)); background-size: 300% 300%; animation: a-grad 5s ease infinite; }
@keyframes a-grad { 50% { background-position: 100% 50%; } }
.a-micro .btn2 { padding: 7px 14px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; animation: a-micro 2s ease infinite; }
@keyframes a-micro { 0%, 60%, 100% { transform: none; } 70% { transform: scale(.92); } 80% { transform: scale(1.06); } }
.a-none .blk { background: var(--line-2); }

.mini-site { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.summary-grid { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 13.5px; }
.summary-grid dt { color: var(--ink-3); font-weight: 600; }
.summary-grid dd { margin: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 54px 1fr 58px; }
  .side { grid-row: 3; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 4px; }
  .side .spacer, .nav-btn .tip { display: none; }
  .studio { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .studio .split { display: none; }
  .studio.show-preview .chat, .studio:not(.show-preview) .preview { display: none; }
  .top .hide-m, .vernav .lbl, #phasePill { display: none; }
  .top { gap: 6px; padding: 0 8px; }
  #mToggle span { display: none; }
  .data-layout { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 50px; }
  .summary-grid { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .only-m { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= Hub-spezifisch ================= */
:root { --s1: #2a78d6; --s2: #eb6834; --grid: #ecebe6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --grid: #2a2a31; } }
.hub-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); }
.hub-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
.hub-tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.hub-tabs button:hover { color: var(--ink); background: var(--panel-2); }
.hub-tabs button.on { color: var(--accent); background: var(--accent-soft); }
.hub-tabs .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; margin-left: 4px; }
.hub-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.hub-main h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
.hub-main .lead { color: var(--ink-2); margin: 0 0 20px; max-width: 820px; }
.sec { margin-top: 26px; }
.sec h3 { font-size: 15px; margin: 0 0 10px; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi .v.pos { color: var(--ok); } .kpi .v.neg { color: var(--bad); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip-btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.chip-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px; }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); } .status.bad { color: var(--bad); }
.edit-tbl input { padding: 6px 8px; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.keybox { font-family: "JetBrains Mono", monospace; font-size: 15px; background: var(--panel-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; user-select: all; }

/* Diagramm */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridl { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .dlabel { font-size: 11.5px; font-weight: 650; font-family: var(--font); fill: var(--ink-2); }
.chart .xh { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; min-width: 170px; transform: translate(-50%, -110%); white-space: nowrap; }
.chart .tip b { display: block; margin-bottom: 4px; }
.chart .tip .r { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.tbl th.num { text-align: right; }

.tbl code { white-space: nowrap; }
@media (max-width: 700px) { .hub-mail { display: none; } .hub-top { gap: 8px; padding: 0 12px; } .hub-main { padding: 18px 14px 50px; } }

/* Tarife (Abos) */
.row.wrap { flex-wrap: wrap; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pill.sm { height: 20px; padding: 0 7px; font-size: 11px; }
.tbl-wrap { overflow: auto; }
.tbl tr.sum td { background: var(--panel-2); }
.plan-box { margin-bottom: 16px; }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.plan-facts > div > span:first-child { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 1px; }
.plan-facts b { font-size: 16px; }
.plan-ctrl select { width: auto; flex: 1 1 220px; min-width: 0; }
.plan-ctrl select#pCyc { flex: 0 0 140px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.plan-edit { display: flex; flex-direction: column; gap: 10px; }
.plan-edit.off { opacity: .62; }
.plan-edit .pe-name { font-weight: 700; font-size: 15px; }
.pe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pe-grid .field { margin: 0; }
.pe-grid .field > span { font-size: 12px; }
.pe-calc { font-size: 12.5px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: grid; gap: 3px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; align-items: center; margin-top: 22px; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .plan-grid { grid-template-columns: 1fr; }
  .save-bar { flex-wrap: wrap; }
}
.tbl .status { white-space: nowrap; }
.lead .pill { height: auto; min-height: 26px; white-space: normal; padding: 3px 10px; }
.plan-edit > .row:last-child { margin-top: auto; }

/* ================= Betreiber-Auswertungen (ops.js, charts.js) ================= */
/* Diagrammfarben (Leitfaden dataviz, geprüft gegen die Flächen #fff / #1a1a1f): --s1 blau, --s2 orange, --s3 türkis
   (hell nur 2,8:1 → nie für die Hauptreihe, immer mit Legende und Tabellenansicht);
   --c-bad = „kritisch“ für Fehler-Säulen (blau ↔ kritisch-rot farbfehlsichtig sicher). Text nie in Datenfarben. */
:root { --s3: #1baf7a; --c-bad: #d03b3b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s3: #199e70; --c-bad: #d03b3b; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; }
.status.accent { color: var(--accent); } .status.muted { color: var(--ink-3); }
a.ext { text-decoration: none; overflow-wrap: anywhere; } a.ext:hover { text-decoration: underline; }
a.ext::after { content: " ↗"; font-size: 11px; color: var(--ink-3); }
.filters { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.filters select { max-width: 100%; }
.fx-set { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fx-set input { width: 84px; padding: 5px 8px; }
.refreshing { opacity: .6; transition: opacity .15s; }
details.sec > summary, details.card > summary { cursor: pointer; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover, .tbl th[data-sort]:focus-visible { color: var(--ink); }
.err-line { color: var(--bad); white-space: normal; max-width: 300px; margin-top: 2px; }

/* Hinweise (Übersicht) – Zustand immer mit Symbol + Wort, nie nur Farbe */
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 8px; margin: 0 0 18px; }
.alert { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 10px; cursor: pointer; color: var(--ink); }
.alert:disabled { cursor: default; }
.alert:not(:disabled):hover { background: var(--panel-2); }
.alert .al-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.alert .al-t b { display: block; font-weight: 650; }
.alert .al-t span { display: block; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.alert .al-lv { font-size: 12px; font-weight: 650; color: var(--ink-3); white-space: nowrap; }
.alert.bad { border-left-color: var(--bad); } .alert.bad .al-ic { background: var(--bad-soft); color: var(--bad); }
.alert.warn { border-left-color: var(--warn); } .alert.warn .al-ic { background: var(--warn-soft); color: var(--warn); }
.alert.info { border-left-color: var(--accent); } .alert.info .al-ic { background: var(--accent-soft); color: var(--accent); font-family: Georgia, serif; font-style: italic; }
.alerts-ok { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; margin: 0 0 18px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.kpi-link { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, background .15s; }
.kpi-link:hover { border-color: var(--line-2); background: var(--panel-2); }
.kpi .v.v-status { font-size: 16px; font-weight: 700; letter-spacing: 0; padding: 7px 0 3px; }
.kpi .v.v-status .status { font-size: 15px; }

/* Diagramm-Rahmen */
.vz { margin: 0; min-width: 0; }
.vz-h { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.vz-h h3 { margin: 0; font-size: 15px; }
.vz-h .hint { margin: 2px 0 0; }
.vz-b { min-width: 0; }
.vz-plot { position: relative; }
.vz-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.vz-plot svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.vz-grid { stroke: var(--grid); stroke-width: 1; }
.vz-grid.zero, .vz-base { stroke: var(--line-2); stroke-width: 1; }
.vz-axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.vz-dlabel { fill: var(--ink-2); font-size: 11.5px; font-weight: 650; font-family: var(--font); }
.vz-cap { fill: var(--ink-2); font-size: 11px; font-weight: 650; font-family: var(--font); }
.vz-xh { stroke: var(--ink-3); stroke-width: 1; }
.vz-end, .vz-dot { stroke: var(--panel); stroke-width: 2; }
.vz-col { transition: opacity .12s; }
.vz-col.dim { opacity: .38; }
.vz-hitc { cursor: default; outline: none; }
.vz-hitc:focus-visible { stroke: var(--accent); stroke-width: 2; }
.vz-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.vz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vz-legend i { display: inline-block; flex: none; }
.vz-legend i.ln { width: 14px; height: 3px; border-radius: 2px; }
.vz-legend i.sq { width: 10px; height: 10px; border-radius: 2px; }
.vz-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px;
  padding: 8px 10px; font-size: 12.5px; min-width: 150px; max-width: 280px; }
.vz-tip-h { display: block; margin-bottom: 4px; font-weight: 700; }
.vz-tip-r { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.vz-tip-r b { font-variant-numeric: tabular-nums; }
.vz-tip-r span { color: var(--ink-2); }
.vz-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex: none; }
.vz-key.none { background: transparent; }
.vz-table { max-height: 340px; }
.vz-meter { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 8px 0 4px; }
.vz-meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.vz-meter.full i { background: var(--warn); }

/* Waagerechte Balken (HTML): Beschriftung | Balken | Wert */
.hb { display: grid; gap: 4px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 3px 4px; border-radius: 7px; outline: none; }
.hb-row:hover, .hb-row:focus-visible { background: var(--panel-2); }
.hb-row:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.hb-l { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-v { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 52px; }
.hb-track { display: block; height: 14px; min-width: 0; }
.hb-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-track.in-cell { height: 8px; min-width: 60px; }

/* Rechenzentrale, Kundendetail */
.eng-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 16px; }
.eng-bar code { overflow-wrap: anywhere; }
.tabs-scroll { overflow-x: auto; scrollbar-width: thin; }
.tabs-scroll button { white-space: nowrap; }
.tab-scroll { max-height: 380px; overflow: auto; }
.sub-h { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); }
.tab-scroll table + .sub-h { margin-top: 16px; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--ink-3); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li { display: grid; grid-template-columns: 118px 1fr auto; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline-list li:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  .alert { grid-template-columns: 24px 1fr; }
  .alert .al-lv { grid-column: 2; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 8px; }
  .timeline-list li { grid-template-columns: 1fr auto; } .timeline-list li > span:first-child { grid-column: 1 / -1; }
  .hb-row { grid-template-columns: minmax(70px, 38%) 1fr auto; gap: 8px; }
}
.filters + .kpis, .filters + .two { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.tbl a.ext { white-space: nowrap; overflow-wrap: normal; }
.row.wrap > h3.grow { flex: 1 1 14em; }

/* ---------- Updates ---------- */
.kpi .v.mono-v { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 24px; letter-spacing: -.02em; }
.tbl tr.row-bad td { background: var(--bad-soft); }
.tbl tr.click.row-bad:hover td { background: var(--bad-soft); filter: brightness(.98); }
.rel-cl { max-width: 340px; font-size: 13px; color: var(--ink-2); }
.rel-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rel-preview { white-space: pre-wrap; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; max-height: 240px; overflow: auto; }
.keybox { margin-top: 6px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; word-break: break-all; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; user-select: all; }
.upd-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.upd-steps li + li { margin-top: 4px; }
input[type=file] { width: 100%; padding: 7px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--panel-2); }

/* ================= Konsole 2026-09: Navigation, Seitenkopf, Farbschema ================= */
/* Dunkel auch per Schalter (ui.js setzt data-theme="dark"); Werte wie im automatischen Dunkelmodus oben */
:root[data-theme="dark"] {
  --bg: #111114; --panel: #1a1a1f; --panel-2: #202026; --ink: #f1f0ec; --ink-2: #b7b6be; --ink-3: #7d7c86;
  --line: #2c2c34; --line-2: #3a3a44; --accent: #8a7dff; --accent-ink: #0f0f14; --accent-soft: #26233f;
  --ok: #4cc58a; --ok-soft: #13291f; --warn: #f0b04a; --warn-soft: #2c2412; --bad: #ff7a7a; --bad-soft: #321919;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); color-scheme: dark;
  --s1: #3987e5; --s2: #d95926; --grid: #2a2a31; --s3: #199e70; --c-bad: #d03b3b;
}
.ic { width: 18px; height: 18px; flex: none; }
.btn .ic { width: 16px; height: 16px; }

.hub { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.hub .hub-top { display: none; }
.hub-nav { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 10px 12px; gap: 6px; }
.nav-groups { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.nav-gt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px 4px; }
.nav-i { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; width: 100%; border: 0; background: none; text-align: left;
  padding: 7px 8px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.nav-i:hover { background: var(--panel-2); color: var(--ink); }
.nav-i.on { background: var(--accent-soft); color: var(--accent); }
.nav-i[hidden] { display: none; }
.nav-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.nav-i.on .nav-ic { background: var(--panel); }
.nav-tx { min-width: 0; line-height: 1.25; }
.nav-tx b { display: block; font-weight: 650; font-size: 13.5px; color: inherit; }
.nav-tx small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-i .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; }
.nav-foot { border-top: 1px solid var(--line); padding: 12px 4px 0; display: grid; gap: 10px; }
.nav-me { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-me > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.hub .hub-main { max-width: 1280px; width: 100%; margin: 0 auto; padding: 26px 28px 70px; min-width: 0; }
.nav-scrim { display: none; }

/* Seitenkopf: Zustand + Hauptaktion */
.ph { margin: 0 0 20px; }
.ph-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.ph-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ph-ic .ic { width: 22px; height: 22px; }
.ph-t { min-width: 0; }
.ph-t h2 { margin: 0 !important; font-size: 22px; letter-spacing: -.02em; }
.ph-t p { margin: 1px 0 0; color: var(--ink-2); font-size: 13.5px; }
.ph-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ink-3);
  border-radius: 12px; padding: 10px 12px 10px 14px; }
.ph-state { display: flex; gap: 10px; align-items: center; flex: 1 1 320px; min-width: 0; font-size: 14px; }
.ph-sym { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.ph-state.ok .ph-sym { background: var(--ok-soft); color: var(--ok); }
.ph-state.warn .ph-sym { background: var(--warn-soft); color: var(--warn); }
.ph-state.bad .ph-sym { background: var(--bad-soft); color: var(--bad); }
.ph-state.info .ph-sym { background: var(--accent-soft); color: var(--accent); font-family: Georgia, serif; font-style: italic; }
.ph-bar:has(.ph-state.ok) { border-left-color: var(--ok); }
.ph-bar:has(.ph-state.warn) { border-left-color: var(--warn); }
.ph-bar:has(.ph-state.bad) { border-left-color: var(--bad); }
.ph-bar:has(.ph-state.info) { border-left-color: var(--accent); }
.ph-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.howto { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.howto summary { cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 12.5px; width: max-content; }
.howto > div { margin-top: 6px; max-width: 860px; }
.hub-main .lead { font-size: 13.5px; }

.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.sec-h h3 { margin: 0; font-size: 15px; }
.kpi-sp .kv { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.spark { width: 96px; height: 26px; flex: none; overflow: visible; margin-bottom: 6px; }
.dl-up { color: var(--ok); font-weight: 650; } .dl-down { color: var(--bad); font-weight: 650; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > table.tbl { border: 0; border-radius: 0; }
details.fold > summary { list-style-position: inside; }
.fold-b { margin-top: 14px; }
.fold-b h3 { font-size: 14px; margin: 0 0 8px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.rv { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.rv-h { margin: 14px 0 6px; font-size: 13px; color: var(--ink-2); }
.rv-h:first-child { margin-top: 0; }
.rv-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; }

@media (max-width: 900px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub .hub-top { display: flex; height: 54px; padding: 0 10px; gap: 8px; }
  .hub-where { margin-left: auto; font-weight: 650; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hub-nav { position: fixed; z-index: 800; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-104%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .hub-nav { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 790; background: rgba(15, 15, 22, .4); }
  .hub .hub-main { padding: 18px 14px 60px; }
  .ph-head { gap: 10px; } .ph-ic { width: 38px; height: 38px; }
  .ph-t h2 { font-size: 19px; }
  .ph-acts { width: 100%; } .ph-acts .btn.primary { flex: 1; justify-content: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 21px; }
  .card.kpi { padding: 12px; }
  .spark { width: 64px; }
  .kpi-sp .kv { flex-wrap: wrap; }
  /* Kundenliste: auf dem Handy nur Kunde, Tarif, Guthaben, Status, zuletzt */
  #ct tr > :nth-child(2), #ct tr > :nth-child(5), #ct tr > :nth-child(6), #ct tr > :nth-child(7), #ct tr > :nth-child(8) { display: none; }
  #agT tr > :nth-child(4), #agT tr > :nth-child(5), #agT tr > :nth-child(8) { display: none; }
  .modal-bg { padding: 8px; }
  .modal-b { padding: 14px; }
  .quick .grow { display: none; }
}
.tbl-wrap.card.flush { overflow: auto; }
@media (max-width: 900px) {
  .hub { align-content: start; }
  .hub-nav { visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  body.nav-open .hub-nav { visibility: visible; transition: transform .2s ease; }
}
.ph-t p .pill { white-space: normal; height: auto; min-height: 20px; }

/* API-Zugang (Konto) */
.api-key, .api-ex { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }
.api-key { font-size: 14px; user-select: all; }
.api-doc summary { cursor: pointer; }

/* Zahlungen (Stripe) */
.py-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.py-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.py-steps li { display: flex; gap: 10px; align-items: flex-start; }
.py-steps li b { display: block; font-size: 14px; } .py-steps li small { color: var(--ink-3); font-size: 12.5px; word-break: break-all; }
.py-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; margin-top: 1px; }
.py-steps li.ok .py-ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.py-ic .ic { width: 13px; height: 13px; }
.py-choice { display: grid; gap: 8px; }
.py-choice .ch { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.py-choice .ch.on { border-color: var(--accent); background: var(--accent-soft); }
.py-choice .ch.dis { opacity: .5; cursor: not-allowed; }
.py-choice .ch b { display: block; font-size: 14px; } .py-choice .ch small { color: var(--ink-3); font-size: 12.5px; }
.py-choice input { margin-top: 3px; accent-color: var(--accent); }
.pill.sm { height: 20px; padding: 0 8px; font-size: 11.5px; }
tr.bad td { color: var(--bad); }
