/* =====================================================================
   QRYSTAL · Design System
   Drei Handschriften, ein System:
   · Orbit  (Starlink)   – tiefes Schwarz, Glas, Konturlinien, gesperrte Versalien
   · Signal (Vodafone)   – Rot als Handlungsfarbe, Licht/Fett-Typografie, 20px-Karten, Pills
   · Ribbon (Unitymedia) – Fäden & Bänder, Linien-Icons im Kreis, zweistufige Navigation
   ===================================================================== */

/* ---------- Schriften (lokal, DSGVO-konform) ---------- */
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-ExtraBold.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-ExtraBold.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Signal (Vodafone) */
  --red: #e60000;
  --red-2: #bd0000;
  --red-deep: #820000;
  --red-glow: color-mix(in srgb, var(--red) 35%, transparent);
  --on-accent: #ffffff;
  --on-accent-deep: #ffffff;

  /* Ribbon (Unitymedia) */
  --cyan: #46cdeb;
  --teal: #14b7d7;
  --green: #1e9b41;
  --green-2: #40920f;
  --purple: #782d9b;
  --navy: #2d4196;
  --navy-deep: #1a2977;
  --thread: linear-gradient(90deg, var(--cyan) 0%, var(--teal) 30%, var(--green) 62%, var(--purple) 100%);
  --thread-flex: linear-gradient(110deg, var(--cyan), var(--green) 45%, var(--purple) 80%, var(--navy));

  /* Orbit (Starlink) – dunkles Standard-Theme */
  --bg: #000;
  --bg-2: #08080a;
  --bg-3: #111113;
  --surface: #121214;
  --surface-2: #19191c;
  --surface-3: #222226;
  --glass: rgba(39, 39, 40, .62);
  --glass-strong: rgba(30, 30, 32, .84);
  --glass-blur: blur(28px) saturate(190%) brightness(115%);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --line-3: rgba(255, 255, 255, .24);
  --text: #fafafa;
  --text-2: rgba(250, 250, 250, .74);
  --muted: rgba(250, 250, 250, .56);
  --faint: rgba(250, 250, 250, .36);
  --input: rgba(255, 255, 255, .04);
  --input-focus: rgba(255, 255, 255, .07);
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -12px rgba(0,0,0,.8);
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 80px -20px rgba(0,0,0,.9);
  --ok: #33c26b;
  --warn: #f5a524;
  --danger: #ff4d4d;
  --info: #46cdeb;
  --contour-opacity: .07;
  --heading-grad: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.72) 100%);
  --util-bg: #0b0b0d;
  --util-bg-light: #4a4d4e;
  --tint-1: var(--navy);
  --tint-2: var(--purple);

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 68px;
  --util-h: 34px;
  --maxw: 1360px;
  color-scheme: dark;
}

/* Daylight – helles Theme (Unitymedia-Luftigkeit) */
:root[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-2: #eef0f7;
  --bg-3: #e6e8f1;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --surface-3: #eceef6;
  --glass: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-blur: blur(24px) saturate(180%);
  --line: rgba(13, 18, 45, .08);
  --line-2: rgba(13, 18, 45, .14);
  --line-3: rgba(13, 18, 45, .24);
  --text: #0d0f1a;
  --text-2: rgba(13, 15, 26, .78);
  --muted: rgba(13, 15, 26, .58);
  --faint: rgba(13, 15, 26, .4);
  --input: #fff;
  --input-focus: #fff;
  --shadow-1: 0 1px 2px rgba(20, 30, 80, .06), 0 8px 24px -12px rgba(20, 30, 80, .18);
  --shadow-2: 0 2px 6px rgba(20, 30, 80, .06), 0 30px 70px -24px rgba(20, 30, 80, .3);
  --contour-opacity: .09;
  --heading-grad: linear-gradient(90deg, #0d0f1a 0%, #2d4196 120%);
  color-scheme: light;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "lnum";
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic.inline { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.eyebrow .ic, .badge .ic { width: 13px; height: 13px; }
.kind-card .k-title .ic { width: 20px; height: 20px; }
.qc-meta .ic, .row.tiny .ic { width: 14px; height: 14px; }
.label .ic, .acc > summary .ic { width: 18px; height: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Hintergrund: Konturlinien (Orbit) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--navy) 22%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--purple) 14%, transparent), transparent 60%),
    var(--bg);
}
.backdrop::before {
  content: ""; position: absolute; inset: -5%;
  background: url("../img/contours.svg") center / cover no-repeat;
  opacity: var(--contour-opacity);
}
:root[data-theme="light"] .backdrop::before { filter: invert(1) hue-rotate(180deg); }
.backdrop .stars {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 84%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 76%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 32%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 46%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 88%, rgba(255,255,255,.7) 50%, transparent 51%);
}
:root[data-theme="light"] .backdrop .stars { display: none; }

