/* duftcode Zentrale: Designsystem. Hell und dunkel, nur Systemschriften, keine externen Dateien (strenge CSP). */

/* ===== 1. Farben und Maße =====
   Hell ist der Standard. Dunkel gilt bei prefers-color-scheme: dark, außer die Seite ist per Umschalter auf hell gestellt
   (html[data-theme="light"]). Per Umschalter auf dunkel gilt html[data-theme="dark"]. */
:root {
  color-scheme: light;
  --bg: #f6f6f8;
  --side-bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e8eaef;
  --line: #e5e7ec;
  --line-strong: #d1d5de;
  --ink: #0f1115;
  --ink-2: #3a3e4b;
  --muted: #596070;
  --faint: #8a90a0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-deep: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eeefff;
  --accent-line: #cfd2fb;
  --accent-text: #4036c9;
  --ring: rgba(79, 70, 229, .28);
  --focus: #4f46e5;
  --ok: #067647;
  --ok-soft: #e8f7ef;
  --ok-line: #bfe8d1;
  --warn: #8a4b06;
  --warn-soft: #fff3dc;
  --warn-line: #f6d9a4;
  --warn-dot: #d97706;
  --bad: #b3261e;
  --bad-soft: #fdeceb;
  --bad-line: #f6c6c2;
  --bad-solid: #b3261e;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --glow: rgba(99, 102, 241, .1);
  --grid: #eceef3;
  --shadow-xs: 0 1px 1px rgba(15, 17, 21, .04);
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, .05), 0 2px 8px rgba(15, 17, 21, .04);
  --shadow-md: 0 4px 12px rgba(15, 17, 21, .06), 0 16px 40px rgba(15, 17, 21, .08);
  --shadow-lg: 0 24px 64px rgba(15, 17, 21, .24);
  --scrim: rgba(15, 17, 24, .42);
  --ramp-1: #a29af0;
  --ramp-2: #7a70e8;
  --ramp-3: #4f46e5;
  --cat-1: #2a78d6;
  --cat-2: #eb6834;
  --cat-3: #1baf7a;
  --cat-4: #eda100;
  --cat-5: #e87ba4;
  --cat-6: #008300;
  --cat-7: #6250d6;
  --cat-8: #e34948;
  --radius: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --side-w: 256px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090a0e;
    --side-bg: #0c0e13;
    --surface: #111319;
    --surface-2: #171a22;
    --surface-3: #1f232d;
    --line: #232734;
    --line-strong: #343a4a;
    --ink: #f1f2f6;
    --ink-2: #c8cbd6;
    --muted: #9aa0b1;
    --faint: #686e80;
    --accent: #8f90fa;
    --accent-hover: #a3a4ff;
    --accent-deep: #7a7bf0;
    --accent-ink: #0b0c14;
    --accent-soft: rgba(143, 144, 250, .15);
    --accent-line: rgba(143, 144, 250, .34);
    --accent-text: #b9baff;
    --ring: rgba(143, 144, 250, .38);
    --focus: #a3a4ff;
    --ok: #5ad8a6;
    --ok-soft: rgba(52, 211, 153, .12);
    --ok-line: rgba(52, 211, 153, .3);
    --warn: #f5c451;
    --warn-soft: rgba(245, 158, 11, .12);
    --warn-line: rgba(245, 158, 11, .32);
    --warn-dot: #f59e0b;
    --bad: #ff8f86;
    --bad-soft: rgba(248, 113, 113, .12);
    --bad-line: rgba(248, 113, 113, .32);
    --bad-solid: #d92d20;
    --grad: linear-gradient(135deg, #7578ff 0%, #9b6cff 55%, #e056f5 100%);
    --glow: rgba(129, 140, 248, .15);
    --grid: #1a1d27;
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 10px rgba(0, 0, 0, .3);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .4);
    --shadow-lg: 0 28px 72px rgba(0, 0, 0, .7);
    --scrim: rgba(3, 4, 8, .62);
    --ramp-1: #5f5bd0;
    --ramp-2: #7f7ce6;
    --ramp-3: #a3a4ff;
    --cat-1: #3987e5;
    --cat-2: #d95926;
    --cat-3: #199e70;
    --cat-4: #c98500;
    --cat-5: #d55181;
    --cat-6: #008300;
    --cat-7: #9085e9;
    --cat-8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090a0e;
  --side-bg: #0c0e13;
  --surface: #111319;
  --surface-2: #171a22;
  --surface-3: #1f232d;
  --line: #232734;
  --line-strong: #343a4a;
  --ink: #f1f2f6;
  --ink-2: #c8cbd6;
  --muted: #9aa0b1;
  --faint: #686e80;
  --accent: #8f90fa;
  --accent-hover: #a3a4ff;
  --accent-deep: #7a7bf0;
  --accent-ink: #0b0c14;
  --accent-soft: rgba(143, 144, 250, .15);
  --accent-line: rgba(143, 144, 250, .34);
  --accent-text: #b9baff;
  --ring: rgba(143, 144, 250, .38);
  --focus: #a3a4ff;
  --ok: #5ad8a6;
  --ok-soft: rgba(52, 211, 153, .12);
  --ok-line: rgba(52, 211, 153, .3);
  --warn: #f5c451;
  --warn-soft: rgba(245, 158, 11, .12);
  --warn-line: rgba(245, 158, 11, .32);
  --warn-dot: #f59e0b;
  --bad: #ff8f86;
  --bad-soft: rgba(248, 113, 113, .12);
  --bad-line: rgba(248, 113, 113, .32);
  --bad-solid: #d92d20;
  --grad: linear-gradient(135deg, #7578ff 0%, #9b6cff 55%, #e056f5 100%);
  --glow: rgba(129, 140, 248, .15);
  --grid: #1a1d27;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .4);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, .7);
  --scrim: rgba(3, 4, 8, .62);
  --ramp-1: #5f5bd0;
  --ramp-2: #7f7ce6;
  --ramp-3: #a3a4ff;
  --cat-1: #3987e5;
  --cat-2: #d95926;
  --cat-3: #199e70;
  --cat-4: #c98500;
  --cat-5: #d55181;
  --cat-6: #008300;
  --cat-7: #9085e9;
  --cat-8: #e66767;
}

