/* ============ Kundenportal – Design ============ */
:root {
  --accent: #6d5efc;
  --accent-ink: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 30%, transparent);
  --bg: #f5f5fa;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: #f0f0f6;
  --text: #15152b;
  --muted: #6c6c86;
  --faint: #9d9db3;
  --line: rgba(21, 21, 43, .09);
  --ok: #12a150; --ok-soft: #e3f8ec; --ok-ink: #0c6b36;
  --bad: #e5484d; --bad-soft: #fdecec; --bad-ink: #a51d22;
  --warn: #d98a04; --warn-soft: #fff4dc; --warn-ink: #8a5600;
  --info: #3e63dd; --info-soft: #e8eeff; --info-ink: #2a45a8;
  --radius: 22px; --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(21,21,43,.04), 0 10px 30px -10px rgba(21,21,43,.12);
  --shadow-lg: 0 30px 80px -20px rgba(21,21,43,.35);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d16; --surface: rgba(26, 26, 40, .72); --surface-solid: #181826; --surface-2: #222234;
    --text: #ececf6; --muted: #a0a0ba; --faint: #6f6f8a; --line: rgba(255,255,255,.08);
    --ok-soft: rgba(18,161,80,.16); --ok-ink: #5fd98f; --bad-soft: rgba(229,72,77,.16); --bad-ink: #ff8a8e;
    --warn-soft: rgba(217,138,4,.16); --warn-ink: #ffc24d; --info-soft: rgba(62,99,221,.18); --info-ink: #9db4ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -10px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
  background-image:
    radial-gradient(900px 500px at 8% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, color-mix(in srgb, #22c3ee 10%, transparent), transparent 60%);
  background-attachment: fixed;
}
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Grundgerüst ---------- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22c3ee)); box-shadow: 0 6px 16px -6px var(--accent); }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 20px; border-radius: 14px; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.container { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: .15s; }
.iconbtn:hover { color: var(--text); background: var(--surface-solid); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { box-shadow: 0 12px 26px -10px var(--accent); }
.btn-ok { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px var(--ok); }
.btn-bad { background: var(--bad); color: #fff; border-color: transparent; }
.btn-bad-soft { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--bad-ink); }
.btn-danger-ghost:hover { background: var(--bad-soft); box-shadow: none; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=search], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.counter { font-size: 12px; color: var(--faint); text-align: right; }
.counter.over { color: var(--bad); font-weight: 700; }

/* ---------- Karten & Flächen ---------- */
.glass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.notice.ok { background: var(--ok-soft); color: var(--ok-ink); }
.notice.bad { background: var(--bad-soft); color: var(--bad-ink); }
.notice.info { background: var(--info-soft); color: var(--info-ink); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
.auth-card.center { text-align: center; align-items: center; }
.auth-card h1 { font-size: 28px; }
.auth-foot { margin-top: 6px; font-size: 12px; color: var(--faint); display: flex; gap: 14px; justify-content: center; }
.auth-foot a { color: var(--faint); }
.admin-toggle { border-top: 1px solid var(--line); padding-top: 14px; }
.admin-toggle summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
.admin-toggle summary::-webkit-details-marker { display: none; }
.admin-toggle[open] summary { margin-bottom: 14px; }
.hero-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hero-icon svg { width: 34px; height: 34px; }

/* ---------- Kopfbereich & Kennzahlen ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.hero p.muted { margin: 8px 0 0; max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 34px; }
.stat { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat.pending .ic { background: var(--warn-soft); color: var(--warn); }
.stat.approved .ic { background: var(--ok-soft); color: var(--ok); }
.stat.rejected .ic { background: var(--bad-soft); color: var(--bad); }
.stat.published .ic { background: var(--info-soft); color: var(--info); }
.stat b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.search { max-width: 280px; }

/* ---------- Kunden-Kacheln ---------- */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cust { --c: var(--accent); position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; color: inherit; overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.cust::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.cust:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--c) 60%, transparent); }
.cust-top { display: flex; align-items: center; gap: 12px; }
.cust-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--c); font-size: 17px; }
.cust-top h3 { font-size: 16px; }
.cust-top small { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mini { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.mini.pending { background: var(--warn-soft); color: var(--warn-ink); }
.mini.approved { background: var(--ok-soft); color: var(--ok-ink); }
.mini.rejected { background: var(--bad-soft); color: var(--bad-ink); }
.mini.published { background: var(--info-soft); color: var(--info-ink); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .hero-icon { margin-bottom: 4px; }
.empty h3 { color: var(--text); }

/* ---------- Tabs & Filter ---------- */
.cust-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cust-head .cust-logo { width: 58px; height: 58px; font-size: 22px; border-radius: 18px; background: var(--accent); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 22px; }
.tab { padding: 8px 16px; border-radius: 10px; border: 0; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.tab.active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: .15s; }
.filter b { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter.active b { background: color-mix(in srgb, var(--bg) 20%, transparent); color: var(--bg); }

/* ---------- Fokus-Banner (Kunde) ---------- */
.focus { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 26px; border-radius: var(--radius); color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #22c3ee)); box-shadow: 0 24px 50px -24px var(--accent); }
.focus::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.focus .big { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.focus p { margin: 2px 0 0; opacity: .9; }
.focus .btn { margin-left: auto; background: #fff; color: #15152b; border: 0; position: relative; z-index: 1; }
.focus.done { background: linear-gradient(120deg, #12a150, #2bc48a); box-shadow: 0 24px 50px -24px #12a150; }

/* ---------- Beitrags-Karten ---------- */
.feed { display: flex; flex-direction: column; gap: 18px; }
.post { display: grid; grid-template-columns: 340px 1fr; gap: 26px; padding: 22px; animation: rise .4s cubic-bezier(.2,.8,.2,1) both; scroll-margin-top: 90px; }
.post.flash { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
@media (max-width: 860px) { .post { grid-template-columns: 1fr; } .post-media { max-width: 380px; width: 100%; margin: 0 auto; } }
.post-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.post-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.draft { background: var(--surface-2); color: var(--muted); }
.pill.pending { background: var(--warn-soft); color: var(--warn-ink); }
.pill.pending::before { animation: pulse 1.6s infinite; }
.pill.approved { background: var(--ok-soft); color: var(--ok-ink); }
.pill.rejected { background: var(--bad-soft); color: var(--bad-ink); }
.pill.published { background: var(--info-soft); color: var(--info-ink); }
.tag { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); }
.when { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.caption { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.6; background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-sm); max-height: 220px; overflow: auto; }
.caption.empty-cap { color: var(--faint); font-style: italic; }
.decided { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.decided.approved { background: var(--ok-soft); color: var(--ok-ink); }
.decided.rejected { background: var(--bad-soft); color: var(--bad-ink); }
.decided.published { background: var(--info-soft); color: var(--info-ink); }
.decided q { display: block; margin-top: 4px; quotes: none; white-space: pre-wrap; color: var(--text); }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
@media (max-width: 500px) { .decide { grid-template-columns: 1fr; } }
.reject-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--bad-soft); animation: rise .25s ease both; }
.reject-form label { font-weight: 600; font-size: 14px; color: var(--bad-ink); }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* Verlauf */
.thread { border-top: 1px solid var(--line); padding-top: 12px; }
.thread summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; list-style: none; }
.thread summary::-webkit-details-marker { display: none; }
.thread summary .count { font-size: 12px; background: var(--surface-2); padding: 1px 8px; border-radius: 99px; }
.timeline { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ev { display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.ev .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.ev .dot svg { width: 14px; height: 14px; }
.ev.approved .dot { background: var(--ok-soft); color: var(--ok); }
.ev.rejected .dot { background: var(--bad-soft); color: var(--bad); }
.ev.published .dot { background: var(--info-soft); color: var(--info); }
.ev.submitted .dot, .ev.resubmitted .dot { background: var(--warn-soft); color: var(--warn); }
.ev .ev-body { flex: 1; min-width: 0; padding-top: 3px; }
.ev time { font-size: 12px; color: var(--faint); margin-left: 6px; }
.bubble { margin-top: 6px; padding: 10px 13px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); color: var(--text); white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.ev.mine { flex-direction: row-reverse; text-align: right; }
.ev.mine .bubble { border-radius: 14px 4px 14px 14px; background: var(--accent-soft); text-align: left; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 44px; height: 44px; resize: none; }

/* ---------- Smartphone-Vorschau ---------- */
.phone { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 20px 50px -25px rgba(21,21,43,.35); }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13px; }
.ph-avatar { width: 30px; height: 30px; border-radius: 50%; padding: 2px; background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.ph-avatar span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 11px; border: 2px solid var(--surface-solid); }
.ph-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-media { position: relative; background: #0b0b12; aspect-ratio: 4 / 5; }
.ph-media.tall { aspect-ratio: 9 / 16; }
.ph-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; }
.ph-track::-webkit-scrollbar { display: none; }
.ph-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; }
.ph-slide img, .ph-slide video { width: 100%; height: 100%; object-fit: cover; }
.ph-slide video { object-fit: contain; background: #000; }
.ph-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); transition: .2s; }
.ph-dots i.on { background: #fff; width: 16px; border-radius: 6px; }
.ph-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.ph-empty { height: 100%; display: grid; place-items: center; color: #8888a0; font-size: 13px; text-align: center; padding: 20px; }
.ph-empty svg { width: 36px; height: 36px; margin: 0 auto 8px; display: block; opacity: .6; }
.ph-actions { display: flex; gap: 14px; padding: 11px 14px 4px; }
.ph-actions svg { width: 22px; height: 22px; }
.ph-actions .last { margin-left: auto; }
.ph-caption { padding: 4px 14px 14px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; max-height: 7.3em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.ph-caption.short { -webkit-mask-image: none; mask-image: none; }
.media-tools { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,20,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease both; overflow-y: auto; }
.overlay.out { animation: fade .18s ease reverse both; }
.modal { width: 100%; max-width: 520px; background: var(--surface-solid); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 26px; animation: pop .3s cubic-bezier(.2,.9,.3,1.2) both; max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { max-width: 1040px; padding: 0; overflow: hidden; display: flex; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 13px; font-family: ui-monospace, Menlo, monospace; }

/* ---------- Editor ---------- */
.composer { display: grid; grid-template-columns: 1fr 380px; width: 100%; max-height: calc(100vh - 40px); }
.composer-form { padding: 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.composer-form .modal-head { margin: 0; }
.composer-form .modal-foot { margin-top: 4px; position: sticky; bottom: -26px; background: var(--surface-solid); padding: 14px 0 0; }
.composer-preview { background: var(--surface-2); padding: 26px; overflow-y: auto; border-left: 1px solid var(--line); }
.composer-preview .phone { max-width: 320px; margin: 0 auto; }
@media (max-width: 900px) { .composer { grid-template-columns: 1fr; } .composer-preview { display: none; } }
.drop { border: 2px dashed var(--accent-line); border-radius: 18px; padding: 26px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); background: var(--accent-soft); transition: .15s; }
.drop svg { width: 30px; height: 30px; color: var(--accent); }
.drop b { color: var(--text); }
.drop.over { border-color: var(--accent); transform: scale(1.01); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #0b0b12; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb button svg { width: 13px; height: 13px; }
.thumb .vid { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; font-size: 11px; padding: 1px 6px; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label, .toggles label { cursor: pointer; }
.seg input, .toggles input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .toggles span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-solid); font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; }
.seg input:checked + span, .toggles input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + span, .toggles input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #22c3ee)); transition: width .2s; }
.progress-label { font-size: 13px; color: var(--muted); }

/* Farbauswahl */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatches input[type=color] { width: 34px; height: 34px; border: 0; background: none; padding: 0; cursor: pointer; }

/* Zugänge */
.contacts { display: flex; flex-direction: column; gap: 10px; }
.contact { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.contact .info { flex: 1; min-width: 200px; }
.contact .info small { color: var(--muted); display: block; font-size: 13px; }
.settings { max-width: 640px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.danger-zone { max-width: 640px; margin-top: 18px; padding: 20px 24px; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Toasts & Effekte ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .3s cubic-bezier(.2,.8,.2,1) both; display: flex; gap: 8px; align-items: center; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { animation: fade .3s ease reverse both; }
.confetti { position: fixed; z-index: 90; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; animation: confetti 1.1s cubic-bezier(.2,.7,.4,1) forwards; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.skeleton { height: 220px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }
@media (max-width: 640px) {
  .container { padding: 20px 14px 70px; }
  .who-name { display: none; }
  .post { padding: 16px; gap: 18px; }
  .focus { flex-wrap: wrap; padding: 18px; gap: 14px; } .focus .big { font-size: 34px; } .focus .btn { margin-left: 0; width: 100%; }
  .focus > div:nth-child(2) { flex: 1; min-width: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
  .stats.three { grid-template-columns: repeat(3, 1fr); }
  .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .stat .ic { width: 34px; height: 34px; border-radius: 11px; }
  .stat b { font-size: 22px; } .stat span { font-size: 12px; line-height: 1.3; display: block; }
  .hero { margin-bottom: 18px; }
  .composer-form { padding: 20px; }
}

/* Passwortfelder */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--faint); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.strength { display: flex; align-items: center; gap: 5px; margin-top: -6px; }
.strength i { flex: 1; max-width: 48px; height: 5px; border-radius: 99px; background: var(--surface-2); transition: background .2s; }
.strength i.on.s1 { background: var(--bad); }
.strength i.on.s2 { background: var(--warn); }
.strength i.on.s3, .strength i.on.s4 { background: var(--ok); }
.strength span { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* ============ Kalender ============ */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1020px) { .cal-layout { grid-template-columns: 1fr; } }
.cal { padding: 18px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { min-width: 170px; text-align: center; font-size: 19px; }
.check.small { font-size: 13px; color: var(--muted); }
.check.small input { width: 16px; height: 16px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-cell { min-height: 112px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.cal-cell:hover { border-color: var(--accent-line); }
.cal-cell.other { background: transparent; opacity: .55; }
.cal-cell.before .num { color: var(--faint); }
.cal-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-cell .num { font-size: 13px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.cal-cell.today .num { background: var(--accent); color: #fff; }
.chips-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-chip { --k: var(--accent); display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font-size: 12px; line-height: 1.3; padding: 4px 7px 5px; border-radius: 8px; color: var(--text);
  background: color-mix(in srgb, var(--k) 14%, var(--surface-solid)); border-left: 3px solid var(--k); overflow: hidden; }
.ev-chip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-chip .l1 { font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--k) 80%, var(--text)); }
.ev-chip .l2 { font-weight: 500; }
.ev-chip.post .l1 { color: var(--faint); }
.ev-chip:hover { background: color-mix(in srgb, var(--k) 24%, var(--surface-solid)); }
.ev-chip.past { opacity: .55; }
.ev-chip.post { background: transparent; border: 1px dashed var(--line); border-left: 3px dashed var(--faint); color: var(--muted); }
.ev-chip.post.st-approved { border-left-color: var(--ok); } .ev-chip.post.st-pending { border-left-color: var(--warn); }
.ev-chip.post.st-rejected { border-left-color: var(--bad); } .ev-chip.post.st-published { border-left-color: var(--info); }
.more { border: 0; background: none; font-size: 11px; font-weight: 700; color: var(--accent); text-align: left; padding: 2px 4px; cursor: pointer; }
.dots { display: none; gap: 3px; justify-content: center; margin-top: auto; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--accent)); }
.dots i.p { background: transparent; border: 1.5px solid var(--faint); width: 5px; height: 5px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.cal-legend .leg-post i { background: transparent; border: 1.5px dashed var(--faint); }
.day-panel { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; animation: rise .2s ease both; }
.day-list { display: flex; flex-direction: column; gap: 6px; }
.day-list .ev-chip { font-size: 14px; padding: 9px 11px; }
.day-list .ev-chip .l1 { font-size: 12px; }

/* Nächste Termine */
.cal-side { padding: 18px; position: sticky; top: 84px; }
.cal-side h3 { margin-bottom: 12px; }
.up-list { display: flex; flex-direction: column; gap: 8px; }
.up-item { --k: var(--accent); display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface-solid); border-radius: 14px; padding: 10px; cursor: pointer; transition: .15s; }
.up-item:hover { border-color: var(--k); transform: translateX(2px); }
.up-date { width: 46px; flex: none; border-radius: 11px; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); display: flex; flex-direction: column; align-items: center; padding: 5px 0; }
.up-date b { font-size: 19px; line-height: 1.1; }
.up-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.up-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.up-txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-txt small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.up-txt small svg { width: 12px; height: 12px; }
.up-txt .up-cust { color: var(--k); font-weight: 700; }
.up-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 18px 6px; }
.up-empty svg { width: 30px; height: 30px; color: var(--faint); }

/* Termin-Details & Editor */
.kind-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); }
.appt-modal .modal-head { align-items: flex-start; }
.appt-rows { display: flex; flex-direction: column; gap: 14px; }
.appt-rows > div { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.appt-rows > div > svg { margin-top: 2px; color: var(--muted); }
.appt-rows .pre { white-space: pre-wrap; }
.appt-modal .modal-foot .spacer { flex: 1; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: 1 / -1; } }
input[type=date], input[type=time] { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); outline: none; }
select { appearance: auto; }

/* Nächster Termin (Kunde) & Kundenkarten */
.next-appt { --k: var(--accent); display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; color: inherit; border-left: 4px solid var(--k); transition: transform .2s; }
.next-appt:hover { transform: translateY(-2px); }
.na-ico { font-size: 26px; }
.na-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.na-txt small { font-size: 12px; font-weight: 700; color: var(--k); text-transform: uppercase; letter-spacing: .05em; }
.na-txt b { font-size: 16px; }
.na-txt span { font-size: 14px; color: var(--muted); }
.na-go { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.cust-next { --k: var(--accent); font-size: 13px; color: var(--muted); padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--k) 10%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-next b { color: var(--text); }

@media (max-width: 720px) {
  .cal { padding: 12px; }
  .cal-nav h2 { min-width: 0; font-size: 17px; }
  .cal-week, .cal-grid { gap: 3px; }
  .cal-week span { padding: 0; text-align: center; font-size: 11px; }
  .cal-cell { min-height: 54px; padding: 4px 2px; align-items: center; border-radius: 10px; }
  .chips-col { display: none; }
  .dots { display: flex; }
  .cal-side { position: static; }
  .na-go { display: none; }
}