/* ---------- Typografie (Signal: Licht + Fett) ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 300; letter-spacing: -.012em; line-height: 1.08; }
h1 b, h2 b, h3 b, .display b { font-weight: 700; }
.display { font-size: clamp(40px, 6vw, 78px); font-weight: 300; letter-spacing: -.025em; line-height: .98; }
.display-sm { font-size: clamp(30px, 4vw, 48px); font-weight: 300; letter-spacing: -.02em; line-height: 1.04; }
.grad-text { background: var(--heading-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 { font-size: clamp(30px, 3.6vw, 44px); }
h2 { font-size: clamp(22px, 2.4vw, 30px); }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
.lead { font-size: 17px; color: var(--text-2); line-height: 1.55; max-width: 62ch; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.wordmark {
  font-weight: 600; letter-spacing: .34em; text-transform: uppercase; font-size: 15px; line-height: 1;
}
.num { font-variant-numeric: tabular-nums; }
.price-like { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.price-like small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.text-red { color: var(--red); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--gap, 20px); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 32px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* ---------- Utility-Leiste (Unitymedia/Vodafone-Segmentleiste) ---------- */
.util-bar {
  height: var(--util-h); display: flex; align-items: center;
  background: var(--util-bg); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted);
  position: relative; z-index: 41;
}
:root[data-theme="light"] .util-bar { background: var(--util-bg-light); color: rgba(255,255,255,.8); border-color: transparent; }
.util-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; }
.util-tabs { display: flex; height: 100%; }
.util-tabs a {
  display: flex; align-items: center; padding: 0 14px; height: 100%; color: inherit; position: relative; transition: color .2s, background .2s;
}
.util-tabs a:hover { color: var(--text); }
:root[data-theme="light"] .util-tabs a:hover { color: #fff; }
.util-tabs a.active { background: var(--bg); color: var(--text); }
:root[data-theme="light"] .util-tabs a.active { background: var(--surface); color: #0d0f1a; }
.util-right { display: flex; align-items: center; gap: 16px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(51,194,107,.18); }
.util-btn { background: none; border: 0; padding: 4px 6px; cursor: pointer; color: inherit; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; }
.util-btn:hover { color: var(--text); }
:root[data-theme="light"] .util-btn:hover { color: #fff; }

/* ---------- Kopfzeile (Glas, Orbit) ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="light"] .app-header { background: color-mix(in srgb, var(--surface) 72%, transparent); }
.app-header .container { display: flex; align-items: center; gap: 28px; height: 100%; }
.app-header::after {
  /* feiner Faden unter der Kopfzeile */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--thread); opacity: .55;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); line-height: 1; padding-left: 1px; border-left: 0; }
.brand-split { display: flex; align-items: center; gap: 12px; }
.brand-split .sep { width: 1px; height: 26px; background: var(--line-2); }
.brand-split .ctx { font-size: 12px; line-height: 1.25; color: var(--muted); }
.brand-split .ctx b { display: block; color: var(--text); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.main-nav a {
  position: relative; padding: 9px 14px; border-radius: var(--r-pill); font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color .2s, background .2s; white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
:root[data-theme="light"] .main-nav a:hover { background: rgba(13,18,45,.05); }
.main-nav a.active { color: var(--text); background: rgba(255,255,255,.08); }
:root[data-theme="light"] .main-nav a.active { background: rgba(13,18,45,.07); }
.main-nav a .pill-count { margin-left: 6px; font-size: 11px; background: var(--red); color: var(--on-accent); border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn.nav-toggle { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: rgba(255,255,255,.03); cursor: pointer; transition: border-color .2s, background .2s; color: var(--text);
}
.user-chip:hover { border-color: var(--line-2); background: rgba(255,255,255,.06); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--navy)); flex-shrink: 0; letter-spacing: .02em;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.user-chip .meta { display: flex; flex-direction: column; line-height: 1.15; padding-right: 6px; }
.user-chip .meta b { font-size: 13px; font-weight: 600; }
.user-chip .meta span { font-size: 11px; color: var(--muted); }

/* ---------- Buttons (Signal-Pills) ---------- */
.btn {
  --bh: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--bh); padding: 0 20px;
  border-radius: var(--r-pill); border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  white-space: nowrap; user-select: none; transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s, box-shadow .25s, opacity .2s;
  background: var(--surface-3); color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--red); color: var(--on-accent); box-shadow: 0 8px 24px -10px var(--red-glow); }