/* ===== 2. Grundlagen ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1100px 420px at 78% -160px, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px/1.55 var(--font);
  letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.22; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: clamp(1.55rem, 1.25rem + 1vw, 2.05rem); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 1.0625rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
pre { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; overflow: auto; margin: 8px 0 0; }
kbd { font: 600 .72rem/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ico { flex: none; }
svg.spark { overflow: visible; display: block; }
.spark-ring { stroke: var(--surface); }

/* ===== 3. Gerüst: Seitenleiste, Kopfzeile, Inhalt ===== */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px 14px; background: var(--side-bg); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; text-decoration: none; color: var(--ink); border-radius: 12px; }
.brand:hover { color: var(--ink); }
.brandmark { flex: none; border-radius: 10px; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: .98rem; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.navgroup { display: flex; flex-direction: column; gap: 1px; }
.navgroup-title { padding: 0 10px 5px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.navlink {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 560; font-size: .92rem; transition: background .15s, color .15s;
}
.navlink .ico { color: var(--muted); transition: color .15s; }
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink:hover .ico { color: var(--ink-2); }
.navlink[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.navlink[aria-current="page"] .ico { color: var(--accent-text); }
.navlink[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.navlink-label { flex: 1; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.side-foot { display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.modepill { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.modepill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.modepill.demo i { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-soft); }
.userbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .82rem; }
.userbox .user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 560; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); justify-self: start; }
.theme-switch button { display: grid; place-items: center; width: 34px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: .84rem; font-weight: 600; text-align: center; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px;
  padding: 0 clamp(16px, 3vw, 40px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-l { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .9rem; }
.topbar-brand { display: none; line-height: 0; margin-right: 4px; }
.crumb-root { color: var(--muted); }
.crumb-sep { color: var(--faint); }
.crumb { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-r { display: flex; align-items: center; gap: 8px; }
.searchbtn {
  display: inline-flex; align-items: center; gap: 10px; min-width: 260px; height: 36px; padding: 0 8px 0 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.searchbtn:hover { border-color: var(--faint); color: var(--ink-2); }
.searchbtn-text { flex: 1; text-align: left; font-size: .88rem; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; box-shadow: var(--shadow-xs); }
.iconbtn:hover { background: var(--surface-2); }
.only-mobile { display: none; }
.main { padding: 28px clamp(16px, 3vw, 40px) 72px; max-width: 1360px; width: 100%; outline: none; }
.page { animation: rise .35s var(--ease) both; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead-text { min-width: 0; max-width: 62ch; }
.pagehead h1 { margin-bottom: 6px; }
.pagehead p { margin: 0; color: var(--muted); }
.pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }

/* ===== 4. Karten, Raster, Kennzahlen ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card + .card { margin-top: 16px; }
.card > h2:first-child, .card-hd { margin-bottom: 12px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-hd h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card.ai {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  box-shadow: var(--shadow-sm), 0 10px 40px -12px rgba(124, 92, 240, .35);
}
.grid { display: grid; gap: 16px; }
.grid > .card, .grid > .card + .card, .stack > .card + .card, .cmd .card + .card, .stacklist > .card + .card { margin-top: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.g21 { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.5fr); }
.stack { display: grid; gap: 16px; align-content: start; }
.tile { padding: 16px 16px 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
.tile .value { font-size: clamp(1.4rem, 1.05rem + .85vw, 1.85rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 2px; font-variant-numeric: proportional-nums; white-space: nowrap; }
.tile .sub { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.stat-visual { margin-top: 10px; }
.stat.linked { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.stat.linked:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 4px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.up { color: var(--ok); }
.down { color: var(--bad); }

/* ===== 5. Bedienelemente ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 620; font-size: .9rem; line-height: 1.2; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent-deep); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(60, 50, 200, .35); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: .82rem; border-radius: 8px; gap: 6px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled, a[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
a.btn.primary { color: var(--accent-ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { justify-content: space-between; }
.right { margin-left: auto; }

input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--faint); background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
input[type=file] { max-width: 100%; font-size: .88rem; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 620; margin-right: 12px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--surface-2); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 620; font-size: .86rem; margin-bottom: 6px; color: var(--ink-2); }
label.field > small { display: block; color: var(--muted); margin-top: 4px; font-size: .8rem; }
.searchfield { position: relative; }
.searchfield .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchfield input { padding-left: 38px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; min-height: 22px; border-radius: 999px; font-size: .74rem; font-weight: 640; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; line-height: 1.3; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.chip.ai { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-md); font-size: .88rem; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px; color: var(--ink-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice b { font-weight: 700; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 4px; }
.empty b { color: var(--ink); }
.empty p { margin: 0; max-width: 46ch; }
.tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 620; font-size: .88rem; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ===== 6. Tabellen ===== */
.tablewrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { border-radius: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); font-size: 1rem; }
tr.sub td { color: var(--muted); }
.table-tools { margin-bottom: 12px; }

/* ===== 7. Hinweis-Karten, Aktionen, Details ===== */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .88rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.action { display: grid; gap: 12px; }
.action + .action { margin-top: 0; }
.action header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.action h3 { font-size: 1rem; margin: 0 0 2px; }
.action .why { color: var(--ink-2); font-size: .9rem; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); }
.stacklist { display: grid; gap: 12px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.group-title h2 { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; margin-top: 2px; }
.dot.done { background: var(--ok); border-color: var(--ok); }
.dot.warn { border-color: var(--warn-dot); }
.card ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.card ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.section-title { margin: 28px 0 12px; }

/* ===== 8. Heute: Command Center ===== */
.hello { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cmd { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.cmd > .stack { min-width: 0; }
.brief h2 { font-size: 1.15rem; margin-bottom: 4px; }
.brief .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.brief ul { margin: 0 0 14px; padding-left: 20px; }
.brief h3 { margin: 4px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--grad); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { margin: 0; }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 10px; margin: 0 -10px; border-radius: var(--r-md); text-decoration: none; color: inherit; transition: background .12s; }
.feed-item:hover { background: var(--surface-2); color: inherit; }
.feed li + li .feed-item { border-top: 1px solid transparent; }
.feed-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.feed-ico.warn { background: var(--warn-soft); color: var(--warn); }
.feed-ico.bad { background: var(--bad-soft); color: var(--bad); }
.feed-ico.ok { background: var(--ok-soft); color: var(--ok); }
.feed-title { font-weight: 640; line-height: 1.35; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-why { color: var(--muted); font-size: .84rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.feed-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.feed-go { align-self: center; color: var(--faint); transition: transform .15s var(--ease), color .15s; }
.feed-item:hover .feed-go { transform: translateX(2px); color: var(--accent-text); }
.queue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.queue a { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.queue a:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.queue b { font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: proportional-nums; }
.queue span { color: var(--muted); font-size: .8rem; }
.agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.agent.ok .agent-dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok-line); animation: pulse 2.4s ease-out infinite; }
.agent.bad .agent-dot { background: var(--bad-solid); }
.agent-text { display: grid; line-height: 1.25; min-width: 0; }
.agent-name { font-weight: 640; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-meta { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel { display: grid; }
.fstage .fhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.fstage .fname { color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.fstage .fval { font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: proportional-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ramp-3); }
.fconn { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; padding: 10px 0 12px 2px; }
.fconn b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fconn .ico { color: var(--faint); }
details.tableview { margin-top: 12px; }
details.tableview summary { cursor: pointer; font-size: .82rem; font-weight: 620; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
details.tableview summary::-webkit-details-marker { display: none; }
details.tableview summary::before { content: "▸"; font-size: .7rem; transition: transform .15s; }
details.tableview[open] summary::before { transform: rotate(90deg); }
.learn li { margin-bottom: 2px; }

/* Diagramme */
.colchart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.cc-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: .72rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-plot { position: relative; }
.cc-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cc-grid i { display: block; height: 1px; background: var(--grid); }
.cc-cols { position: absolute; inset: 0; display: grid; }
.cc-col { display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.cc-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .92; transition: opacity .15s, filter .15s; transform-origin: bottom; animation: grow .6s var(--ease) both; }
.cc-col:hover .cc-bar { opacity: 1; filter: brightness(1.12); }
.cc-x { grid-column: 2; display: grid; margin-top: 8px; }
.cc-x span { text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.split-bar { display: flex; gap: 2px; height: 14px; margin: 4px 0 16px; }
.seg { display: block; min-width: 3px; border-radius: 3px; }
.seg:first-child { border-radius: 7px 3px 3px 7px; }
.seg:last-child { border-radius: 3px 7px 7px 3px; }
.cat-1 { background: var(--cat-1); } .cat-2 { background: var(--cat-2); } .cat-3 { background: var(--cat-3); } .cat-4 { background: var(--cat-4); }
.cat-5 { background: var(--cat-5); } .cat-6 { background: var(--cat-6); } .cat-7 { background: var(--cat-7); } .cat-8 { background: var(--cat-8); }
.split-legend { list-style: none; padding: 0; margin: 0; display: grid; }
.split-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.split-legend li:last-child { border-bottom: 0; }
.sw { width: 10px; height: 10px; border-radius: 3px; }
.split-legend .v { font-weight: 640; font-variant-numeric: tabular-nums; }
.split-legend .p { text-align: right; font-variant-numeric: tabular-nums; font-size: .8rem; }

/* ===== 9. Support ===== */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.convlist { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 210px); overflow: auto; padding: 2px; }
.conv { text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; transition: border-color .15s, background .15s, box-shadow .15s; }
.conv:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.conv[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.avatar { grid-row: span 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-weight: 700; font-size: .82rem; letter-spacing: 0; }
.conv .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.conv .snippet { color: var(--muted); font-size: .85rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.conv .row { gap: 6px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 16px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); border-radius: 16px 16px 6px 16px; }
.bubble time { display: block; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.draftbox { border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 16px; background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface); }

/* ===== 10. Creator ===== */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(236px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-top: 16px; scroll-snap-type: x proximity; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 140px; scroll-snap-align: start; }
.col h3 { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; font-size: .84rem; }
.col h3 .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.crcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 8px; display: grid; gap: 6px; box-shadow: var(--shadow-xs); }
.crcard .name { font-weight: 650; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.crcard .name .avatar { width: 26px; height: 26px; font-size: .7rem; grid-row: auto; }
.score { height: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.score i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ===== 11. Startplan und Voreinstellungen ===== */
.hero { border-color: var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--grad); opacity: .12; filter: blur(30px); pointer-events: none; }
.today { margin: 8px 0 16px; padding-left: 22px; display: grid; gap: 10px; }
.today li::marker { font-weight: 700; color: var(--accent-text); }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s var(--ease); }
.step { padding: 0; transition: border-color .15s; }
.step[open] { border-color: var(--line-strong); }
.step summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 14px 18px; flex-wrap: wrap; border-radius: var(--radius); }
.step summary::-webkit-details-marker { display: none; }
.step summary:hover { background: var(--surface-2); }
.step input[type=checkbox] { width: 20px; height: 20px; }
.step .steptitle { font-weight: 640; flex: 1 1 260px; letter-spacing: -.01em; }
.step.done .steptitle { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.step .chev { color: var(--faint); transition: transform .2s var(--ease); }
.step[open] .chev { transform: rotate(90deg); }
.stepbody { padding: 0 18px 18px 50px; display: grid; gap: 10px; }
.stepbody ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.startlink { display: block; color: var(--ink); text-decoration: none; margin-bottom: 16px; transition: border-color .15s, box-shadow .15s; }
.startlink:hover { color: var(--ink); border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.phase { margin-top: 28px; }
.phase-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.phase-head h2 { margin: 0; }
.stepgroup { display: grid; gap: 10px; }
.stepgroup .card + .card { margin-top: 0; }
.presets { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tablewrap > table { min-width: 600px; }
.preset { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; background: var(--surface); align-content: start; transition: border-color .15s, box-shadow .15s; }
.preset:hover { box-shadow: var(--shadow-md); }
.preset.active { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.preset .btn { width: 100%; }
.preset p { margin: 0; color: var(--ink-2); }
.preset .kv { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.preset .kv dd { text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; }

/* ===== 12. Werbung ===== */
.idea { display: grid; gap: 10px; align-content: start; }
.idea.dim { opacity: .55; }
.idea blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-md) var(--r-md) 0; font-weight: 640; letter-spacing: -.01em; }
.idea ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.hooks { display: flex; flex-wrap: wrap; gap: 8px; }
.hook { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; text-align: left; font-size: .88rem; transition: border-color .15s, background .15s, transform .08s; box-shadow: var(--shadow-xs); }
.hook:hover { border-color: var(--accent); background: var(--accent-soft); }
.hook:active { transform: scale(.98); }

/* ===== 13. Regeln und Verbindungen ===== */
.rulegroup { margin-top: 16px; }
.rule { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 340px); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rule:last-child { border-bottom: 0; padding-bottom: 0; }
.rule b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
.rule small { color: var(--muted); font-size: .84rem; line-height: 1.45; display: block; }
.conn-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.conn-hd h2 { margin: 0; display: flex; align-items: center; gap: 12px; }
.conn-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.conn-ico.ok { background: var(--ok-soft); color: var(--ok); }
.conn-ico.warn { background: var(--warn-soft); color: var(--warn); }
.conn-ico.bad { background: var(--bad-soft); color: var(--bad); }
.steps-list { margin: 8px 0 14px; padding-left: 22px; display: grid; gap: 8px; }

/* ===== 14. Anmeldung ===== */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(420px, 100%); padding: 28px; box-shadow: var(--shadow-md); }
.login-brand { display: grid; justify-items: start; gap: 4px; margin-bottom: 20px; }
.login-brand .brandmark { margin-bottom: 8px; }
.login-brand h1 { font-size: 1.5rem; margin: 0; }
.login-brand p { margin: 0; }

/* ===== 15. Hinweise, Kurzinfos, Palette, Sheet ===== */
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: 250; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 10px 10px 10px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: min(92vw, 460px); pointer-events: auto; animation: toast-in .25s var(--ease) both; font-size: .9rem; font-weight: 560; }
.toast.error { background: var(--bad-solid); color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.toast-ico { display: grid; color: #7ee2b0; }
.toast.error .toast-ico { color: #fff; }
.toast-text { flex: 1; overflow-wrap: anywhere; }
.toast-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.toast-x:hover { opacity: 1; background: rgba(255, 255, 255, .14); }
.tip { position: fixed; z-index: 260; left: 0; top: 0; max-width: 300px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .78rem; font-weight: 560; line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-md); font-variant-numeric: tabular-nums; }
.tip.show { opacity: 1; }
.pal-backdrop, .sheet-backdrop { position: fixed; inset: 0; z-index: 200; background: var(--scrim); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade .18s ease both; }
.pal-backdrop { display: grid; align-items: start; justify-items: center; padding: 12vh 12px 12px; }
.pal { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s var(--ease) both; }
.pal:focus-within { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 3px var(--ring); }
.pal-bar { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-input, .pal-input:hover, .pal-input:focus-visible { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; box-shadow: none; padding: 0; font-size: 1.05rem; color: var(--ink); min-height: 40px; }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.pal-group { padding: 10px 12px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.pal-item.active { background: var(--accent-soft); }
.pal-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.pal-item.active .pal-ico { background: var(--surface); color: var(--accent-text); }
.pal-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.pal-label { font-weight: 640; display: flex; align-items: center; gap: 8px; }
.pal-here { font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.pal-hint { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-grp { font-size: .74rem; color: var(--muted); }
.pal-enter { color: var(--muted); font-size: .9rem; opacity: 0; }
.pal-item.active .pal-enter { opacity: 1; }
.pal-none { padding: 28px 12px; text-align: center; color: var(--muted); }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); background: var(--surface-2); }
.pal-foot kbd { margin-right: 3px; }
.pal-foot-end { margin-left: auto; }
.sheet-backdrop { display: grid; align-items: end; }
.sheet { background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet-in .28s var(--ease) both; max-height: 86vh; overflow: auto; }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-item { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: .82rem; font-weight: 600; text-align: center; }
.sheet-item[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.sheet-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-xs); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== 16. Ladezustände ===== */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 40%, var(--surface-2) 60%); background-size: 400% 100%; border-radius: 8px; animation: shimmer 1.5s linear infinite; }
.sk-title { height: 30px; width: min(260px, 60%); margin-bottom: 12px; }
.sk-sub { height: 14px; width: min(420px, 80%); }
.sk-line { height: 14px; margin-bottom: 12px; width: 90%; }
.sk-line.short { width: 45%; }
.sk-value { height: 30px; width: 65%; margin: 8px 0 14px; }
.sk-spark { height: 40px; }
.sk-block { height: 150px; border-radius: 12px; }

/* ===== 17. Bewegung ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ok-line); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none !important; }
}

/* ===== 18. Bildschirmgrößen ===== */
@media (max-width: 1180px) {
  .g5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .g5 > :nth-child(-n+3) { grid-column: span 2; }
  .g5 > :nth-child(n+4) { grid-column: span 3; }
  .cmd { grid-template-columns: 1fr; }
  .cmd > .stack { display: contents; }
  .cmd > .stack > * { order: var(--o, 0); }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { height: 54px; }
  .topbar-brand { display: block; }
  .crumb-root, .crumb-sep { display: none; }
  .crumb { font-size: 1rem; }
  .searchbtn { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .searchbtn-text, .searchbtn kbd { display: none; }
  .only-mobile { display: inline-grid; }
  .main { padding-top: 20px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .g2, .g3 { grid-template-columns: 1fr 1fr; }
  .g21 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .convlist { max-height: 340px; }
  .rule { grid-template-columns: 1fr; gap: 10px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; border: 0; background: transparent; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 640; cursor: pointer; min-width: 0; }
  .tab:hover { color: var(--ink); }
  .tab[aria-current="page"], .tab.on { color: var(--accent-text); background: var(--accent-soft); }
  .tab-ico { position: relative; display: grid; place-items: center; width: 24px; height: 24px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; }
  .tab .badge { position: absolute; top: -3px; left: calc(100% + 3px); height: 17px; min-width: 17px; padding: 0 5px; font-size: .64rem; box-shadow: 0 0 0 2px var(--surface); }
  #toasts { left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .pal-backdrop { padding-top: 8vh; }
  .pal-foot { display: none; }
}
@media (min-width: 861px) {
  .tabbar { display: none; }
}
@media (max-width: 700px) {
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 > :nth-child(n) { grid-column: auto; }
  .g5 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .g3 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .tile { padding: 14px 14px 12px; }
  .pagehead { margin-bottom: 18px; }
  .pagehead-actions, .pagehead-actions .btn { width: 100%; }
  .pagehead-actions .row { width: 100%; }
  .bubble { max-width: 92%; }
  .stepbody { padding-left: 18px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; font-size: .78rem; }
  .sheet-grid { gap: 8px; }
}
@media (forced-colors: active) {
  .btn.primary, .badge, .chip { border: 1px solid CanvasText; }
  .cc-bar, .seg, .meter i, .score i, .progress i { forced-color-adjust: none; }
}

/* ===== Messlatte (Heute) ===== */
.gauge { position: relative; }
.meter.ok { background: var(--ok-soft); }
.meter.ok i { background: var(--ok); }
.meter.bad { background: var(--bad-soft); }
.meter.bad i { background: var(--bad-solid); }
.gauge-mark { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.split-bar.thin { height: 8px; margin: 0; }
.fconn-body { flex: 1; display: grid; gap: 8px; min-width: 0; }
.alerts { margin-bottom: 8px; }
.action-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.action-head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }

.section-label { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; font-size: .84rem; }
.section-label b { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* Schlüssel eintragen (Verbindungen) */
.secret-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.6fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.secret-row:first-of-type { border-top: 0; }
@media (max-width: 760px) { .secret-row { grid-template-columns: 1fr; gap: 8px; } }

/* Systemcheck */
.check { border-left: 4px solid var(--line); }
.check.ok { border-left-color: var(--ok); }
.check.warn { border-left-color: var(--warn); }
.check.bad { border-left-color: var(--bad); }
.check-todo { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }

/* Bestellungen */
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 620; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live-pill .dot.on { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.live-pill .dot.off { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-pill .dot.on { animation: none; } }
table.orders td { vertical-align: top; }
.order-row { cursor: pointer; }
.order-row:hover, .order-row.open { background: var(--surface-2); }
.order-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.order-row.flash { animation: flash 6s ease-out; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.order-items { max-width: 340px; }
td.pos, .pos { color: var(--ok); }
td.neg, .neg { color: var(--bad); }
.order-detail-row > td { background: var(--surface-2); padding: 14px 16px; }
.order-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.order-detail h3 { margin: 0 0 6px; font-size: .86rem; color: var(--muted); font-weight: 650; }
.order-detail table td { padding: 3px 0; border: 0; }
@media (max-width: 760px) { .order-detail { grid-template-columns: 1fr; } }

/* Kostenanzeige */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter i.warn { background: var(--warn); }
.meter i.bad { background: var(--bad); }