.btn-primary:hover { background: color-mix(in srgb, var(--red) 86%, #fff); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--red) 55%, transparent); }
.btn-light { background: #fff; color: #000; }
.btn-light:hover { background: #ececec; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-3); background: rgba(255,255,255,.04); }
:root[data-theme="light"] .btn-ghost:hover { background: rgba(13,18,45,.04); }
.btn-glass { background: var(--glass); border-color: var(--line); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.btn-glass:hover { border-color: var(--line-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: color-mix(in srgb, var(--green) 86%, #fff); }
.btn-danger { background: transparent; border-color: rgba(255,77,77,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,77,77,.1); }
.btn-sm { --bh: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { --bh: 28px; padding: 0 11px; font-size: 12px; gap: 6px; }
.btn-xs svg { width: 14px; height: 14px; }
.btn-lg { --bh: 50px; padding: 0 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-text { background: none; border: 0; padding: 0; height: auto; color: var(--text-2); font-weight: 600; }
.btn-text:hover { color: var(--text); }
/* runder Pfeil-Button (Vodafone) */
.btn-round {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; border: 0; cursor: pointer;
  background: var(--red); color: var(--on-accent); transition: transform .2s var(--ease), background .2s; flex-shrink: 0;
}
.btn-round:hover { transform: translateX(2px); background: color-mix(in srgb, var(--red) 86%, #fff); }
.btn-round.light { background: #fff; color: #111; }
.btn-round svg { width: 18px; height: 18px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
:root[data-theme="light"] .icon-btn:hover { background: rgba(13,18,45,.06); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.bordered { border-color: var(--line-2); }

/* ---------- Segment-Schalter (Starlink „Privat | Business“) ---------- */
.seg {
  display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid var(--line);
  gap: 2px; position: relative;
}
:root[data-theme="light"] .seg { background: rgba(13,18,45,.05); }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px;
  color: var(--muted); transition: color .2s, background .2s, box-shadow .2s; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: rgba(255,255,255,.16); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 2px 8px rgba(0,0,0,.35); }
:root[data-theme="light"] .seg button.active { background: #fff; box-shadow: 0 1px 3px rgba(13,18,45,.14); }
.seg.lg button { padding: 10px 20px; font-size: 14px; }
.seg svg { width: 16px; height: 16px; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1);
  position: relative;
}
.card-pad { padding: 24px; }
.card-pad-lg { padding: 32px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 16px; }
.card-body { padding: 22px; }
.card-glass {
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow-2);
}
.card-hover { transition: transform .35s var(--ease-out), border-color .25s, box-shadow .35s; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
/* Vodafone-Kartenstapel-Optik */
.stacked { position: relative; }
.stacked::before, .stacked::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line);
  z-index: -1; transform: translate(8px, 8px) rotate(1.2deg); opacity: .6;
}
.stacked::after { transform: translate(16px, 16px) rotate(2.4deg); opacity: .3; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.08); color: var(--text-2); white-space: nowrap;
}
:root[data-theme="light"] .badge { background: rgba(13,18,45,.06); }
.badge-flex { background: var(--thread-flex); color: #fff; box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--cyan) 60%, transparent); }
.badge-static { background: rgba(255,255,255,.1); color: var(--text); }
.badge-red { background: color-mix(in srgb, var(--red) 16%, transparent); color: color-mix(in srgb, var(--red) 65%, var(--text)); }
:root[data-theme="light"] .badge-red { color: var(--red-2); }
.badge-ok { background: rgba(51,194,107,.15); color: var(--ok); }
.badge-warn { background: rgba(245,165,36,.16); color: var(--warn); }
.badge-muted { background: rgba(255,255,255,.06); color: var(--muted); }
.badge-role-admin { background: color-mix(in srgb, var(--red) 18%, transparent); color: color-mix(in srgb, var(--red) 62%, var(--text)); }
.badge-role-superuser { background: color-mix(in srgb, var(--purple) 24%, transparent); color: color-mix(in srgb, var(--purple) 55%, var(--text)); }
.badge-role-master { background: color-mix(in srgb, var(--navy) 30%, transparent); color: color-mix(in srgb, var(--navy) 50%, var(--text)); }
.badge-role-slave { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: color-mix(in srgb, var(--cyan) 70%, var(--text)); }
:root[data-theme="light"] .badge-role-admin { color: var(--red-2); }
:root[data-theme="light"] .badge-role-superuser { color: var(--purple); }
:root[data-theme="light"] .badge-role-master { color: var(--navy); }
:root[data-theme="light"] .badge-role-slave { color: #0b7f97; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(51,194,107,.16); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,165,36,.16); }
.dot.off { background: var(--faint); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.field > label.switch, .field > label.check { justify-content: flex-start; gap: 12px; font-size: 14px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); line-height: 1.4; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--input);
  color: var(--text); outline: none; transition: border-color .2s, background .2s, box-shadow .2s; font-size: 14.5px;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--cyan); background: var(--input-focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 14%, transparent); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,77,77,.12); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option { background: var(--surface-2); color: var(--text); }
.input-group { display: flex; align-items: stretch; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--input); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 14%, transparent); }
.input-group .input { border: 0; box-shadow: none !important; background: transparent; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.03); white-space: nowrap; border-right: 1px solid var(--line); }
.input-group .addon.end { border-right: 0; border-left: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
/* Schalter */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.14); position: relative; transition: background .25s; flex-shrink: 0; }
:root[data-theme="light"] .switch .track { background: rgba(13,18,45,.16); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* Regler */
.range { width: 100%; accent-color: var(--red); height: 24px; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
/* Farbwähler */
.color-field { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--input); }
.color-field input[type="color"] { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; flex-shrink: 0; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-2); border-radius: 8px; }
.color-field input[type="color"]::-moz-color-swatch { border: 1px solid var(--line-2); border-radius: 8px; }
.color-field .hex { border: 0; background: transparent; outline: none; width: 100%; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
/* Dateiablage */
.dropzone {
  display: block;
  border: 1.5px dashed var(--line-3); border-radius: var(--r); padding: 26px; text-align: center; cursor: pointer; position: relative;
  transition: border-color .2s, background .2s; background: rgba(255,255,255,.02);
}
.dropzone:hover, .dropzone.drag { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--cyan); }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.file-item .thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; display: grid; place-items: center; color: var(--muted); }
.file-item .thumb svg { width: 20px; height: 20px; }
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--thread); transition: width .2s; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip svg { width: 15px; height: 15px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); position: relative; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; transition: color .2s;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); }
.tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--red); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
:root[data-theme="light"] .table tbody tr:hover { background: rgba(13,18,45,.025); }

/* ---------- Dialoge ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .2s ease; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--r-lg);
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(0,0,0,.8);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); animation: modalIn .35s var(--ease-out);
}
.modal.wide { max-width: 860px; }
.modal.full { max-width: 1280px; height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 26px 0; }
.modal-head h3 { font-size: 20px; font-weight: 600; }
.modal-body { padding: 20px 26px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 26px 24px; flex-wrap: wrap; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Menü / Popover */
.menu {
  position: absolute; z-index: 60; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow-2); animation: modalIn .2s var(--ease-out);
}
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; background: none; border: 0; cursor: pointer;
  font-size: 14px; color: var(--text-2); text-align: left;
}
.menu a:hover, .menu button:hover { background: rgba(255,255,255,.07); color: var(--text); }
:root[data-theme="light"] .menu a:hover, :root[data-theme="light"] .menu button:hover { background: rgba(13,18,45,.06); }
.menu svg { width: 16px; height: 16px; }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 4px; }
.menu .danger { color: var(--danger); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px; padding: 13px 16px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--line-2); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-2); font-size: 14px; animation: toastIn .35s var(--ease-out);
}
.toast .ti { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(51,194,107,.18); color: var(--ok); }
.toast.error .ti { background: rgba(255,77,77,.18); color: var(--danger); }
.toast.info .ti { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.toast .ti svg { width: 15px; height: 15px; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Seitenaufbau ---------- */
.page { padding: 36px 0 80px; min-height: calc(100vh - var(--header-h) - var(--util-h)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .titles { display: flex; flex-direction: column; gap: 10px; }
.view-enter { animation: viewIn .45s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Hero mit Bändern ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 44px 44px 120px; border: 1px solid var(--line);
  background:
    radial-gradient(800px 380px at 100% 0%, color-mix(in srgb, var(--navy) 35%, transparent), transparent 65%),
    radial-gradient(600px 300px at 0% 100%, color-mix(in srgb, var(--green) 16%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, var(--bg)), var(--bg));
  isolation: isolate;
}
:root[data-theme="light"] .hero {
  background:
    radial-gradient(800px 380px at 100% 0%, color-mix(in srgb, var(--cyan) 25%, transparent), transparent 65%),
    radial-gradient(600px 300px at 0% 100%, color-mix(in srgb, var(--purple) 12%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12;
  background: url("../img/contours.svg") 70% 30% / 140% auto no-repeat;
}
:root[data-theme="light"] .hero::before { filter: invert(1); opacity: .08; }
.hero .ribbons { position: absolute; left: 0; right: 0; bottom: -2px; height: 150px; z-index: -1; pointer-events: none; }

/* Bänder (Unitymedia-Fäden) */
.ribbons { overflow: hidden; }
.ribbons svg { width: 100%; height: 100%; display: block; }
.ribbons .drift { animation: drift 48s linear infinite; will-change: transform; transform-box: fill-box; }
.ribbons .drift.slow { animation-duration: 72s; }
.ribbons .drift.rev { animation-direction: reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.thread-line { height: 2px; border-radius: 2px; background: var(--thread); opacity: .9; }
.section-ribbon { position: relative; height: 90px; margin: 28px 0 8px; pointer-events: none; }

/* ---------- KPI-Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.kpi .eyebrow { display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 38px; font-weight: 600; letter-spacing: -.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi .delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 55%; height: 52px; opacity: .9; pointer-events: none; }
.kpi.accent { background: linear-gradient(45deg, var(--red-deep), var(--red)); border-color: transparent; color: var(--on-accent-deep); }
.kpi.accent .eyebrow, .kpi.accent .value small, .kpi.accent .delta { color: color-mix(in srgb, var(--on-accent-deep) 82%, transparent) !important; }
.kpi.flex .delta { color: rgba(255,255,255,.82) !important; }
.kpi.flex { background: linear-gradient(225deg, color-mix(in srgb, var(--purple) 55%, transparent), color-mix(in srgb, var(--navy) 55%, transparent)), var(--surface); }
:root[data-theme="light"] .kpi.flex { background: linear-gradient(225deg, var(--purple), var(--navy)); color: #fff; border-color: transparent; }
:root[data-theme="light"] .kpi.flex .eyebrow, :root[data-theme="light"] .kpi.flex .value small { color: rgba(255,255,255,.75); }

/* ---------- Linien-Icons im Kreis (Unitymedia) ---------- */
.ring-icon {
  width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; flex-shrink: 0;
  color: var(--text-2); transition: color .25s, transform .35s var(--ease-out), background .25s, border-color .25s;
}
.ring-icon svg { width: 24px; height: 24px; stroke-width: 1.4; }
.ring-icon.sm { width: 40px; height: 40px; }
.ring-icon.sm svg { width: 19px; height: 19px; }
.ring-icon.lg { width: 88px; height: 88px; border-width: 2px; }
.ring-icon.lg svg { width: 40px; height: 40px; }

/* ---------- Typ-Auswahl ---------- */
.type-groups { display: flex; flex-direction: column; gap: 22px; }
.type-group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.type-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.type-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer; text-align: center; transition: all .25s var(--ease);
  color: var(--text-2);
}
:root[data-theme="light"] .type-tile { background: var(--surface); }
.type-tile:hover { border-color: var(--line-3); color: var(--text); transform: translateY(-2px); }
.type-tile:hover .ring-icon { color: var(--cyan); transform: scale(1.06); }
.type-tile.active { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent); }
.type-tile.active .ring-icon { color: var(--on-accent); background: var(--red); border-color: var(--red); }
.type-tile .t-label { font-size: 13px; font-weight: 600; line-height: 1.2; }
.type-tile .flex-only { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--thread-flex); }
.type-tile.disabled { opacity: .35; pointer-events: none; }
.type-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 28px; align-items: start; }
.studio-side { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; flex-direction: column; }
.step-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; cursor: pointer; user-select: none; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
  border: 1.5px solid var(--line-3); color: var(--text-2);
}
.step.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step.current .step-num { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.step-head h3 { font-size: 17px; }
.step-head .sum { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; }
.step-body { padding: 0 24px 24px; }

.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kind-card {
  position: relative; padding: 18px 18px 16px; border-radius: 18px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
  cursor: pointer; text-align: left; transition: all .3s var(--ease); overflow: hidden; color: var(--text);
}
:root[data-theme="light"] .kind-card { background: var(--surface); }
.kind-card:hover { border-color: var(--line-3); }
.kind-card .k-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.kind-card .k-desc { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.kind-card .k-check { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-3); display: grid; place-items: center; }
.kind-card.active { border-color: transparent; box-shadow: 0 0 0 2px var(--red) inset; }
.kind-card.active .k-check { background: var(--red); border-color: var(--red); }
.kind-card.active .k-check::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--on-accent); }
.kind-card.flex.active { box-shadow: none; }
.kind-card.flex.active::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: var(--thread-flex);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.kind-card.flex.active .k-check { background: var(--thread-flex); border-color: transparent; }

/* Kristall-Bühne (Orbit + Signal) */
.stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden; padding: 34px 34px 26px; isolation: isolate;
  background:
    radial-gradient(420px 260px at 50% 0%, rgba(255,255,255,.10), transparent 70%),
    radial-gradient(500px 300px at 50% 120%, color-mix(in srgb, var(--navy) 35%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 75%, var(--bg)), var(--bg));
  border: 1px solid var(--line-2);
}
:root[data-theme="light"] .stage {
  background:
    radial-gradient(420px 260px at 50% 0%, rgba(255,255,255,1), transparent 70%),
    radial-gradient(500px 300px at 50% 120%, color-mix(in srgb, var(--cyan) 28%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg-3));
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .14;
  background: url("../img/contours.svg") 50% 40% / 220% auto no-repeat;
}
:root[data-theme="light"] .stage::before { filter: invert(1); opacity: .1; }
.stage-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; color: rgba(255,255,255,.7); }
:root[data-theme="light"] .stage-top { color: var(--muted); }
.crystal-wrap { position: relative; display: grid; place-items: center; padding: 10px 0 34px; }
.crystal {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; border-radius: 26px; padding: 0; overflow: hidden;
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 30px 60px -20px rgba(0,0,0,.85), 0 0 80px -30px color-mix(in srgb, var(--cyan) 35%, transparent);
  transform: perspective(900px) rotateX(0deg); transition: transform .6s var(--ease-out);
}
.crystal-wrap:hover .crystal { transform: perspective(900px) rotateX(4deg) translateY(-3px); }
.crystal .qr-holder { width: 100%; height: 100%; display: grid; place-items: center; }
.crystal .qr-holder svg { width: 100%; height: 100%; }
.crystal::after {
  /* Lichtreflex, der beim Aktualisieren über den Kristall wandert */
  content: ""; position: absolute; inset: -20%; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  transform: translateX(-120%); opacity: 0;
}
.crystal.sweep::after { animation: sweep 1.1s var(--ease-out); }
@keyframes sweep { 0% { transform: translateX(-120%); opacity: 1; } 100% { transform: translateX(120%); opacity: 0; } }
.crystal-reflection {
  position: absolute; left: 50%; bottom: 0; width: 70%; height: 30px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cyan) 35%, transparent), transparent); filter: blur(6px); pointer-events: none;
}
/* Signal-Ringe (Vodafone) */
.signal-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: -1; }
.signal-rings i {
  position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--red) 60%, transparent); opacity: 0;
}
.signal-rings.pulse i { animation: ring 1.6s var(--ease-out) forwards; }
.signal-rings.pulse i:nth-child(2) { animation-delay: .18s; }
.signal-rings.pulse i:nth-child(3) { animation-delay: .36s; }
@keyframes ring { 0% { transform: scale(.85); opacity: .8; } 100% { transform: scale(1.65); opacity: 0; } }
.stage-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: rgba(255,255,255,.62); }
:root[data-theme="light"] .stage-meta { color: var(--muted); }
.stage-meta .mono { color: rgba(255,255,255,.85); }
:root[data-theme="light"] .stage-meta .mono { color: var(--text); }

/* Lesbarkeit */
.scan-meter { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.scan-meter .bars { display: flex; gap: 4px; align-items: flex-end; height: 22px; }
.scan-meter .bars i { width: 6px; border-radius: 2px; background: rgba(255,255,255,.14); }
:root[data-theme="light"] .scan-meter .bars i { background: rgba(13,18,45,.12); }
.scan-meter .bars i:nth-child(1) { height: 30%; } .scan-meter .bars i:nth-child(2) { height: 50%; } .scan-meter .bars i:nth-child(3) { height: 70%; } .scan-meter .bars i:nth-child(4) { height: 100%; }
.scan-meter[data-level="4"] .bars i { background: var(--ok); }
.scan-meter[data-level="3"] .bars i:nth-child(-n+3) { background: var(--ok); }
.scan-meter[data-level="2"] .bars i:nth-child(-n+2) { background: var(--warn); }
.scan-meter[data-level="1"] .bars i:nth-child(1) { background: var(--danger); }

.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.export-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line-2);
  background: transparent; cursor: pointer; transition: all .2s; color: var(--text);
}
.export-btn:hover { border-color: var(--line-3); background: rgba(255,255,255,.04); }
.export-btn b { font-size: 13.5px; letter-spacing: .04em; }
.export-btn span { font-size: 11px; color: var(--muted); }

/* Design-Optionen */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.opt {
  aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); cursor: pointer; padding: 12px;
  display: grid; place-items: center; transition: all .2s var(--ease); position: relative; color: var(--text);
}
:root[data-theme="light"] .opt { background: var(--surface); }
.opt:hover { border-color: var(--line-3); transform: translateY(-1px); }
.opt.active { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.opt svg { width: 100%; height: 100%; }
.opt .opt-label { position: absolute; bottom: -20px; left: 0; right: 0; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-grid.labeled { row-gap: 30px; }

/* Vorlagen (Vodafone-Karten mit Glas-Unterschrift) */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tpl {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 5; cursor: pointer; border: 1px solid var(--line-2);
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .2s; isolation: isolate;
}
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tpl.active { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.tpl .tpl-bg { position: absolute; inset: 0; z-index: -1; }
.tpl .tpl-qr { position: absolute; top: 9%; left: 50%; width: 58%; transform: translateX(-50%); border-radius: 10px; overflow: hidden; }
.tpl .tpl-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: rgba(20,20,22,.55); color: #fff;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid rgba(255,255,255,.12);
}
.tpl .tpl-cap b { display: block; font-size: 13px; }
.tpl .tpl-cap span { font-size: 11px; opacity: .75; }

/* Akkordeon */
.acc { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.acc + .acc { margin-top: 10px; }
.acc > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; font-weight: 600; user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .chev { margin-left: auto; transition: transform .25s var(--ease); color: var(--muted); }
.acc[open] > summary .chev { transform: rotate(180deg); }
.acc > summary svg { width: 18px; height: 18px; }
.acc .acc-body { padding: 4px 18px 18px; }

/* ---------- Bibliothek ---------- */
.lib-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; border-radius: var(--r-pill); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.qr-card {
  position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .25s; content-visibility: auto; contain-intrinsic-size: 340px;
}
.qr-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.qr-card .qc-visual {
  position: relative; aspect-ratio: 5 / 4; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  background: radial-gradient(300px 200px at 50% 0%, rgba(255,255,255,.08), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--bg));
}
:root[data-theme="light"] .qr-card .qc-visual { background: radial-gradient(300px 200px at 50% 0%, var(--surface), transparent 70%), linear-gradient(180deg, var(--bg-2), var(--bg-3)); }
.qr-card.flex .qc-visual::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22;
  background: radial-gradient(260px 160px at 100% 100%, color-mix(in srgb, var(--purple) 90%, transparent), transparent 70%), radial-gradient(260px 160px at 0% 100%, color-mix(in srgb, var(--cyan) 70%, transparent), transparent 70%);
}
.qr-card .qc-qr { width: 52%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); transition: transform .5s var(--ease-out); }
.qr-card:hover .qc-qr { transform: scale(1.04); }
.qr-card .qc-qr svg { width: 100%; height: 100%; }
.qr-card .qc-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.qr-card .qc-fav { position: absolute; bottom: 10px; right: 12px; color: var(--warn); }
.qr-card .qc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.qr-card .qc-title { font-weight: 600; font-size: 15.5px; }
.qr-card .qc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.qr-card .qc-actions { position: absolute; right: 10px; top: 10px; background: rgba(20,20,22,.55); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: .0; transition: opacity .2s; }
.qr-card:hover .qc-actions, .qr-card .qc-actions:focus-visible { opacity: 1; }
@media (hover: none) { .qr-card .qc-actions { opacity: 1; } }

/* ---------- Faden-Diagramm (Flex: QR → Kurzlink → Ziel) ---------- */
.thread-flow { position: relative; display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 0; padding: 22px 6px; }
.tf-node { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 220px; z-index: 1; }
.tf-node .ring-icon { background: var(--surface); }
.tf-node .tf-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tf-node .tf-val { font-size: 13px; font-weight: 600; word-break: break-all; max-width: 210px; }
.tf-link { height: 40px; position: relative; min-width: 40px; }
.tf-link svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tf-link .flow { stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* ---------- Diagramme ---------- */
.chart { width: 100%; height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid line { stroke: var(--line); }
.chart-tip {
  position: absolute; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line-2);
  font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-1); z-index: 3;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bars-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .bl { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { height: 8px; border-radius: 8px; background: rgba(255,255,255,.06); overflow: hidden; }
:root[data-theme="light"] .bar-row .bt { background: rgba(13,18,45,.06); }
.bar-row .bt i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--red); transform-origin: left; animation: grow .8s var(--ease-out); }
/* eine Messgröße = eine Farbe (Farbe folgt der Größe, nicht dem Rang) */
.bars-list.flex .bt i { background: var(--thread-flex); }
.bar-row .bv { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.heatmap { display: grid; grid-template-columns: 30px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--muted); }
.heatmap .hc { height: 18px; border-radius: 3px; background: rgba(255,255,255,.05); }
:root[data-theme="light"] .heatmap .hc { background: rgba(13,18,45,.05); }
.heatmap .hl { display: flex; align-items: center; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Leere Zustände & Skeletons ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 60px 20px; }
.empty .ring-icon { color: var(--cyan); }
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,.05); border-radius: 12px; }
:root[data-theme="light"] .skeleton { background: rgba(13,18,45,.06); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hinweise ---------- */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font-size: 13.5px; line-height: 1.5; }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.notice.info { border-color: color-mix(in srgb, var(--cyan) 30%, transparent); background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.notice.info svg { color: var(--cyan); }
.notice.warn { border-color: rgba(245,165,36,.35); background: rgba(245,165,36,.07); }
.notice.warn svg { color: var(--warn); }
.notice.error { border-color: rgba(255,77,77,.35); background: rgba(255,77,77,.07); }
.notice.error svg { color: var(--danger); }
.notice.ok { border-color: rgba(51,194,107,.35); background: rgba(51,194,107,.07); }
.notice.ok svg { color: var(--ok); }

/* ---------- Auth- & Setup-Seiten ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; position: relative; overflow: hidden; isolation: isolate; background: var(--bg); color: var(--text);
}
.auth-visual { position: relative; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100vh; }
.auth-visual .contours { position: absolute; inset: 0; background: url("../img/contours.svg") 30% 50% / cover no-repeat; opacity: .16; z-index: -1; }
.auth-visual .glow { position: absolute; width: 900px; height: 900px; right: -320px; top: -260px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--navy) 55%, transparent), color-mix(in srgb, var(--purple) 22%, transparent) 50%, transparent); }
.auth-visual .ribbons { position: absolute; left: -5%; right: -5%; bottom: -30px; height: 230px; z-index: -1; opacity: .9; }
.auth-stage { position: relative; display: grid; place-items: center; margin: 30px 0; }
.auth-stage .crystal { max-width: 300px; transform: perspective(1000px) rotateY(-14deg) rotateX(8deg); animation: floaty 8s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: perspective(1000px) rotateY(-14deg) rotateX(8deg) translateY(0); } 50% { transform: perspective(1000px) rotateY(-10deg) rotateX(6deg) translateY(-12px); } }
.auth-stage .signal-rings i { width: 320px; height: 320px; animation: ring 3.6s var(--ease-out) infinite; }
.auth-stage .signal-rings i:nth-child(2) { animation-delay: 1.2s; }
.auth-stage .signal-rings i:nth-child(3) { animation-delay: 2.4s; }
.auth-panel { display: grid; place-items: center; padding: 40px; position: relative; background: linear-gradient(180deg, rgba(255,255,255,.02), transparent); border-left: 1px solid rgba(255,255,255,.08); }
.auth-card { width: 100%; max-width: 420px; padding: 36px; color: #fafafa; }
.auth-card .input { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); color: #fff; }
.auth-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 28px; }
.auth-steps span { display: flex; flex-direction: column; gap: 8px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.42); font-weight: 600; white-space: nowrap; }
.auth-steps span::before { content: ""; height: 3px; border-radius: 3px; background: rgba(255,255,255,.16); }
.auth-steps span i { display: none; }
.auth-steps span.done { color: rgba(255,255,255,.7); }
.auth-steps span.done::before { background: var(--green); }
.auth-steps span.current { color: #fff; }
.auth-steps span.current::before { background: var(--red); box-shadow: 0 0 12px color-mix(in srgb, var(--red) 60%, transparent); }
.single-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; isolation: isolate; }
.single-page .ribbons { position: fixed; left: -5%; right: -5%; bottom: -10px; height: 220px; z-index: -1; opacity: .9; pointer-events: none; }
.single-card { width: 100%; max-width: 640px; padding: 40px; }

/* ---------- Markdown-Reader ---------- */
.md { font-size: 15px; line-height: 1.7; color: var(--text-2); max-width: 860px; }
.md h1, .md h2, .md h3, .md h4 { color: var(--text); margin: 1.6em 0 .6em; line-height: 1.2; }
.md h1 { font-size: 32px; } .md h2 { font-size: 24px; } .md h3 { font-size: 19px; }
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md table, .md pre, .md blockquote { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md code { font-family: var(--mono); font-size: .88em; background: rgba(255,255,255,.07); padding: 2px 6px; border-radius: 6px; }
:root[data-theme="light"] .md code { background: rgba(13,18,45,.06); }
.md pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: #e6e6e6; }
.md blockquote { border-left: 3px solid var(--red); padding: 4px 0 4px 16px; color: var(--muted); }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line-2); padding: 8px 12px; text-align: left; }
.md th { background: rgba(255,255,255,.04); color: var(--text); }
.md a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.md hr { border: 0; height: 1px; background: var(--line-2); margin: 2em 0; }
.md strong { color: var(--text); }

/* ---------- Poster-Studio ---------- */
.poster-layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: 100%; min-height: 0; }
.poster-controls { padding: 22px; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.poster-canvas { display: grid; place-items: center; padding: 30px; overflow: auto; background:
  repeating-conic-gradient(rgba(255,255,255,.03) 0 25%, transparent 0 50%) 0 0 / 22px 22px; }
.poster-canvas .poster-preview { box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; background: #000; }
.poster-canvas .poster-preview svg { display: block; width: 100%; height: 100%; }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 12.5px; }
.app-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsiv ---------- */
@media (max-width: 1200px) {
  .studio { grid-template-columns: minmax(0, 1fr) 380px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column; align-items: stretch; position: fixed; top: calc(var(--header-h) + var(--util-h)); left: 0; right: 0; bottom: 0;
    padding: 18px 20px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); gap: 4px; z-index: 39; overflow-y: auto;
  }
  .main-nav.open a { padding: 14px 16px; font-size: 17px; border-radius: 14px; }
  .icon-btn.nav-toggle { display: inline-grid; }
  /* backdrop-filter würde das fixierte Menü im Header einsperren */
  body.nav-open .app-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  body.nav-open { overflow: hidden; }
  .user-chip .meta { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: auto; padding: 32px 24px 0; }
  .auth-stage { margin: 10px 0 0; }
  .auth-stage .crystal { max-width: 200px; }
  .auth-visual .ribbons { height: 160px; bottom: 0; }
  .auth-panel { border-left: 0; padding: 10px 16px 40px; }
}
@media (max-width: 960px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-side { position: static; order: -1; }
  .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poster-layout { grid-template-columns: 1fr; }
  .poster-controls { border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  .util-bar .hide-sm, .hide-sm { display: none !important; }
  .util-tabs a { padding: 0 10px; white-space: nowrap; }
  .page { padding: 22px 0 60px; }
  .hero { padding: 28px 22px 100px; border-radius: var(--r); }
  .card-pad, .card-pad-lg { padding: 20px; }
  .step-head { padding: 16px 18px; }
  .step-body { padding: 0 18px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .g-2, .g-3, .g-4, .kpis { grid-template-columns: minmax(0, 1fr); }
  .kind-switch { grid-template-columns: 1fr; }
  .thread-flow { grid-template-columns: 1fr; gap: 6px; }
  .tf-link { height: 34px; transform: rotate(90deg); width: 34px; margin: 0 auto; }
  .stage { padding: 22px 18px 18px; }
  .modal-head { padding: 18px 18px 0; } .modal-body { padding: 16px 18px; } .modal-foot { padding: 0 18px 18px; }
  .bar-row { grid-template-columns: 84px 1fr 44px; }
  .single-card { padding: 26px 20px; }
  .auth-card { padding: 26px 20px; }
  .brand-sub { display: none; }
  .app-header .container { gap: 12px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; max-width: none; }
}


/* ---------- Farbwelten ---------- */
.pal-dots { display: inline-flex; }
.pal-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--util-bg); margin-left: -4px; }
.pal-dots i:first-child { margin-left: 0; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pal-card {
  position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; border-radius: 16px; overflow: hidden; cursor: pointer; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s;
}
.pal-card:hover { transform: translateY(-2px); border-color: var(--line-3); }
.pal-card.active { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.pal-swatches { display: flex; height: 54px; }
.pal-swatches i { flex: 1; }
.pal-body { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 13px; }
.pal-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.pal-src { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.pal-accent { position: absolute; top: 40px; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface); }

/* ---------- Mobile Ansicht: Tab-Leiste unten (App-Gefühl) ---------- */
.tabbar { display: none; }
@media (max-width: 680px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 45; height: 64px; padding: 0 6px 8px; border-radius: 22px;
    background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: 0 18px 50px -12px rgba(0,0,0,.55);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted);
    background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: .02em;
  }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active .ic { color: var(--red); }
  .tabbar .tab-fab {
    width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 4px; justify-content: center; background: var(--red); color: var(--on-accent);
    box-shadow: 0 10px 26px -8px var(--red-glow), 0 0 0 5px var(--bg); transform: translateY(-14px);
  }
  .tabbar .tab-fab .ic { width: 26px; height: 26px; color: var(--on-accent) !important; }
  .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .app-footer { display: none; }
  .header-actions .icon-btn.nav-toggle { display: none; }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .pal-grid { grid-template-columns: 1fr 1fr; }
  .pal-src { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .tabbar, .util-bar, .app-header, .app-footer, .toasts, .backdrop { display: none !important; }
  body { background: #fff; color: #000; }
}
