/* DKM Social Studio – Basis-Styles
   Farben sind provisorisch aus Reisekosten-App und Server-Dashboard übernommen (siehe docs/decisions.md). */

:root {
  --primary: #1A3A5C;
  --primary-2: #2E6DA4;
  --primary-soft: #e6eef7;
  --accent: #E8950A;
  --success: #2fb27d;
  --danger: #e0654f;
  --warn: #b9631a;
  --warn-bg: #fef3e6;
  --bg: #F4F7FB;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar: #0d2340;
  --sidebar-text: #c9d8ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 35, 64, 0.06), 0 4px 16px rgba(13, 35, 64, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-soft: #1b2f47;
    --bg: #0a1826;
    --card: #10233a;
    --text: #e7eff9;
    --muted: #93a6bf;
    --border: #1d3550;
    --warn-bg: #3a2a14;
    --warn: #f2a154;
    --sidebar: #071426;
  }
}

:root[data-theme="dark"] {
  --primary-soft: #1b2f47;
  --bg: #0a1826;
  --card: #10233a;
  --text: #e7eff9;
  --muted: #93a6bf;
  --border: #1d3550;
  --warn-bg: #3a2a14;
  --warn: #f2a154;
  --sidebar: #071426;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
p { margin: 0.4rem 0; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.warn-text { color: var(--warn); font-weight: 600; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
/* Logo: DKM-Marke in der Kachel-Form des Webseiten Studios, in DKM-Blau */
.brand { display: flex; align-items: center; gap: 13px; padding: 2px 6px 6px; color: #fff; }
.brand:hover { text-decoration: none; }
.logo-tile {
  position: relative;
  flex: 0 0 auto;
  width: var(--s, 46px);
  height: var(--s, 46px);
  border-radius: calc(var(--s, 46px) * 0.3);
  border: 1.5px solid transparent;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #1A3A5C, #5aa8e8) border-box;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(46, 109, 164, 0.35);
}
.logo-tile img { width: 72%; height: auto; display: block; }
.logo-spark {
  position: absolute;
  top: calc(var(--s, 46px) * -0.12);
  right: calc(var(--s, 46px) * -0.12);
  width: calc(var(--s, 46px) * 0.38);
  height: calc(var(--s, 46px) * 0.38);
  fill: var(--accent);
}
.brand-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: inherit;
}
.brand-name small {
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #5aa8e8, #8cc7f5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 18px; color: var(--text); }
.mobile-brand:hover { text-decoration: none; }
.mobile-brand .brand-name small { background: linear-gradient(90deg, var(--primary-2), #5aa8e8); -webkit-background-clip: text; background-clip: text; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  color: var(--sidebar-text);
  padding: 10px 12px;
  border-radius: 10px;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.sidebar nav a.active { background: var(--primary-2); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: 0.8rem; opacity: 0.7; }

.content { padding: 24px 32px 48px; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar p { margin-top: 4px; }

.bottomnav { display: none; }

/* Komponenten */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-editor { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  border-radius: var(--radius);
  padding: 18px 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 0.875rem; opacity: 0.9; }
.kpi-value { font-size: 2rem; font-weight: 700; }
.kpi-blue { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.kpi-orange { background: linear-gradient(135deg, #E8950A, #f2a154); }
.kpi-green { background: linear-gradient(135deg, #1f8f63, var(--success)); }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.list-item:first-of-type { border-top: 0; }
.list-item:hover { text-decoration: none; background: var(--primary-soft); border-radius: 10px; }
.list-item.static:hover { background: none; }
.list-title { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.avatar-lg { width: 52px; height: 52px; font-size: 1.2rem; }

.status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-2);
  white-space: nowrap;
}
.status-arbeitet { background: #e3f6ee; color: #1f8f63; }
.status-wartet { background: var(--primary-soft); color: var(--muted); }
.status-review { background: var(--warn-bg); color: var(--warn); }
.status-freigegeben { background: #e3f6ee; color: #1f8f63; }
.status-verworfen { background: #fbe7e2; color: var(--danger); }
.status-neu, .status-entwurf { background: var(--primary-soft); color: var(--primary-2); }

.chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex;
  gap: 12px;
  padding: 8px 0 8px 12px;
  border-left: 3px solid var(--border);
}
.timeline .time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; }
.timeline .kind-ok { border-left-color: var(--success); }
.timeline .kind-warn { border-left-color: var(--accent); }
.timeline .kind-approval { border-left-color: var(--primary-2); }

.agents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.agent-head { display: flex; align-items: center; gap: 12px; }
.agent-head h2 { flex: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter:hover { text-decoration: none; }

.notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.notice-warn { background: var(--warn-bg); color: var(--warn); }

.form { display: flex; flex-direction: column; gap: 8px; }
.form label { font-weight: 600; font-size: 0.9rem; margin-top: 8px; }
.form input, .form textarea {
  font: inherit;
  font-size: 16px; /* verhindert Zoom in iOS-Safari */
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  width: 100%;
}
.form textarea { resize: vertical; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--primary-soft); color: var(--primary); border-color: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

.linkedin-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--card);
}
.preview-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.preview-body { white-space: pre-wrap; }
.preview-tags { color: var(--primary-2); margin-top: 10px; }

.stack-nowrap { white-space: nowrap; }

/* Mobil */
@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px 16px 96px; }
  h1 { font-size: 1.35rem; }
  .topbar { flex-direction: column; gap: 8px; }
  .kpis { grid-template-columns: 1fr; }
  .grid-2, .grid-editor, .agents { grid-template-columns: 1fr; }

  .bottomnav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    z-index: 10;
  }
  .bottomnav a {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 6px 0;
    border-radius: 10px;
  }
  .bottomnav a.active { color: var(--primary-2); font-weight: 700; }
  .bottomnav .fab {
    align-self: start;
    justify-self: center;
    width: 52px;
    height: 52px;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.8rem;
    line-height: 52px;
    padding: 0;
    box-shadow: var(--shadow);
  }
  .bottomnav .fab.active { color: #fff; }
}

/* Phase 1b: Erweiterungen */
.kpis { grid-template-columns: repeat(4, 1fr); }
.kpi { text-decoration: none; }
.kpi:hover { text-decoration: none; filter: brightness(1.05); }
.kpi-purple { background: linear-gradient(135deg, #5b4bb7, #7c6bd6); }

.notice-info { background: var(--primary-soft); color: var(--primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice-info { color: var(--text); }
}

.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }

.form select {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.form .check, label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form .check input, label.check input { width: auto; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form label { margin-top: 0; }
.inline-form input, .inline-form select { width: auto; }
.source select { font: inherit; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); }

.run-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.run-card .actions { margin-top: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.status-pausiert { background: var(--warn-bg); color: var(--warn); }
.status-aus { background: #eef2f6; color: var(--muted); }
.status-geplant { background: #ece8fb; color: #5b4bb7; }

.source { flex-wrap: wrap; }
.source-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.source-actions .btn { padding: 8px 12px; font-size: 0.875rem; }

.media-grid, .media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-item, .media-option { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.media-item img, .media-item video, .media-option img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--primary-soft);
}
.media-option { cursor: pointer; }
.media-video { padding: 24px; text-align: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); }
.preview-img { width: 100%; border-radius: 10px; margin-top: 12px; }

.budget-bar { height: 10px; background: var(--primary-soft); border-radius: 999px; overflow: hidden; }
.budget-fill { height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--accent)); }

@media (max-width: 899px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .bottomnav { grid-template-columns: repeat(5, 1fr); }
  .inline-form input, .inline-form select { width: 100%; }
}

@media (max-width: 899px) {
  .mobile-brand { display: flex; }
}

/* Team: eckige Kacheln mit eigenem Symbol, Orchestrator als Teamchef */
.agent-tile { color: #1D84C1; }
.agent-tile > svg:not(.logo-spark) { width: 58%; height: 58%; display: block; }
.agent-tile.chief {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #1A3A5C, #E8950A) border-box;
  box-shadow: 0 8px 20px rgba(232, 149, 10, 0.3);
}
.agent-title { flex: 1; min-width: 0; }
.chief-card {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, var(--primary-soft), var(--card) 45%);
}
.badge-chief {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 4px;
}
.team-link { display: flex; flex-direction: column; align-items: center; margin: -8px 0 12px; color: var(--muted); font-size: 0.8rem; }
.team-link::before { content: ""; width: 2px; height: 22px; background: var(--border); }
.team-link::after { content: ""; width: 2px; height: 14px; background: var(--border); }
.team-link span { padding: 4px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); text-align: center; }

.steps { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.step { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font-size: 0.8rem; }
.step-n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-2); display: grid; place-items: center; font-weight: 700; }
.step-text strong { display: block; }
.step-done { opacity: 0.65; }
.step-done .step-n { background: var(--success); color: #fff; }
.step-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232, 149, 10, 0.25); }
.step-current .step-n { background: var(--accent); color: #fff; }

.chief-row { background: var(--primary-soft); border-radius: 10px; padding: 8px; }
.sub-row { padding-left: 20px; }
.top-actions { margin: 0 0 16px; }
.block { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Chat */
.chat-card { display: flex; flex-direction: column; gap: 14px; }
.chat-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-who { display: flex; gap: 12px; align-items: center; }
.small-btn { padding: 6px 12px; font-size: 0.85rem; }
.messages { display: flex; flex-direction: column; gap: 12px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--primary-soft); }
.msg-user .bubble { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.bubble p { margin: 0; white-space: pre-wrap; }
.msg-time { display: block; font-size: 0.7rem; opacity: 0.7; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { font: inherit; font-size: 0.85rem; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.chip-btn:hover { background: var(--primary-soft); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); resize: vertical; }

@media (max-width: 899px) {
  .bottomnav { align-items: center; }
  .bottomnav .two-line { font-size: 0.68rem; line-height: 1.15; }
  .bottomnav .fab svg { width: 26px; height: 26px; display: block; margin: 13px auto; }
  .msg { max-width: 94%; }
  .chat-form { flex-direction: column; align-items: stretch; }
}

/* Lesbare sekundäre Buttons im Dunkelmodus */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-secondary { color: var(--text); }
}
:root[data-theme="dark"] .btn-secondary { color: var(--text); }

@media (max-width: 899px) {
  .messages { max-height: 38vh; }
  .chat-form {
    position: sticky;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 5;
    background: var(--card);
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
  }
  .chat-form .btn { width: 100%; }
}

/* ======================================================================
   Design-Update: eigene Schriften, ruhigere Flächen, Symbole, Hell/Dunkel
   ====================================================================== */
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/sora-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/sora-latin-700-normal.woff2) format("woff2"); }

:root {
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font-body);
  --radius: 16px;
  --link: #1f6fb2;
  --glow: rgba(46, 109, 164, 0.10);
  --on-accent: #1b1306;
  --shadow: 0 1px 2px rgba(13, 35, 64, 0.05), 0 12px 28px -14px rgba(13, 35, 64, 0.18);
}
:root[data-theme="dark"] {
  --link: #6db3ee;
  --glow: rgba(90, 168, 232, 0.10);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 30px -16px rgba(0, 0, 0, 0.6);
  --bg: #0a1826;
  --card: #10233a;
  --border: #1f3652;
}
:root[data-theme="light"] { --bg: #F1F5FA; }

body {
  font-family: var(--font-body);
  background: radial-gradient(900px 420px at 85% -8%, var(--glow), transparent 70%), var(--bg);
  background-attachment: fixed;
  letter-spacing: -0.003em;
}
h1, h2, .kpi-value, .brand-name, .badge-chief, .step-n { font-family: var(--font-display); }
h1 { font-size: clamp(1.55rem, 1.2rem + 1vw, 2rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.topbar p { max-width: 62ch; margin-top: 6px; }
a { color: var(--link); }

.app { grid-template-columns: 264px 1fr; }
.content { max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px clamp(20px, 3.5vw, 44px) 56px; }

/* Seitenleiste mit Symbolen */
.sidebar { gap: 22px; padding: 22px 14px; }
.sidebar nav { gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; font-weight: 500; font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.sidebar nav a .icon { flex: 0 0 auto; opacity: 0.8; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, #2E6DA4, #3f86c6); color: #fff; box-shadow: 0 8px 18px -6px rgba(46, 109, 164, 0.6); }
.sidebar nav a.active .icon { opacity: 1; }
.nav-sep { display: block; height: 1px; background: rgba(255, 255, 255, 0.09); margin: 8px 8px; }

/* Karten und Kacheln */
.card { border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.kpi { border-radius: 18px; padding: 20px 22px; min-height: 116px; position: relative; overflow: hidden; justify-content: space-between; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s; }
.kpi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 55%); pointer-events: none; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(13, 35, 64, 0.5); }
.kpi-label { font-weight: 500; opacity: 0.92; }
.kpi-value { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.list-item { border-radius: 12px; transition: background 0.15s; }
.chip { font-weight: 500; }

/* Buttons und Felder */
.btn { border-radius: 12px; padding: 10px 18px; font-weight: 600; transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn-primary { background: linear-gradient(135deg, #f2a124, #E8950A); color: var(--on-accent); box-shadow: 0 8px 18px -8px rgba(232, 149, 10, 0.7); }
.btn-primary:hover { box-shadow: 0 10px 22px -8px rgba(232, 149, 10, 0.85); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary-2); }
.btn-danger:hover { background: rgba(224, 101, 79, 0.1); }
.badge-chief { color: var(--on-accent); }
.form input, .form textarea, .form select, .chat-form textarea { border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; }
.form input:focus, .form textarea:focus, .form select:focus, .chat-form textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.22); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hell/Dunkel-Umschalter */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.theme-toggle:hover { border-color: var(--primary-2); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle .ti { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-sun { display: inline-flex; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: inline-flex; }
.mobile-bar { display: none; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mobile-bar .mobile-brand { margin-bottom: 0; display: flex; }

/* Mobile Navigation mit Symbolen */
@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; }
  .desktop-only { display: none; }
  .content { padding: 18px 16px 100px; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.68rem; line-height: 1.15; padding: 6px 0; color: var(--muted); }
  .bottomnav a.active { color: var(--link); font-weight: 600; }
  .bottomnav .fab { color: var(--on-accent); background: linear-gradient(135deg, #f2a124, #E8950A); }
  .bottomnav .fab.active { color: var(--on-accent); }
  .bottomnav .fab svg { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Helle Seitenleiste im Hell-Modus (im Dunkelmodus bleibt sie marineblau) */
:root[data-theme="light"] .sidebar {
  background: #ffffff;
  color: #41566f;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 30px -22px rgba(13, 35, 64, 0.35);
}
:root[data-theme="light"] .brand { color: var(--text); }
:root[data-theme="light"] .brand-name small {
  background: linear-gradient(90deg, #2E6DA4, #5aa8e8);
  -webkit-background-clip: text;
  background-clip: text;
}
:root[data-theme="light"] .sidebar nav a { color: #41566f; }
:root[data-theme="light"] .sidebar nav a:hover { background: rgba(26, 58, 92, 0.07); color: var(--primary); }
:root[data-theme="light"] .sidebar nav a.active { color: #ffffff; }
:root[data-theme="light"] .nav-sep { background: var(--border); }
:root[data-theme="light"] .sidebar-foot { color: var(--muted); }

/* ======================================================================
   Bewegung: mitlaufender Lichtschein (wie im Eigenbeleg-Generator) und
   leichtes Anheben (wie in der Reisekosten-App). Nur mit Maus (hover: hover).
   ====================================================================== */
.sidebar nav a, .card.agent, .chief-card { position: relative; overflow: hidden; }
.sidebar nav a > *, .card.agent > *, .chief-card > * { position: relative; z-index: 1; }

.sidebar nav a::after, .card.agent::after, .chief-card::after, .kpi::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(var(--glow-r, 180px) circle at var(--mx, 50%) var(--my, 50%), var(--glow-c, rgba(46, 109, 164, 0.16)), transparent 65%);
}
.sidebar nav a { --glow-r: 110px; --glow-c: rgba(255, 255, 255, 0.26); }
:root[data-theme="light"] .sidebar nav a { --glow-c: rgba(46, 109, 164, 0.22); }
.kpi { --glow-r: 240px; --glow-c: rgba(255, 255, 255, 0.34); }
.card.agent, .chief-card { --glow-r: 260px; --glow-c: rgba(46, 109, 164, 0.16); }
:root[data-theme="dark"] .card.agent, :root[data-theme="dark"] .chief-card { --glow-c: rgba(109, 179, 238, 0.20); }

.sidebar nav a .icon, .agent-tile, .brand .logo-tile { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.card.agent, .chief-card { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s, border-color 0.2s; }
.btn:disabled { transform: none; }

@media (hover: hover) {
  .sidebar nav a:hover::after, .card.agent:hover::after, .chief-card:hover::after, .kpi:hover::before { opacity: 1; }
  .sidebar nav a:hover { transform: translateX(4px); }
  .sidebar nav a:hover .icon { transform: scale(1.14) rotate(-5deg); opacity: 1; }
  .brand:hover .logo-tile { transform: rotate(-5deg) scale(1.06); }
  .card.agent:hover { transform: translateY(-4px); border-color: var(--primary-2); box-shadow: 0 20px 36px -18px rgba(13, 35, 64, 0.5); }
  .chief-card:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -18px rgba(232, 149, 10, 0.45); }
  .card.agent:hover .agent-tile, .chief-card:hover .agent-tile { transform: translateY(-2px) rotate(-5deg) scale(1.06); }
  .btn:hover { transform: translateY(-1px); }
  .list-item:hover .agent-tile { transform: rotate(-5deg) scale(1.08); }
}

/* Aktiver Eintrag in der Seitenleiste bleibt beim Überfahren blau mit weißer Schrift */
.sidebar nav a.active, .sidebar nav a.active:hover,
:root[data-theme="light"] .sidebar nav a.active,
:root[data-theme="light"] .sidebar nav a.active:hover {
  background: linear-gradient(135deg, #2E6DA4, #3f86c6);
  color: #ffffff;
}
.sidebar nav a.active, :root[data-theme="light"] .sidebar nav a.active { --glow-c: rgba(255, 255, 255, 0.30); }

/* Bibliothek */
.lib-search { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-search input { flex: 1; min-width: 220px; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.lib-item { display: flex; flex-direction: column; gap: 8px; }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lib-text { margin: 0; white-space: pre-wrap; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Mitarbeiter-Profile: klickbare Karten, Foto rechts unter dem Status */
.card.agent > .card-link { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.card.agent { cursor: pointer; }
.head-link { color: inherit; border-radius: 12px; }
.head-link:hover { text-decoration: none; }
.agent-head { align-items: flex-start; }
.agent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.agent-photo {
  width: var(--s, 48px); height: var(--s, 48px); border-radius: 14px; object-fit: cover; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--primary-soft); box-shadow: 0 6px 14px -8px rgba(13, 35, 64, 0.5);
}
.agent-photo.empty { border: 1.5px dashed var(--border); background: transparent; color: var(--muted); box-shadow: none; opacity: 0.8; }

.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.profile-card { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.profile-photo { display: grid; place-items: center; }
.profile-photo .agent-photo { border-radius: 22px; box-shadow: var(--shadow); }
.profile-id { display: flex; gap: 12px; align-items: center; }
.profile-facts { margin: 0; display: grid; gap: 10px; }
.profile-facts div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--border); padding-top: 10px; }
.profile-facts dt { color: var(--muted); font-size: 0.85rem; }
.profile-facts dd { margin: 0; text-align: right; font-weight: 500; }
@media (max-width: 899px) { .profile-grid { grid-template-columns: 1fr; } }

/* Mitarbeiterakte: Abschnitte im Formular */
.file-section { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 22px 0 2px; padding-top: 18px; border-top: 1px solid var(--border); }
.file-section.first { margin-top: 0; padding-top: 0; border-top: 0; }
.param-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 899px) { .param-row { grid-template-columns: 1fr; } }

/* Porträt: größeres Foto mit Vorname darunter */
.portrait { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.portrait figcaption { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; text-align: center; }
.agent-photo { border-radius: 20px; }
.portrait .agent-photo:not(.empty) { box-shadow: 0 12px 26px -12px rgba(13, 35, 64, 0.55); }
.profile-card .portrait figcaption { font-size: 1.25rem; }
.profile-card .portrait .agent-photo { border-radius: 26px; }
@media (hover: hover) { .card.agent:hover .portrait .agent-photo, .chief-card:hover .portrait .agent-photo { transform: scale(1.03); } }
.portrait .agent-photo { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* Agenten-Karten: eine Spalte, wenn zwei nebeneinander zu eng würden */
.agents { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.agent .agent-title h2 { overflow-wrap: anywhere; }

/* Sub-Agent-Karte: Text links, Foto mit Name rechts über die ganze Höhe */
.card.agent { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; align-content: start; }
.card.agent > .agent-head, .card.agent > p { grid-column: 1; }
.card.agent > .agent-side { grid-column: 2; grid-row: 1 / span 3; align-items: center; justify-content: flex-start; }
@media (max-width: 520px) {
  .card.agent { grid-template-columns: 1fr; }
  .card.agent > .agent-side { grid-column: 1; grid-row: auto; flex-direction: row-reverse; justify-content: space-between; align-items: flex-end; order: -1; margin-bottom: 8px; }
}

.persona-quote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--primary-soft); border-radius: 0 10px 10px 0; font-size: 0.9rem; font-style: italic; color: var(--text); }

/* Eigene Farbe je Mitarbeiter, passend zum Foto: Symbol und Rand der Kachel */
.agent-tile.tone-orchestrator { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.40); }
.agent-tile.tone-researcher   { --tc: #1a9a66; --tc2: #6fdcae; --tc-shadow: rgba(26, 154, 102, 0.35); }
.agent-tile.tone-writer       { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.35); }
.agent-tile.tone-picgen       { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }
.agent-tile.tone-reviewer     { --tc: #d9423a; --tc2: #f08a80; --tc-shadow: rgba(217, 66, 58, 0.35); }
.agent-tile[class*="tone-"] {
  color: var(--tc);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, var(--tc), var(--tc2)) border-box;
  box-shadow: 0 8px 18px -8px var(--tc-shadow);
}
.agent-tile.tone-orchestrator { background: linear-gradient(#fff4e3, #fff4e3) padding-box, linear-gradient(135deg, var(--tc), var(--tc2)) border-box; }
.agent-tile.tone-orchestrator .logo-spark { fill: var(--tc); }

/* Aktionsleiste: Hauptaktion links, Auswahlmenü ganz rechts */
.actions.action-split { align-items: center; }
.actions.action-split .menu { margin-left: auto; }
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--primary-2); }
.menu .chev { transition: transform 0.2s ease; }
.menu[open] .chev { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; min-width: 220px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 40px -14px rgba(13, 35, 64, 0.55);
}
.menu-panel form { margin: 0; }
.menu-item { display: block; width: 100%; text-align: left; font: inherit; font-weight: 500; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.menu-item:hover:not(:disabled) { background: var(--primary-soft); }
.menu-item:disabled { opacity: 0.45; cursor: not-allowed; }
.menu-item.danger { color: var(--danger); }
@media (max-width: 899px) { .actions.action-split .menu { margin-left: 0; } .menu-panel { left: 0; right: auto; } }

/* Status-Kacheln: gelb = wartet, grün = at work, rot = offline */
.status { border-radius: 10px; padding: 5px 12px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.status-wartet   { background: #fbbf24; color: #3a2a00; }
.status-pausiert { background: #fdba74; color: #4a2200; }
.status-arbeitet { background: #15803d; color: #ffffff; }
.status-offline  { background: #c4332b; color: #ffffff; }
.badge-chief.big { font-size: 0.8rem; padding: 5px 14px; letter-spacing: 0.16em; }
.agent-title .badge-chief + p { margin-top: 6px; }

/* Neue Idee */
.idea-form { display: flex; flex-direction: column; gap: 0; max-width: 920px; }
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-no { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--link); font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field-grid > div { display: flex; flex-direction: column; gap: 6px; }
.field-grid label { margin-top: 0; }
.improve-panel { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; background: var(--primary-soft); }
.improve-hints { margin: 8px 0; padding-left: 18px; color: var(--warn); font-size: 0.9rem; }
.improve-hints li { margin-bottom: 4px; }
.improve-text { white-space: pre-wrap; font-family: var(--font-body); font-size: 0.95rem; margin: 10px 0; padding: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.combine-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-top: 10px; }
.combine-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.combine-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.combine-item input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary-2); }
.combine-title { flex: 1; font-weight: 500; }
.idea-actions { margin: 4px 0 8px; }
.order-text { white-space: pre-wrap; margin: 0 0 12px; }
.mini-title { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 899px) { .field-grid { grid-template-columns: 1fr; } }

/* "at work": grüne Kachel pulsiert und ein helles Band läuft von links nach rechts */
.status { position: relative; }
.status-arbeitet {
  overflow: hidden;
  animation: work-pulse 1.8s ease-in-out infinite;
}
.status-arbeitet::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.38) 50%, transparent 100%);
  transform: translateX(-120%);
  animation: work-sweep 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes work-sweep {
  0%   { transform: translateX(-120%); }
  70%, 100% { transform: translateX(120%); }
}
@keyframes work-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(21, 128, 61, 0); }
}

/* Teamchefin-Karte: kompakt, Text links, Regina rechts über die volle Höhe */
.chief-card { display: grid; grid-template-columns: 1fr auto; column-gap: 22px; padding: 16px 20px; margin-bottom: 8px; align-items: start; }
.chief-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chief-main > * { margin: 0; }
.chief-card .agent-head { gap: 12px; align-items: center; }
.chief-task { font-size: 0.95rem; }
.chief-side { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-self: end; }
.steps.compact { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 6px; margin: 2px 0; }
.steps.compact .step { padding: 5px 8px; font-size: 0.74rem; gap: 6px; }
.steps.compact .step-n { width: 20px; height: 20px; border-radius: 6px; font-size: 0.75rem; }
.chief-main .actions { margin-top: 2px; }
.chief-note { font-size: 0.78rem; }
@media (max-width: 760px) {
  .chief-card { grid-template-columns: 1fr; }
  .chief-side { order: -1; flex-direction: row-reverse; justify-self: stretch; justify-content: space-between; align-items: flex-end; }
  .chief-side .agent-photo { width: 112px !important; height: 112px !important; }
}

/* Einstellungen: Budget und Verbindungen untereinander */
.notice-danger { background: rgba(224, 101, 79, 0.16); color: var(--danger); }
.notice-danger a, .notice-warn a { color: inherit; font-weight: 600; text-decoration: underline; }
.budget-fill.budget-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.budget-fill.budget-over { background: linear-gradient(90deg, #e0654f, #c4332b); }
.settings-card { max-width: 920px; }
fieldset.radio-cards { border: 0; padding: 0; margin: 14px 0 6px; display: grid; gap: 10px; }
.radio-cards legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.radio-card:hover { border-color: var(--primary-2); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--primary-soft); }
.radio-card input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.radio-card strong { display: block; }
.radio-card small { display: block; color: var(--muted); margin-top: 2px; font-size: 0.85rem; }

.conn-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.conn-row, .conn-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); transition: border-color 0.15s, background 0.15s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.conn-row:hover { text-decoration: none; border-color: var(--primary-2); }
.conn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conn-chev { color: var(--muted); flex: 0 0 auto; }
.conn-verbunden { border-color: #15803d; background: rgba(21, 128, 61, 0.10); }
.conn-verbunden:hover { border-color: #15803d; }
.status-verbunden { background: #15803d; color: #ffffff; }
.status-offen { background: #fbbf24; color: #3a2a00; }
.status-spaeter { background: #94a3b8; color: #1b2430; }
.conn-detail { display: flex; flex-direction: column; max-width: 820px; }
.conn-head { margin-bottom: 18px; align-items: center; }
.test-form { margin-top: 22px; }
@media (hover: hover) { .conn-row:hover { transform: translateX(3px); } }

/* Farben der Verbindungs-Kacheln */
.agent-tile.tone-conn-claude    { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.35); }
.agent-tile.tone-conn-lokal     { --tc: #0e8f9a; --tc2: #6fd3da; --tc-shadow: rgba(14, 143, 154, 0.35); }
.agent-tile.tone-conn-n8n       { --tc: #d93a68; --tc2: #f08aa8; --tc-shadow: rgba(217, 58, 104, 0.35); }
.agent-tile.tone-conn-linkedin  { --tc: #0a66c2; --tc2: #6fa8e6; --tc-shadow: rgba(10, 102, 194, 0.35); }
.agent-tile.tone-conn-bild      { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }
.agent-tile.tone-conn-instagram { --tc: #c4307a; --tc2: #f08ac0; --tc-shadow: rgba(196, 48, 122, 0.35); }
.agent-tile.tone-conn-sonstige  { --tc: #64748b; --tc2: #a9b6c8; --tc-shadow: rgba(100, 116, 139, 0.30); }

/* Modelle: Kacheln wie in den Einstellungen */
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
.conn-row.conn-aus { opacity: 0.85; }
.status-standard { background: var(--accent); color: var(--on-accent); }
.row-select { font: inherit; font-size: 0.9rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); max-width: 220px; }
.row-select:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.22); }
.cost { font-family: var(--font-display); font-weight: 600; min-width: 74px; text-align: right; }
@media (max-width: 899px) {
  .conn-row { flex-wrap: wrap; }
  .conn-row .row-actions { width: 100%; justify-content: flex-start; }
}

/* Einheitliche Zeilen-Kacheln für Vorschläge, Quellen, Bibliothek, Ideen */
.asterisk { color: var(--accent); font-weight: 700; }
.model-variant { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--link); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.price-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.price-label { color: var(--muted); font-size: 0.85rem; }
.price-value { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; }
.price-value small { font-family: var(--font-body); font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.price-forecast { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--primary-soft); border-radius: 0 10px 10px 0; margin: 4px 0 10px; }

.conn-row.conn-review { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.conn-row.conn-freigegeben, .conn-row.conn-geplant { border-color: #15803d; background: rgba(21, 128, 61, 0.10); }
.conn-row.conn-verworfen { opacity: 0.7; }
.conn-row.compact { padding: 8px 12px; margin-bottom: 8px; }
.conn-row.conn-tall { align-items: flex-start; }
.conn-title { font-weight: 600; color: var(--text); }
.conn-title:hover { color: var(--link); }
.combine-row { cursor: pointer; }
.combine-row input { width: 18px; height: 18px; accent-color: var(--primary-2); flex: 0 0 auto; }
.combine-list { max-height: 360px; overflow-y: auto; }
.media-item { border: 1px solid var(--border); border-radius: 16px; background: var(--card); padding: 10px; box-shadow: var(--shadow); }
.media-item img, .media-item video { border-radius: 12px; }

.agent-tile.tone-st-neu         { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.35); }
.agent-tile.tone-st-entwurf     { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }
.agent-tile.tone-st-review      { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.40); }
.agent-tile.tone-st-freigegeben { --tc: #1a9a66; --tc2: #6fdcae; --tc-shadow: rgba(26, 154, 102, 0.35); }
.agent-tile.tone-st-geplant     { --tc: #0e8f9a; --tc2: #6fd3da; --tc-shadow: rgba(14, 143, 154, 0.35); }
.agent-tile.tone-st-verworfen   { --tc: #d9423a; --tc2: #f08a80; --tc-shadow: rgba(217, 66, 58, 0.35); }
.agent-tile.tone-src-rss        { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.35); }
.agent-tile.tone-src-website    { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.35); }
.agent-tile.tone-src-presse     { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }

/* Wissensbibliothek */
.lib-add { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0; }
.lib-add-box { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.lib-thumb { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; }
.lib-thumb.small { width: 40px; height: 40px; border-radius: 11px; }
.filter .count { margin-left: 6px; font-size: 0.75rem; opacity: 0.75; }
.agent-tile.tone-lib-img  { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }
.agent-tile.tone-lib-doc  { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.35); }
.agent-tile.tone-lib-link { --tc: #0e8f9a; --tc2: #6fd3da; --tc-shadow: rgba(14, 143, 154, 0.35); }
@media (max-width: 899px) { .lib-add { grid-template-columns: 1fr; } }

/* Aktivitäten als Kacheln */
.conn-row.conn-act-warn { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.conn-row.act { margin: 0; }
.conn-list .conn-row.act.compact { padding: 8px 12px; }
.conn-row.act .conn-text strong { font-weight: 600; }

/* Zeitplan */
.schedule-form { display: flex; flex-direction: column; max-width: 920px; }
.schedule-form .step-title svg { }
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.day-chip { cursor: pointer; margin: 0; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span { display: inline-grid; place-items: center; min-width: 44px; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-weight: 600; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.day-chip:hover span { border-color: var(--primary-2); }
.day-chip input:checked + span { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.day-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset.radio-cards.compact { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0; }
.next-run { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--success); background: var(--primary-soft); border-radius: 0 10px 10px 0; }
.schedule-form .step-title .logo-tile { flex: 0 0 auto; }
[hidden] { display: none !important; }

.n8n-fields { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--primary-soft); }
.n8n-fields[hidden] { display: none; }

/* Anklickbarer Teil einer Kachel mit eigenen Schaltflächen daneben */
.conn-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; }
.conn-link:hover { text-decoration: none; }
.conn-link:hover strong { color: var(--link); }

/* Bildvorschläge, Prüfung, LinkedIn-Vorschau */
.img-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 14px 0; }
.img-option { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); transition: border-color 0.15s, box-shadow 0.15s; }
.img-option.chosen { border-color: #15803d; box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.22); }
.img-option img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 12px; display: block; }
.img-meta p { margin: 4px 0 0; }
.img-option .btn, .img-option .status { align-self: flex-start; }

.li-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.li-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.li-switch { display: flex; gap: 8px; }
.li-stage { display: flex; justify-content: center; padding: 24px 12px; border-radius: 18px; background: #f3f2ef; }
.li-post { width: 100%; max-width: 555px; background: #ffffff; color: #1d2226; border: 1px solid #e0dfdc; border-radius: 10px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.45; overflow: hidden; }
.li-stage[data-device="mobile"] .li-post { max-width: 340px; font-size: 13.5px; }
.li-head { display: flex; gap: 10px; padding: 12px 16px 6px; align-items: center; }
.li-avatar { width: 48px; height: 48px; border-radius: 6px; border: 1px solid #e0dfdc; background: #fff; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.li-avatar img { width: 80%; height: auto; }
.li-who { display: flex; flex-direction: column; line-height: 1.3; }
.li-who strong { font-size: 14px; }
.li-who span { font-size: 12px; color: #666666; }
.li-body { padding: 6px 16px 10px; }
.li-text { white-space: pre-wrap; word-break: break-word; }
.li-text.collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.li-tag { color: #0a66c2; font-weight: 600; }
.li-more { border: 0; background: none; color: #666666; font: inherit; cursor: pointer; padding: 4px 0 0; }
.li-more:hover { color: #0a66c2; text-decoration: underline; }
.li-image { width: 100%; display: block; aspect-ratio: 1.91 / 1; object-fit: cover; }
.li-actions { display: flex; justify-content: space-around; padding: 6px 8px 8px; border-top: 1px solid #e0dfdc; color: #666666; font-size: 13px; font-weight: 600; }
.li-actions span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px; }
.li-decide { margin: 0; }

.card-head { flex-wrap: wrap; gap: 8px 12px; }

/* Bildbeschreibungen und erzeugtes Bild */
.img-option-head { display: flex; align-items: center; gap: 12px; }
.img-title { font-weight: 600; margin: 4px 0 0; }
.img-desc { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; flex: 1; }
.img-option .btn { align-self: flex-start; }
.img-final { display: grid; grid-template-columns: minmax(220px, 1.2fr) 1fr; gap: 18px; align-items: start; margin: 14px 0; }
.img-final img { width: 100%; border-radius: 14px; aspect-ratio: 1.91 / 1; object-fit: cover; box-shadow: var(--shadow); }
@media (max-width: 899px) { .img-final { grid-template-columns: 1fr; } }

/* Eigene Bilder */
.own-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 10px 0; }
.own-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.own-img { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.own-img img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 12px; }
.own-img .btn { align-self: flex-start; }
.own-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 899px) { .own-forms { grid-template-columns: 1fr; } }

/* ======================================================================
   Team: Ablauf in zwei Reihen, Subagenten mit Farbrahmen und Verbindungslinie
   ====================================================================== */
.node-orchestrator { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.40); }
.node-researcher   { --tc: #1a9a66; --tc2: #6fdcae; --tc-shadow: rgba(26, 154, 102, 0.40); }
.node-writer       { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.40); }
.node-picgen       { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.40); }
.node-reviewer     { --tc: #d9423a; --tc2: #f08a80; --tc-shadow: rgba(217, 66, 58, 0.40); }
:root { --trunk: rgba(46, 109, 164, 0.55); }
:root[data-theme="dark"] { --trunk: rgba(109, 179, 238, 0.55); }

/* Teamchefin-Karte aufgeräumt */
.chief-card { padding: 24px 26px; row-gap: 22px; margin-bottom: 14px; }
.chief-main { gap: 12px; }
.chief-card .agent-head { gap: 14px; }

/* Ablauf: 1 bis 4 oben, 5 bis 8 darunter, nur zur Information, mit Pfeilen von 1 bis 8 */
.flow { --cg: 30px; --rg: 32px; grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--cg); row-gap: var(--rg); }
.flow-item { position: relative; min-width: 0; display: flex; }
.flow-step {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  padding: 16px 18px; border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: 16px;
  background: var(--card); color: var(--text); overflow: hidden; cursor: default;
}
.flow-n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 10px; background: var(--tc); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.flow-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.flow-text strong { font-size: 0.95rem; }
.flow-text span { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.flow-done .flow-step { opacity: 0.72; }
.flow-done .flow-n { background: var(--success); }
.flow-current .flow-step { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 149, 10, 0.25); }
.flow-current .flow-n { background: var(--accent); color: var(--on-accent); }

/* Pfeil nach rechts zum nächsten Schritt */
.flow-next { position: absolute; left: 100%; top: 50%; width: var(--cg); border-top: 2px solid var(--arrow); }
.flow-next::after { content: ""; position: absolute; right: -1px; top: -6px; border-left: 8px solid var(--arrow); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
/* Pfeil vom Ende der ersten Reihe zum Anfang der zweiten */
.flow-wrap { position: absolute; top: 100%; height: var(--rg); left: calc(-250% - 3 * var(--cg)); width: calc(300% + 3 * var(--cg)); }
.flow-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.flow-wrap path { fill: none; stroke: var(--arrow); stroke-width: 2; vector-effect: non-scaling-stroke; }
.flow-wrap-head { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); border-top: 8px solid var(--arrow); border-left: 5px solid transparent; border-right: 5px solid transparent; }
.flow-down { display: none; }

/* Schmale Fenster: Schritte untereinander mit Pfeil nach unten */
@media (max-width: 1200px) {
  .flow { grid-template-columns: 1fr; }
  .flow-next, .flow-wrap { display: none; }
  .flow-down { display: block; position: absolute; left: 50%; top: 100%; height: var(--rg); border-left: 2px solid var(--arrow); transform: translateX(-1px); }
  .flow-down::after { content: ""; position: absolute; bottom: -1px; left: -6px; border-top: 8px solid var(--arrow); border-left: 5px solid transparent; border-right: 5px solid transparent; }
}

/* Subagenten: farbiger Rahmen und Verbindung zur Teamchefin */
.agents-tree { --gutter: 52px; --tx: -26px; position: relative; padding-left: var(--gutter); margin-bottom: 20px; }
.tree-label { position: relative; margin: 0 0 22px; display: flex; align-items: center; min-height: 30px; }
.tree-label span { padding: 5px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 0.8rem; color: var(--muted); }
.tree-label::before { content: ""; position: absolute; left: var(--tx); top: -14px; bottom: -22px; width: 3px; background: var(--trunk); border-radius: 2px; }
.agent-node { position: relative; margin-bottom: 20px; }
.agent-node:last-child { margin-bottom: 0; }
.agent-node::before { content: ""; position: absolute; left: var(--tx); top: -22px; bottom: -20px; width: 3px; background: var(--trunk); border-radius: 2px; }
.agent-node:last-child::before { bottom: auto; height: calc(22px + 40px); }
.agent-node::after { content: ""; position: absolute; left: var(--tx); top: 38px; width: calc(-1 * var(--tx)); height: 3px; background: var(--tc); border-radius: 2px; }
.branch-dot { position: absolute; left: calc(var(--tx) - 6px); top: 31px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 3px solid var(--tc); z-index: 2; }
.agent-node .card.agent {
  margin: 0; padding: 22px 24px; border: 2px solid var(--tc);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 12%, var(--card)), var(--card) 48%);
  box-shadow: 0 16px 34px -20px var(--tc-shadow), var(--shadow);
}
.agent-node .card.agent .agent-title h2 { font-size: 1.15rem; }
@media (hover: hover) {
  .agent-node .card.agent:hover { border-color: var(--tc); box-shadow: 0 24px 40px -20px var(--tc-shadow), var(--shadow); }
}
@media (max-width: 700px) { .agents-tree { --gutter: 30px; --tx: -15px; } }

:root { --arrow: #2E6DA4; }
:root[data-theme="dark"] { --arrow: #6db3ee; }

/* Hover-Effekt der Ablauf-Kacheln (nur Information, nicht anklickbar) */
.flow-step { transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.2s; }
@media (hover: hover) {
  .flow-step:hover { transform: translateY(-4px); box-shadow: 0 18px 32px -18px var(--tc-shadow); border-color: var(--tc); }
}

/* Team-Seite: Ablauf kleiner und dezenter */
.flow-title { grid-column: 1 / -1; margin: 0; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chief-card { row-gap: 12px; }
.flow { --cg: 22px; --rg: 18px; }
.flow-step { gap: 8px; padding: 8px 10px; border-radius: 10px; border-left-width: 3px; background: color-mix(in srgb, var(--tc) 5%, var(--card)); }
.flow-n { width: 20px; height: 20px; border-radius: 6px; font-size: 0.72rem; }
.flow-text { gap: 1px; }
.flow-text strong { font-size: 0.78rem; }
.flow-text span { font-size: 0.7rem; line-height: 1.3; }
.flow-next, .flow-wrap path, .flow-down { opacity: 0.55; }
.flow-next { border-top-width: 1.5px; }
.flow-next::after { border-left-width: 6px; border-top-width: 4px; border-bottom-width: 4px; top: -5px; }
.flow-wrap path { stroke-width: 1.5; }
.flow-wrap-head { border-top-width: 6px; border-left-width: 4px; border-right-width: 4px; opacity: 0.55; }
@media (hover: hover) { .flow-step:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -14px var(--tc-shadow); } }

/* Subagenten: zwei Karten pro Reihe, Stamm in der Mitte */
.agents-tree { --gap: 44px; padding-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 20px; position: relative; }
.agents-tree::before { content: ""; position: absolute; left: 50%; top: -14px; bottom: 40px; width: 3px; margin-left: -1.5px; background: var(--trunk); border-radius: 2px; }
.tree-label { grid-column: 1 / -1; justify-content: center; margin: 0 0 2px; }
.tree-label::before { display: none; }
.agent-node { margin: 0; }
.agent-node::before { display: none; }
.agent-node::after { top: 38px; height: 3px; width: calc(var(--gap) / 2); }
.agent-node:nth-child(odd)::after { left: 100%; }
.agent-node:nth-child(even)::after { left: auto; right: 100%; }
.branch-dot { display: none; }
.agent-node .card.agent { padding: 18px 20px; height: 100%; }
.agent-node .card.agent > .agent-side .agent-photo { width: 96px !important; height: 96px !important; }
@media (max-width: 900px) {
  .agents-tree { grid-template-columns: 1fr; }
  .agents-tree::before, .agent-node::after { display: none; }
}

/* Korrektur: Das Label zählt als erstes Kind, daher stehen linke Karten an geraden Positionen */
.agent-node:nth-child(even)::after { left: 100%; right: auto; }
.agent-node:nth-child(odd)::after { left: auto; right: 100%; }

/* Anmeldung */
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 28px 26px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 6px 0 0; font-size: 1.5rem; }
.login-card p { margin: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.login-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.login-form input { font-size: 16px; }
.login-form .btn { margin-top: 10px; }
.logout-btn { background: none; border: 1px solid rgba(255, 255, 255, 0.25); color: inherit; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; opacity: 0.85; }
.logout-btn:hover { opacity: 1; }
.more-logout { margin-top: 14px; }

/* Betriebsart */
.check-list { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.check-list li.ok { color: var(--success); }
.check-list li.missing { color: var(--muted); }
.check-list span { display: inline-block; width: 1.2em; font-weight: 700; }

/* Profil-Verlauf */
.version { border-top: 1px solid var(--border); padding: 10px 0; }
.version summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.version-body { padding: 8px 0 2px; display: flex; flex-direction: column; gap: 6px; }
.version-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Export-Paket */
.status-veroeffentlicht { background: #dcebfa; color: #1f5f99; }
:root[data-theme="dark"] .status-veroeffentlicht { background: rgba(46, 109, 164, 0.28); color: #9fd0f7; }
.conn-row.conn-veroeffentlicht { border-color: #2E6DA4; background: rgba(46, 109, 164, 0.10); }
.agent-tile.tone-st-veroeffentlicht { --tc: #2E6DA4; --tc2: #78b4e8; --tc-shadow: rgba(46, 109, 164, 0.35); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.export-text { white-space: pre-wrap; max-height: 320px; overflow: auto; }
.export-images { display: flex; flex-direction: column; gap: 14px; }
.export-images figure { margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.export-images img { width: 100%; max-width: 420px; border-radius: 12px; border: 1px solid var(--border); }
.export-checks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* Ablauf: Nummernfelder tragen immer die Farbe des Mitarbeiters, der Zustand zeigt sich nur über Abdunklung und Rahmen */
.flow-done .flow-n, .flow-current .flow-n { background: var(--tc); color: #fff; }
.flow-current .flow-step { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 32%, transparent); }

/* Statusanzeige ohne Streifen-Effekt; in der Mitarbeiterakte und der Live-Ansicht ganz ruhig */
.status-arbeitet::after { content: none; animation: none; }
.status-still { animation: none !important; box-shadow: none !important; }
.live-link { font-size: 0.8rem; position: relative; z-index: 2; margin-left: 4px; white-space: nowrap; }

/* Live-Ansicht */
.live-card { display: flex; flex-direction: column; gap: 14px; }
.live-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.live-feed { display: flex; flex-direction: column; gap: 10px; max-height: 480px; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.live-msg { display: flex; align-items: flex-end; gap: 10px; max-width: 92%; }
.live-msg[hidden] { display: none; }
.live-avatar { flex: 0 0 auto; }
.live-bubble { padding: 9px 13px; border-radius: 14px 14px 14px 4px; border: 1px solid var(--border); background: var(--primary-soft); }
.live-bubble p { margin: 0; overflow-wrap: anywhere; }
.live-time { display: block; font-size: 0.7rem; opacity: 0.65; margin-top: 3px; }
.live-ok .live-bubble { border-color: rgba(21, 128, 61, 0.45); }
.live-warn .live-bubble { border-color: rgba(232, 149, 10, 0.6); }
.live-in { animation: live-in 0.35s ease-out both; }
@keyframes live-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.live-typing { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.live-typing[hidden] { display: none; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.live-feed { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* Mitarbeiterakte: der Satz bei "Aktuell" steht unter dem Wort, ruhig und gut lesbar */
.profile-facts div:nth-child(2) { flex-direction: column; align-items: flex-start; gap: 4px; }
.profile-facts div:nth-child(2) dd { text-align: left; font-weight: 400; font-size: 0.92rem; }

/* Team: größere Fotos, Status-Hinweis oben in der Kartenecke, Name nah am unteren Kartenrand */
@media (min-width: 900px) {
  .agent-node .card.agent { padding-bottom: 10px; }
  .agent-node .card.agent > .agent-side { margin-top: 22px; gap: 4px; }
  .agent-node .card.agent > .agent-side .agent-photo { width: 150px !important; height: 150px !important; }
  .agent-node .card.agent > .agent-side .status { position: absolute; top: 12px; right: 14px; }
  .agent-node .card.agent .portrait figcaption { margin-top: 4px; }
  .chief-side .agent-photo { width: 270px !important; height: 270px !important; }
}
@media (min-width: 900px) {
  /* Die Foto-Spalte ist selbst nicht der Bezugspunkt, damit der Status wirklich in der Kartenecke sitzt */
  .agent-node .card.agent > .agent-side { position: static; }
  .agent-node .card.agent > .agent-side .status { z-index: 3; }
  .agent-node .card.agent > .agent-side .portrait { position: relative; z-index: 1; }
}

/* Lokale Modelle: einklappbare Einstellungen je Modell */
.variant-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.variant { border: 1px solid var(--border); border-radius: 16px; background: var(--card); overflow: hidden; }
.variant[open] { border-color: var(--primary-2); box-shadow: 0 10px 24px -16px rgba(46, 109, 164, 0.5); }
.variant > summary { list-style: none; cursor: pointer; border: 0; border-radius: 0; margin: 0; }
.variant > summary::-webkit-details-marker { display: none; }
.variant[open] .conn-chev { transform: rotate(90deg); }
.variant-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.variant-body h3 { margin: 18px 0 2px; font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.variant-remove { margin-top: 14px; }
.variant-add { align-items: flex-end; flex-wrap: wrap; }
.variant-add input, .variant-add select { flex: 1 1 180px; }

/* Bibliothek: Kacheln je Bibliothek, Suche, Karten in Raster- oder Listenansicht */
.agent-tile.tone-lib-all  { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.35); }
.agent-tile.tone-lib-post { --tc: #1a9a66; --tc2: #6fdcae; --tc-shadow: rgba(26, 154, 102, 0.35); }
.lib-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.lib-tile {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
}
.lib-tile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lib-tile-count { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1; margin-bottom: 4px; }
.lib-tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 149, 10, 0.25); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
@media (hover: hover) { .lib-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 28px -18px rgba(0, 0, 0, 0.5); text-decoration: none; } }
.lib-add-panel { padding: 14px 18px; margin-bottom: 16px; }
.lib-add-panel > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.lib-add-panel > summary::-webkit-details-marker { display: none; }
.lib-add-panel[open] > summary { margin-bottom: 8px; }
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.lib-toolbar input[type="search"] { flex: 1 1 260px; min-width: 200px; font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.lib-view { display: inline-flex; gap: 6px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.lib-count { margin: 4px 2px 12px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s; }
.lib-card[hidden] { display: none; }
@media (hover: hover) { .lib-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -20px rgba(0, 0, 0, 0.55); } }
.lib-preview { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: var(--primary-soft); text-decoration: none; overflow: hidden; }
.lib-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-glyph { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lib-ext { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-snippet { padding: 14px 16px; color: var(--muted); font-size: 0.85rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; align-self: stretch; }
.lib-badge { position: absolute; top: 10px; right: 10px; }
.lib-body { padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lib-title { margin: 0; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.lib-title a { color: var(--text); text-decoration: none; }
.lib-title a:hover { text-decoration: underline; }
.lib-type { margin: 0; }
.lib-note { margin: 2px 0 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-flow { margin: 8px 0 0; display: grid; gap: 4px; font-size: 0.82rem; }
.lib-flow div { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: baseline; }
.lib-flow dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; font-weight: 700; }
.lib-flow dd { margin: 0; overflow-wrap: anywhere; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; }
.lib-actions form { margin: 0; }
/* Listenansicht: eine Zeile je Eintrag */
.lib-grid[data-view="liste"] { grid-template-columns: 1fr; gap: 10px; }
.lib-grid[data-view="liste"] .lib-card { flex-direction: row; align-items: center; }
.lib-grid[data-view="liste"] .lib-preview { aspect-ratio: auto; width: 120px; min-height: 84px; flex: 0 0 auto; align-self: stretch; }
.lib-grid[data-view="liste"] .lib-glyph .logo-tile { --s: 40px !important; }
.lib-grid[data-view="liste"] .lib-snippet { display: none; }
.lib-grid[data-view="liste"] .lib-body { padding: 10px 16px; min-width: 0; }
.lib-grid[data-view="liste"] .lib-flow { grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.lib-grid[data-view="liste"] .lib-actions { padding: 10px 16px; flex: 0 0 auto; justify-content: flex-end; max-width: 330px; }
.lib-empty[hidden] { display: none; }
@media (max-width: 1100px) { .lib-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .lib-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib-tile { padding: 12px 14px; gap: 10px; }
  .lib-grid[data-view="liste"] .lib-card { flex-direction: column; align-items: stretch; }
  .lib-grid[data-view="liste"] .lib-preview { width: auto; aspect-ratio: 16 / 7; }
  .lib-grid[data-view="liste"] .lib-flow { grid-template-columns: 1fr; }
  .lib-grid[data-view="liste"] .lib-actions { max-width: none; justify-content: flex-start; }
}
.lib-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.lib-use { display: block; }

/* Instagram-Vorschau */
.ig-post { max-width: 470px; }
.ig-image { width: 100%; background: #efefef; overflow: hidden; display: block; }
.ig-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-empty { display: grid; place-items: center; color: #8e8e8e; }
.ig-avatar { border-radius: 50%; }
.ig-actions { display: flex; gap: 14px; padding: 10px 14px 0; color: #262626; }
.ig-caption { color: #262626; }

.preview-tabs a.filter { text-decoration: none; }

/* Gemeinsame Vorschau: LinkedIn und Instagram nebeneinander */
.pv-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 1240px; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.pv-title { margin: 0 0 8px; font-size: 1.05rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ig-formats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pv-grid .li-stage { padding: 20px 10px; }
@media (max-width: 900px) { .pv-grid { grid-template-columns: 1fr; } }
.pv-card { margin: 0; }

/* Quellenliste: Partnerseiten abgesetzt */
.partner-block { border: 2px solid #E8950A; background: rgba(232, 149, 10, 0.08); border-radius: 18px; padding: 14px 16px 10px; margin: 6px 0 18px; }
.partner-title { margin: 0 0 10px; font-size: 1rem; color: #B36B00; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sources-title { margin: 18px 0 10px; font-size: 1rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.conn-row.partner-row { flex-wrap: wrap; border-color: #E8950A; }
.conn-row.partner-row .conn-text { flex: 1 1 260px; min-width: 0; }
.conn-row.partner-row .row-actions { width: 100%; justify-content: flex-start; }
:root[data-theme="dark"] .partner-title { color: #F2A154; }

/* Quelle hinzufügen: drei Gruppen nebeneinander */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-group { border: 1px solid var(--line, #d9e2ee); border-radius: 14px; padding: 12px 14px 14px; margin: 0; min-width: 0; }
.form-group legend { font-weight: 700; padding: 0 6px; font-size: 0.95rem; }
@media (max-width: 1000px) { .form-grid { grid-template-columns: 1fr; } }

/* Bild-Voreinstellungen */
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.preset-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line, #d9e2ee); border-radius: 14px; margin: 0; }
.preset-card .btn { align-self: flex-start; margin-top: auto; }
.preset-active { border: 2px solid #1e9e5e; background: rgba(30, 158, 94, 0.07); }
@media (max-width: 900px) { .preset-grid { grid-template-columns: 1fr; } }

/* Eigener Bildgenerator */
.draft-box { border: 2px solid #E8950A; background: rgba(232, 149, 10, 0.07); border-radius: 16px; padding: 14px 16px; margin: 12px 0 18px; }
.draft-grid { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.draft-img { margin: 0; max-width: 320px; }
.draft-img img { width: 100%; border-radius: 12px; display: block; }
.format-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .format-grid { grid-template-columns: 1fr; } }

.result-card { margin-top: .6rem; padding: .75rem; border: 1px solid var(--line, #d8dee8); border-radius: 12px; background: var(--card, #fff); }
.result-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .5rem 0; }
.result-imgs img { width: 100%; height: auto; border-radius: 8px; display: block; }
.result-text { white-space: pre-line; }

/* Medien: Bild generieren und Hochladen nebeneinander, gleich gross */
.media-top { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.media-top > .card { display: flex; flex-direction: column; margin: 0; max-width: none; }
.media-top > .card > form { display: flex; flex-direction: column; flex: 1; }
.media-top > .card > form .actions { margin-top: auto; padding-top: 14px; }
.media-top textarea { min-height: 120px; }
.media-top .btn-pill { min-width: 200px; }
.media-item { display: flex; flex-direction: column; gap: 8px; }
.media-item > a { display: block; }
.media-item img, .media-item video { width: 100%; height: auto; border-radius: 12px; display: block; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.media-actions form { margin: 0; }
.media-actions .btn, .media-actions form .btn { padding: 8px 14px; font-size: 14px; }
.media-big { max-width: 100%; max-height: 70vh; border-radius: 16px; display: block; }
.media-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) {
  .media-top, .media-detail-grid { grid-template-columns: 1fr; }
}

/* Vorschau: gleich grosse Geraete-Rahmen fuer LinkedIn und Instagram, Freigabe-Karten gleich aufgebaut */
.pv-grid { align-items: stretch; }
.pv-col { display: flex; flex-direction: column; min-width: 0; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; margin-bottom: 8px; }
.pv-head .pv-title { margin: 0; }
.pv-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pv-ctl.ig-formats { margin: 0; }
.net-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.95rem; font-weight: 700; color: #fff; }
.net-li { background: #0a66c2; }
.net-ig { background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); }
.dev-frame { width: 100%; margin: 0 auto; display: flex; flex-direction: column; background: #f3f2ef; overflow: hidden; box-shadow: 0 10px 30px rgba(15, 30, 50, 0.18); }
.dev-screen { flex: 1; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; }
.dev-frame .li-post { width: 100%; }
.dev-bar { display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 32px; background: #dfe4ea; border-bottom: 1px solid #cdd5df; flex: 0 0 auto; }
.dev-bar i { width: 10px; height: 10px; border-radius: 50%; background: #aab4c0; display: inline-block; }
.dev-bar span { margin-left: 10px; flex: 1; background: #fff; border-radius: 999px; padding: 2px 12px; font-size: 12px; color: #667085; }
.dev-notch { display: none; justify-content: center; padding: 8px 0 4px; background: #f3f2ef; flex: 0 0 auto; }
.dev-notch i { width: 90px; height: 18px; border-radius: 999px; background: #1b2430; display: block; }
.dev-frame[data-device="desktop"] { max-width: 600px; height: 640px; border: 1px solid #cdd5df; border-radius: 14px; }
.dev-frame[data-device="desktop"] .dev-screen { padding: 18px; }
.dev-frame[data-device="desktop"] .li-post { max-width: 500px; }
.dev-frame[data-device="desktop"] .ig-post { max-width: 340px; }
.dev-frame[data-device="mobile"] { max-width: 320px; height: 640px; border: 10px solid #1b2430; border-radius: 38px; }
.dev-frame[data-device="mobile"] .dev-bar { display: none; }
.dev-frame[data-device="mobile"] .dev-notch { display: flex; }
.dev-frame[data-device="mobile"] .dev-screen { padding: 6px 8px 12px; }
.dev-frame[data-device="mobile"] .li-post, .dev-frame[data-device="mobile"] .ig-post { max-width: 100%; font-size: 13px; }
.pv-note { text-align: center; margin: 10px 0 0; }
.pv-grid-cards { align-items: stretch; }
.pv-card { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.pv-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.pv-field { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pv-field textarea { width: 100%; }
.pv-image { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.pv-image .lbl { font-weight: 600; }
.pv-actions { margin-top: auto; }
@media (max-width: 900px) {
  .dev-frame[data-device="desktop"] { height: 560px; }
}
.dev-frame[data-device="desktop"] { height: 660px; }
.dev-frame[data-device="mobile"] .li-actions { padding: 4px 2px 6px; }
.dev-frame[data-device="mobile"] .li-actions span { gap: 3px; padding: 8px 3px; font-size: 11px; white-space: nowrap; }
.dev-frame[data-device="mobile"] .li-actions .icon { width: 16px; height: 16px; }

/* Anzeigepunkte mit Anzahl */
.nav-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E8950A; color: #1a1a1a; font-size: 12px; font-weight: 800; line-height: 1; margin-left: auto; }
.nav-dot[hidden] { display: none; }
.sidebar nav a { position: relative; }
.bottomnav a { position: relative; }
.bottomnav .nav-dot { position: absolute; top: 0; left: 50%; margin-left: 8px; min-width: 18px; height: 18px; font-size: 11px; box-shadow: 0 0 0 2px var(--card); }
.bottomnav .fab .nav-dot { top: -4px; left: auto; right: -4px; margin-left: 0; }

/* Vorschlaege: Gliederung */
.sug-top { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.sug-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.sug-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sug-stat strong { font-size: 1.6rem; line-height: 1.1; }
.sug-stat span { font-size: 0.85rem; color: var(--muted); }
.sug-stat-hot { border-color: #E8950A; box-shadow: 0 0 0 1px #E8950A inset; }
.sug-auto { margin: 0; }
.sug-auto .actions { margin-top: 8px; }
.sug-section { margin: 22px 0; scroll-margin-top: 16px; }
.sug-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sug-head h2, .sug-details h2 { margin: 0; font-size: 1.15rem; }
.sug-head p { margin: 0; }
.count-pill { display: inline-block; min-width: 24px; padding: 1px 9px; border-radius: 999px; background: var(--primary-soft, #e8f0f8); color: var(--text); font-size: 0.85rem; font-weight: 700; text-align: center; }
.sug-day { margin: 14px 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.sug-details summary { cursor: pointer; list-style: none; display: flex; align-items: center; padding: 8px 0; }
.sug-details summary::-webkit-details-marker { display: none; }
.sug-details summary h2::before { content: "▸ "; }
.sug-details[open] summary h2::before { content: "▾ "; }
.fresh-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #E8950A; color: #1a1a1a; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; vertical-align: middle; }
.conn-row.is-fresh { box-shadow: 0 0 0 2px #E8950A inset; }

/* So entstehen Vorschlaege */
.auto-steps { margin: 0 0 12px 1.2rem; padding: 0; display: grid; gap: 6px; }
.auto-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; margin: 6px 0; }
.depth-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }

/* Abschnitte der Vorschlagsliste: deutlich abgesetzte Ueberschriften */
.sug-section { margin: 30px 0; }
.sug-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; margin: 0 0 12px; border-radius: 14px; border-left: 6px solid var(--sec, #2E6DA4); background: color-mix(in srgb, var(--sec, #2E6DA4) 12%, var(--card)); }
.sug-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.sug-head p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.sug-head-neu { --sec: #E8950A; }
.sug-head-review { --sec: #2E6DA4; }
.sug-head-entwurf { --sec: #7a6bd0; }
.sug-head-freigegeben { --sec: #2fb27d; }

.auto-line { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.auto-line p { margin: 0; flex: 1; min-width: 220px; }
.auto-line form { margin: 0; }

/* Autopilot: Reiter und Uebersicht */
.ap-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.ap-tab { padding: 9px 16px; border-radius: 11px; color: var(--muted); font-weight: 600; text-decoration: none; }
.ap-tab:hover { background: var(--primary-soft, #e8f0f8); color: var(--text); }
.ap-tab.active { background: var(--primary-2, #2E6DA4); color: #fff; }
.ap-master { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.ap-master h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.ap-master p { margin: 4px 0; }
.ap-master form { margin: 0; }
.ap-flow { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ap-flow li { counter-increment: s; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--primary-soft, #e8f0f8); }
.ap-flow li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--primary-2, #2E6DA4); color: #fff; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; margin-bottom: 4px; }
.ap-flow span { font-size: 0.85rem; color: var(--muted); }
.ap-form { max-width: 760px; }
.day-row { display: flex; gap: 14px; flex-wrap: wrap; }
.link-like { color: var(--primary-2, #2E6DA4); font-weight: 600; }
[data-when][hidden] { display: none; }

/* Zaehler oben in den gleichen Farben wie die Abschnittsbaender */
.sug-stat { background: color-mix(in srgb, var(--sec, #2E6DA4) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--sec, #2E6DA4) 35%, var(--border)); box-shadow: none; }
.sug-stat strong { color: var(--text); }
.sug-stat-hot { box-shadow: none; }

/* Autopilot aktiv: helles Gruen mit sanfter Bewegung */
.ap-on { --ap-green: #2fb27d; position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--ap-green) 45%, var(--border)); background: linear-gradient(110deg, color-mix(in srgb, var(--ap-green) 9%, var(--card)) 0%, color-mix(in srgb, var(--ap-green) 22%, var(--card)) 50%, color-mix(in srgb, var(--ap-green) 9%, var(--card)) 100%); background-size: 240% 100%; animation: ap-flow 7s ease-in-out infinite; }
.ap-on::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; left: -45%; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--ap-green) 28%, transparent), transparent); animation: ap-sweep 5.5s ease-in-out infinite; pointer-events: none; }
.ap-on > * { position: relative; z-index: 1; }
.ap-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2fb27d; box-shadow: 0 0 0 0 rgba(47, 178, 125, 0.55); animation: ap-pulse 1.8s ease-out infinite; vertical-align: middle; }
@keyframes ap-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ap-sweep { 0% { left: -45%; } 60%, 100% { left: 115%; } }
@keyframes ap-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(47, 178, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0); } }
@media (prefers-reduced-motion: reduce) { .ap-on, .ap-on::after, .ap-dot { animation: none; } }

/* Neue Idee: farbige Schritte wie in der Vorschlagsliste */
.idea-form { max-width: 1000px; }
.idea-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg, transparent); }
.idea-step-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--sec) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--sec) 40%, var(--border)); }
.idea-step-chip b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--sec); color: #fff; font-size: 0.8rem; }
.idea-block { margin: 0 0 26px; scroll-margin-top: 70px; }
.idea-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px; border-radius: 14px; border-left: 6px solid var(--sec); background: color-mix(in srgb, var(--sec) 12%, var(--card)); }
.idea-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.idea-head p { margin: 2px 0 0; font-size: 0.92rem; color: var(--muted); }
.idea-head > div { flex: 1; }
.idea-no { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--sec); color: #fff; font-weight: 800; font-size: 1.1rem; }
.idea-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--sec) 20%, var(--card)); color: var(--text); white-space: nowrap; }
.idea-card { margin: 0; }
.idea-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.idea-src h3 { margin: 0 0 8px; font-size: 1rem; }
.idea-src textarea, .idea-src input[type="file"] { width: 100%; }
.idea-bar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(15, 30, 50, 0.08); }
.idea-bar p { margin: 0; flex: 1; min-width: 220px; }
.idea-bar .actions { margin: 0; }
@media (max-width: 820px) {
  .idea-sources { grid-template-columns: 1fr; }
  .idea-tag { display: none; }
  .idea-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Chat im WhatsApp-/Slack-Stil */
.chat-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.chat-main { display: flex; flex-direction: column; gap: 12px; height: clamp(560px, calc(100vh - 190px), 940px); padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.chat-head-text { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.chat-head-text strong { font-size: 1.1rem; }
.chat-head form { margin: 0; }
.messages.wa { flex: 1; max-height: none; min-height: 0; overflow-y: auto; gap: 8px; padding: 18px 20px; background: color-mix(in srgb, var(--primary-2, #2E6DA4) 7%, var(--card)); }
.wa-row { display: flex; align-items: flex-end; gap: 10px; max-width: 86%; }
.wa-their { align-self: flex-start; }
.wa-mine { align-self: flex-end; flex-direction: row-reverse; }
.wa-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); }
.wa-avatar .agent-photo { --s: 34px; border-radius: 50%; }
.wa-me { background: #fff; padding: 5px; }
.wa-me img { width: 100%; height: auto; display: block; }
.wa-bubble { position: relative; padding: 9px 14px 7px; border-radius: 6px 18px 18px 18px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(15, 30, 50, 0.06); font-size: 1.06rem; line-height: 1.5; min-width: 90px; }
.wa-mine .wa-bubble { border-radius: 18px 6px 18px 18px; background: #d9f4d4; border-color: #bfe6b8; color: #14301a; }
.wa-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.wa-name { display: block; font-size: 0.8rem; font-weight: 800; margin-bottom: 2px; color: var(--primary-2, #2E6DA4); }
.wa-role { font-weight: 500; color: var(--muted); }
.wa-time { display: block; text-align: right; font-size: 0.72rem; opacity: 0.65; margin-top: 3px; }
.mention { background: color-mix(in srgb, #E8950A 22%, transparent); border-radius: 6px; padding: 0 4px; font-weight: 700; }
.wa-typing { display: flex; gap: 5px; padding: 6px 2px; }
.wa-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: 0.5; animation: wa-dot 1.2s infinite ease-in-out; }
.wa-typing i:nth-child(2) { animation-delay: 0.2s; }
.wa-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wa-dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }
.wa-team { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 18px; }
.wa-mention { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.wa-mention:hover { background: var(--primary-soft, #e8f0f8); }
.wa-mention .agent-photo { --s: 22px; border-radius: 50%; }
.wa-mention span:last-child { padding-right: 2px; }
.chat-main .chips { padding: 0 18px; }
.wa-form { margin: 0 !important; padding: 12px 18px 16px; border-top: 1px solid var(--border); align-items: flex-end; gap: 10px; }
.wa-form textarea { flex: 1; min-height: 48px; max-height: 180px; padding: 12px 16px !important; border-radius: 24px !important; font-size: 1.05rem !important; resize: none !important; line-height: 1.4; }
.wa-send { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--accent, #E8950A); color: #1a1a1a; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 14px -4px rgba(232, 149, 10, 0.6); }
.wa-send:hover { filter: brightness(1.05); }
.chat-side { display: flex; flex-direction: column; gap: 14px; }
.chat-side .card { margin: 0; }
.chat-side h2 { font-size: 1.05rem; margin: 0 0 8px; }
.note-group { margin-bottom: 12px; }
.note-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--border); }
.note-row form { margin: 0; }
.note-x { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.note-x:hover { color: #c0392b; }
:root[data-theme="dark"] .wa-mine .wa-bubble { background: #1f4d3a; border-color: #2a6a4f; color: #e8fff1; }
@media (max-width: 1080px) { .chat-shell { grid-template-columns: 1fr; } .chat-main { height: clamp(520px, calc(100vh - 160px), 900px); } }
@media (max-width: 640px) { .wa-row { max-width: 94%; } .messages.wa { padding: 12px; } }
.wa-form textarea { scrollbar-width: none; }

/* Chat: Chatboard-Stil, sauber eingepasst */
.chat-shell { max-width: 1240px; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
.chat-main { padding: 0; gap: 0; border-radius: 22px; border: 1px solid var(--border); background: var(--card); box-shadow: 0 18px 40px -22px rgba(15, 30, 50, 0.35); height: clamp(580px, calc(100vh - 200px), 920px); }
.chat-head { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--card); }
.chat-channel { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-hash { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-2, #2E6DA4); color: #fff; font-size: 1.4rem; font-weight: 800; flex: 0 0 auto; }
.chat-head-text strong { font-size: 1.15rem; }
.chat-members { display: flex; }
.chat-member { width: 32px; height: 32px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--card); overflow: hidden; display: grid; place-items: center; background: var(--primary-soft, #e8f0f8); }
.chat-member:first-child { margin-left: 0; }
.chat-member .agent-photo { --s: 32px; border-radius: 50%; }
.messages.wa { flex: 1; min-height: 0; padding: 20px 26px 12px; gap: 3px; background: color-mix(in srgb, var(--primary-2, #2E6DA4) 6%, var(--card)); border: 0; border-radius: 0; }
.wa-day { display: flex; justify-content: center; margin: 0 0 12px; }
.wa-day span, .wa-system span { font-size: 0.78rem; padding: 3px 12px; border-radius: 999px; background: color-mix(in srgb, var(--primary-2, #2E6DA4) 12%, var(--card)); color: var(--muted); }
.wa-system { display: flex; justify-content: center; margin: 8px 0; }
.wa-row { margin-top: 10px; }
.wa-row.wa-same { margin-top: 2px; }
.wa-row.wa-same .wa-bubble { border-radius: 18px; }
.wa-spacer { visibility: hidden; border: 0; background: none; }
.wa-bubble { font-size: 1.08rem; }
.chat-compose { padding: 12px 22px 14px; border-top: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.wa-quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.wa-quick form { margin: 0; flex: 0 0 auto; }
.chat-compose .wa-form { padding: 0; border: 0; display: flex; gap: 12px; align-items: flex-end; }
.wa-box { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 20px; background: var(--card); padding: 8px 12px 4px; transition: border-color 0.15s, box-shadow 0.15s; }
.wa-box:focus-within { border-color: var(--primary-2, #2E6DA4); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.18); }
.wa-box .wa-team { padding: 0 0 6px; gap: 6px; }
.wa-box textarea { border: 0 !important; box-shadow: none !important; min-height: 40px; padding: 6px 4px !important; border-radius: 0 !important; background: transparent !important; font-size: 1.08rem !important; }
.wa-hint { margin: 0; text-align: right; }
.chat-help { margin: 0 0 8px; padding-left: 1.1rem; display: grid; gap: 6px; }
@media (max-width: 1080px) { .chat-shell { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .chat-members { display: none; }
  .chat-head { padding: 12px 14px; }
  .messages.wa { padding: 14px 12px 8px; }
  .chat-compose { padding: 10px 12px 12px; }
  .chat-main { border-radius: 18px; }
}

/* Direkt ansprechen: groessere Kacheln mit Name und Rolle */
.wa-box .wa-team { gap: 10px; padding: 2px 0 10px; align-items: stretch; }
.wa-team-label { flex: 1 0 100%; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wa-mention { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 16px; text-align: left; }
.wa-mention .agent-photo { --s: 44px; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.wa-mention-text { display: flex; flex-direction: column; line-height: 1.2; }
.wa-mention-text strong { font-size: 0.95rem; }
.wa-mention-text small { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.wa-mention-all { padding-left: 14px; }

/* Team und Uebersicht: schlankere Karten, Ablauf nur auf Klick */
.chief-card { padding: 12px 18px; }
.chief-side .agent-photo { width: 150px !important; height: 150px !important; }
.flow-details { grid-column: 1 / -1; margin-top: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.flow-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 0; }
.flow-details > summary::-webkit-details-marker { display: none; }
.info-i { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-2, #2E6DA4); color: #fff; font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 0.95rem; flex: 0 0 auto; }
.flow-details[open] > summary { margin-bottom: 10px; }
.run-card { align-items: center; padding: 16px 20px; }
.run-info h2 { margin: 0 0 6px; }
.run-info p { margin: 4px 0; }
.run-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.run-actions .menu { margin-left: 0; }
.run-actions .link-like { color: var(--primary-2, #2E6DA4); font-weight: 600; text-decoration: none; }

/* Chat: Eingabefeld mit eigenem Rahmen, Ansprech-Chips wie die Schnellauftraege */
.wa-direct { align-items: center; }
.wa-direct-label { flex: 0 0 auto; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 2px; }
.wa-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; white-space: nowrap; }
.wa-chip .agent-photo { --s: 22px; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.wa-chip small { color: var(--muted); font-size: 0.75rem; }
.wa-chip span:first-child:not(.agent-photo) { padding-left: 8px; }
.wa-box { border: 2px solid color-mix(in srgb, var(--primary-2, #2E6DA4) 35%, var(--border)); border-radius: 18px; padding: 8px 12px 6px; background: var(--card); box-shadow: 0 2px 8px -4px rgba(15, 30, 50, 0.25); position: relative; }
.wa-box:focus-within { border-color: var(--primary-2, #2E6DA4); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.2); }
.wa-box textarea { min-height: 56px; }
.wa-tools { display: flex; align-items: center; gap: 6px; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 2px; position: relative; flex-wrap: wrap; }
.wa-tool { width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 1.05rem; }
.wa-tool:hover { background: var(--primary-soft, #e8f0f8); color: var(--text); }
.wa-count { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.wa-keyhint { display: none; }
@media (min-width: 900px) { .wa-keyhint { display: inline; } }
.wa-emoji { position: absolute; bottom: 42px; left: 0; z-index: 8; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 14px 30px -10px rgba(15, 30, 50, 0.35); }
.wa-emoji[hidden] { display: none; }
.wa-emoji button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 1.3rem; cursor: pointer; }
.wa-emoji button:hover { background: var(--primary-soft, #e8f0f8); }

/* Beitragsseite: Vorschau zuerst, darunter Reiter */
.post-top { margin-bottom: 18px; max-width: none; }
.post-top .dev-frame[data-device="desktop"] { height: 600px; }
.post-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; margin: 0 0 16px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; position: sticky; top: 8px; z-index: 6; }
.post-tab { padding: 9px 16px; border-radius: 11px; color: var(--muted); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.post-tab:hover { background: var(--primary-soft, #e8f0f8); color: var(--text); }
.post-tab.active { background: var(--primary-2, #2E6DA4); color: #fff; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #E8950A; color: #1a1a1a; font-size: 0.75rem; display: inline-grid; place-items: center; }
.tab-dot { width: 9px; height: 9px; border-radius: 50%; background: #E8950A; display: inline-block; animation: ap-pulse 1.8s ease-out infinite; }
.post-panel[hidden] { display: none; }
.post-panels .post-panel + .post-panel { margin-top: 16px; }
.tabs-on .post-panels .post-panel + .post-panel { margin-top: 0; }
.post-panels > section.post-panel > .card + .card, .post-panels > section.post-panel > .card + section.card { margin-top: 14px; }
.post-panels .card { max-width: 980px; }
.img-strip { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.img-strip figure { margin: 0; width: 200px; }
.img-strip img { width: 100%; border-radius: 12px; display: block; }
.img-strip-meta { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.img-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.img-choice { padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--primary-2, #2E6DA4) 4%, var(--card)); }
.img-choice h3 { margin: 0 0 10px; font-size: 1rem; }
.img-choice .img-option { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
.img-choice .img-desc { font-size: 0.9rem; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.regina-sample { margin-top: 10px; }
.regina-sample summary { cursor: pointer; font-weight: 700; }
.regina-sample pre { white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }

/* Reiter als Kacheln (Beitragsseite, Autopilot) im Stil der Listen */
.tb-blue, .agent-tile.tone-tb-blue     { --tc: #2b7fe0; --tc2: #7ab6f5; --tc-shadow: rgba(43, 127, 224, 0.35); }
.tb-purple, .agent-tile.tone-tb-purple { --tc: #8b5cd6; --tc2: #bf9cf0; --tc-shadow: rgba(139, 92, 214, 0.35); }
.tb-red, .agent-tile.tone-tb-red       { --tc: #d9423a; --tc2: #f08a80; --tc-shadow: rgba(217, 66, 58, 0.35); }
.tb-teal, .agent-tile.tone-tb-teal     { --tc: #0e8f9a; --tc2: #6fd3da; --tc-shadow: rgba(14, 143, 154, 0.35); }
.tb-orange, .agent-tile.tone-tb-orange { --tc: #e8820c; --tc2: #f7b14a; --tc-shadow: rgba(232, 130, 12, 0.40); }
.tb-green, .agent-tile.tone-tb-green   { --tc: #1a9a66; --tc2: #6fdcae; --tc-shadow: rgba(26, 154, 102, 0.35); }
.tab-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 0; margin: 0 0 16px; background: none; border: 0; border-radius: 0; position: static; max-width: 1240px; }
.tab-tiles .post-tab, .tab-tiles .ap-tab { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); font-weight: 700; text-decoration: none; transition: border-color 0.15s, background 0.15s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.tab-tiles .post-tab span, .tab-tiles .ap-tab span { flex: 1; min-width: 0; }
.tab-tiles .post-tab:hover, .tab-tiles .ap-tab:hover { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 7%, var(--card)); color: var(--text); }
.tab-tiles .post-tab.active, .tab-tiles .ap-tab.active { border-color: var(--tc); border-width: 2px; padding: 9px 13px; background: color-mix(in srgb, var(--tc) 14%, var(--card)); color: var(--text); box-shadow: 0 10px 22px -12px var(--tc-shadow); }
.tab-tiles .logo-tile { flex: 0 0 auto; }

/* Alles auf der Beitragsseite gleich breit: Vorschau, Reiter, Bereiche */
.post-top, .post-tabs, .post-panels { max-width: 1240px; width: 100%; }
.post-panels .card { max-width: none; }
.empty-note { max-width: 1240px; margin-bottom: 16px; }

/* Bild: zwei kleine Auswahlkacheln, Vorschlaege nebeneinander, Eingabefeld wie im Chat */
.mode-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 12px; margin: 12px 0 16px; }
.mode-tile { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.mode-tile:hover { border-color: var(--tc); }
.mode-tile.active { border-color: var(--tc); border-width: 2px; padding: 9px 13px; background: color-mix(in srgb, var(--tc) 14%, var(--card)); }
.pane-title { margin: 4px 0 10px; font-size: 1rem; }
.img-options.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px; }
.img-options.two .img-option { margin: 0; align-items: flex-start; flex-direction: row; }
.img-options.two .img-desc { font-size: 0.92rem; margin: 6px 0 10px; -webkit-line-clamp: 6; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.img-options.two .row-actions { justify-content: flex-start; }
.own-desc { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.compose-box { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 20px; background: var(--card); padding: 8px 14px 10px; transition: border-color 0.15s, box-shadow 0.15s; }
.compose-box:focus-within { border-color: var(--primary-2, #2E6DA4); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.18); }
.compose-box textarea { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 6px 4px !important; border-radius: 0 !important; font-size: 1.05rem !important; min-height: 70px; width: 100%; resize: vertical; }
.compose-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.compose-opts, .compose-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.conn-row .conn-text input[type="file"], .conn-row .conn-text select { max-width: 100%; margin-top: 4px; }
@media (max-width: 899px) { .img-options.two { grid-template-columns: 1fr; } }

/* Vorschau: Windows-Fensterleiste, Instagram komplett sichtbar */
.dev-frame[data-device="desktop"] { border-radius: 8px; }
.dev-bar { height: 36px; padding: 0 0 0 12px; background: #f3f3f3; border-bottom: 1px solid #d9d9d9; gap: 0; }
.dev-bar .dev-addr { margin: 0; flex: 1; background: #fff; border: 1px solid #d9d9d9; border-radius: 6px; padding: 3px 12px; font-size: 12px; color: #444; line-height: 1.4; }
.win-ctl { display: flex; height: 100%; margin-left: 12px; }
.win-ctl .wc { width: 46px; height: 100%; position: relative; display: block; border-radius: 0; background: none; }
.win-ctl .wc::before, .win-ctl .wc::after { content: ""; position: absolute; left: 50%; top: 50%; }
.win-ctl .wc-min::before { width: 10px; height: 1px; background: #222; transform: translate(-50%, 0); }
.win-ctl .wc-max::before { width: 9px; height: 9px; border: 1px solid #222; transform: translate(-50%, -50%); }
.win-ctl .wc-x::before, .win-ctl .wc-x::after { width: 13px; height: 1px; background: #222; }
.win-ctl .wc-x::before { transform: translate(-50%, 0) rotate(45deg); }
.win-ctl .wc-x::after { transform: translate(-50%, 0) rotate(-45deg); }
.post-top .dev-frame[data-device="desktop"], .dev-frame[data-device="desktop"] { height: 620px; }
.dev-frame[data-device="desktop"] .ig-post { max-width: 300px; }
.pv-col-ig .dev-screen { overflow-y: auto; scrollbar-width: none; }
.pv-col-ig .dev-screen::-webkit-scrollbar { display: none; }
.pv-col-ig .dev-frame[data-device="desktop"] .dev-screen { padding: 12px 18px; }
.pv-empty { color: #8a8f98; font-style: italic; }
.dev-bar .win-ctl { flex: 0 0 auto; background: none; border-radius: 0; padding: 0; margin-left: 12px; }
.pv-head { min-height: 74px; align-content: flex-start; align-items: flex-start; }
@media (max-width: 900px) { .pv-head { min-height: 0; } }
.tab-tiles .post-tab > span.logo-tile, .tab-tiles .ap-tab > span.logo-tile { flex: 0 0 auto; }
.compose-box textarea { font-family: inherit !important; }

/* iPhone und Handy: ruhige App-Ansicht (kompakte Kopfleiste, Reiter zum Wischen, Karten mit Luft, Knöpfe in voller Breite) */
@media (max-width: 899px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: none; }
  .content { padding: 0 14px calc(96px + env(safe-area-inset-bottom)); }
  .mobile-bar { position: sticky; top: 0; z-index: 9; margin: 0 -14px 12px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: color-mix(in srgb, var(--bg, #f4f7fb) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .mobile-bar .logo-tile { --s: 34px !important; }
  .mobile-bar .brand-name { font-size: 1.02rem; }
  .topbar { margin: 0 0 12px; gap: 4px; }
  .topbar h1 { font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.02em; }
  .topbar p.muted { font-size: 0.92rem; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .topbar-actions { display: none; }
  .notice { font-size: 0.92rem; padding: 10px 12px; border-radius: 14px; }
  .card { padding: 16px; border-radius: 18px; }
  h2 { font-size: 1.12rem; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions > form, .actions > .btn, .actions > a.btn { width: 100%; }
  .actions .btn, .actions form .btn { width: 100%; justify-content: center; }
  .btn { min-height: 44px; }
  .btn.small-btn { min-height: 40px; }
  input, select, textarea { font-size: 16px; }

  /* Reiter: eine Zeile zum Wischen */
  .tab-tiles { display: flex; overflow-x: auto; gap: 8px; margin: 0 -14px 14px; padding: 2px 14px 8px; scroll-snap-type: x proximity; scrollbar-width: none; max-width: none; width: auto; }
  .tab-tiles::-webkit-scrollbar { display: none; }
  .tab-tiles .post-tab, .tab-tiles .ap-tab { flex: 0 0 auto; scroll-snap-align: center; padding: 7px 14px 7px 8px; gap: 8px; border-radius: 14px; white-space: nowrap; }
  .tab-tiles .post-tab.active, .tab-tiles .ap-tab.active { padding: 6px 13px 6px 7px; }
  .tab-tiles .logo-tile { --s: 30px !important; }
  .tab-tiles .post-tab span, .tab-tiles .ap-tab span { flex: 0 1 auto; }
  .post-top, .post-panels { max-width: none; }
  .mode-tiles { grid-template-columns: 1fr; }

  /* Vorschau: ein Rahmen pro Zeile, Handy-Rahmen zentriert */
  .pv-grid { grid-template-columns: 1fr; gap: 22px; }
  .li-toolbar { margin-bottom: 8px; }
  .dev-frame[data-device="mobile"] { max-width: 300px; height: 560px; }
  .post-top .dev-frame[data-device="desktop"], .dev-frame[data-device="desktop"] { height: 520px; }
  .pv-head .pv-ctl { width: 100%; }
  .pv-note { font-size: 0.85rem; }

  /* Listen: Titel zuerst, Status darunter */
  .conn-row { padding: 12px; gap: 12px; flex-wrap: wrap; }
  .conn-row .conn-text { flex: 1 1 0; min-width: 0; }
  .conn-row .status { order: 5; }
  .conn-row .row-actions { width: 100%; justify-content: flex-start; }
  .conn-row .conn-chev { display: none; }
  .conn-title, .conn-text strong { overflow-wrap: anywhere; }
  .img-options.two .img-option { flex-direction: row; }
  .compose-foot, .compose-opts, .compose-btns { width: 100%; }
  .compose-btns .btn { flex: 1; }

  /* Chat: füllt den Bildschirm, ohne Seitenkopf */
  body:has(.chat-shell) .topbar { display: none; }
  .chat-main { height: calc(100dvh - 150px - env(safe-area-inset-bottom)); min-height: 420px; border-radius: 18px; }
  .chat-compose { padding-bottom: 10px; }

  /* Untere Leiste: fünf gleiche Felder, markierter Eintrag */
  .bottomnav { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -8px 24px -18px rgba(13, 35, 64, 0.5); }
  .bottomnav a { font-size: 0.7rem; gap: 2px; min-height: 48px; border-radius: 14px; }
  .bottomnav a.active:not(.fab) { background: color-mix(in srgb, var(--link) 12%, transparent); }
  .bottomnav .fab { width: 54px; height: 54px; margin-top: -24px; box-shadow: 0 10px 22px -8px rgba(232, 149, 10, 0.7); border: 3px solid var(--card); }
}
@media (max-width: 380px) {
  .topbar h1 { font-size: 1.3rem; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .tab-tiles { flex-wrap: nowrap; }
  .pv-nets { margin: 0 0 12px; }
  .pv-grid[data-net="li"] .pv-col-ig, .pv-grid[data-net="ig"] .pv-col-li { display: none; }
  .li-toolbar .li-switch { margin-right: auto; }
}
@media (max-width: 899px) {
  .chat-compose .wa-form { position: static; flex-direction: row; align-items: flex-end; background: none; padding: 0; border: 0; gap: 8px; }
  .chat-compose .wa-box { flex: 1 1 auto; min-width: 0; }
  .chat-compose .wa-send { width: 46px; height: 46px; flex: 0 0 46px; }
  .chat-compose { gap: 8px; }
  .wa-quick { margin: 0 -2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .wa-quick::-webkit-scrollbar { display: none; }
  .wa-direct-label { display: none; }
}
@media (max-width: 899px) {
  .li-toolbar .li-switch:not(.pv-nets) { display: none; }
  .li-toolbar { justify-content: flex-end; }
  .dev-frame[data-device="mobile"] .li-actions span { font-size: 0; flex: 1; justify-content: center; gap: 0; }
}

/* Seitenleiste scrollbar (iPhone quer, niedrige Fenster) */
.sidebar { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-left: max(16px, env(safe-area-inset-left)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sidebar nav, .sidebar .brand { flex: 0 0 auto; }
.sidebar-foot { padding-top: 8px; }
@media (max-height: 560px) {
  .sidebar { padding-top: 12px; gap: 12px; }
  .sidebar nav { gap: 2px; }
  .sidebar nav a { padding: 7px 12px; }
  .nav-sep { margin: 4px 0; }
}

/* Alle Seiten gleich breit, Listen und Felder nebeneinander statt endlos untereinander */
.settings-card, .schedule-form, .idea-form, .ap-form, .conn-detail, .card.narrow, .li-wrap { max-width: none; }
@media (min-width: 1000px) {
  .conn-list.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  fieldset.radio-cards.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card h3 { margin: 14px 0 6px; }
.card .check-list { columns: 2; column-gap: 28px; }
.card .check-list li { break-inside: avoid; }
@media (max-width: 899px) { .card .check-list { columns: 1; } }

/* Vorschau: beide Rahmen gleich (Scrollleiste ausgeblendet, scrollen per Rad oder Finger) */
.dev-screen { scrollbar-width: none; }
.dev-screen::-webkit-scrollbar { display: none; }

.conn-group { margin: 18px 0 8px; font-size: 0.95rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.conn-group:first-of-type { margin-top: 10px; }
.conn-group .muted { font-weight: 400; }
.form > .btn, .form > button.btn { align-self: flex-start; }

/* Erklärungen als Ausklappfeld mit "i" */
.info-i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font: italic 700 0.8rem/1 Georgia, serif; flex: 0 0 auto; }
.info-box { margin-top: 14px; padding-top: 8px; border-top: 1px dashed var(--border); }
.info-box > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; font-weight: 600; list-style: none; }
.info-box > summary::-webkit-details-marker { display: none; }
.info-box > summary:hover { color: var(--link); }
.info-box[open] > summary { color: var(--link); }
.info-body p { margin: 8px 0 0; }
.info-btn { margin-left: 10px; vertical-align: middle; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; font-size: 1rem; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--link); }
details.fold > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; color: var(--text); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .fold-title { font-weight: 700; font-size: 1.05rem; }
details.fold > summary .info-i { color: var(--muted); }
details.fold[open] > summary { margin-bottom: 14px; }
.fold-part + .fold-part { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.fold-part h2 { font-size: 1.05rem; }
body[data-mode="live"] .demo-note { display: none; }

/* Instagram-Vorschau: "Original" zeigt das ganze Bild in voller Breite (höchstens 4:5 hoch) */
.ig-post { container-type: inline-size; }
.ig-image.orig:not(.ig-empty) { aspect-ratio: auto; max-height: 125cqw; background: #fff; }
.ig-image.orig:not(.ig-empty) img { width: 100%; height: auto; max-height: 125cqw; object-fit: contain; }

/* Vorschau kompakter: eine Leiste für Gerät und Bildformat, Rahmen weiter oben */
.li-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 6px; }
.li-toolbar .li-switch { display: inline-flex; align-items: center; gap: 6px; }
.pv-fmt-label { margin-right: 2px; }
.pv-head { min-height: 0 !important; margin-bottom: 4px; }
.pv-grid { gap: 14px; }
.post-top { margin-bottom: 12px; gap: 8px; }
.post-top .dev-frame[data-device="desktop"], .dev-frame[data-device="desktop"] { height: 560px; }
.pv-note { margin: 6px 0 0; font-size: 0.82rem; }
.li-image[style*="aspect-ratio"] { width: 100%; display: block; }
@media (max-width: 899px) { .li-toolbar .li-switch:not(.pv-nets):not(.pv-fmt) { display: none; } .pv-fmt { flex-wrap: wrap; } }
.li-image { aspect-ratio: auto; height: auto; }
@media (max-width: 899px) { .li-toolbar .li-switch.pv-fmt { display: inline-flex; } }
@media (min-width: 900px) { .topbar { margin-bottom: 14px; } }

/* Kurzer Hinweis als kleine Pille beim Darüberfahren (Maus) oder Antippen (Handy): data-tip="Text" */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px); width: max-content; max-width: 240px; padding: 8px 12px; border-radius: 14px; background: #1b2430; color: #fff; font: 500 0.78rem/1.35 var(--font-body, system-ui, sans-serif); text-align: left; white-space: normal; box-shadow: 0 10px 24px -10px rgba(13, 35, 64, 0.55); opacity: 0; pointer-events: none; z-index: 30; transition: opacity 0.15s, transform 0.15s; }
[data-tip]:hover::after, [data-tip]:focus-visible::after, [data-tip]:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.pv-fmt [data-tip]:last-of-type::after { left: auto; right: 0; transform: translateY(-4px); }
.pv-fmt [data-tip]:last-of-type:hover::after, .pv-fmt [data-tip]:last-of-type:focus::after { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { [data-tip]::after { transition: none; } }

.orient-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.orient-row form { margin: 0; }
.orient-label { font-weight: 700; font-size: 0.9rem; margin-right: 4px; }

/* Vorschläge: Autopilot als Hauptkarte, sechs Kennzahlen, Veröffentlicht grün, Verworfen rot */
.sug-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .sug-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sug-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sug-head-veroeffentlicht { --sec: #15803d; }
.sug-head-verworfen { --sec: #d9423a; }
.sug-stat.sug-head-veroeffentlicht, .sug-stat.sug-head-verworfen { background: linear-gradient(135deg, var(--sec), color-mix(in srgb, var(--sec) 70%, #fff)); border-color: var(--sec); color: #fff; box-shadow: 0 12px 24px -14px var(--sec); }
.sug-stat.sug-head-veroeffentlicht strong, .sug-stat.sug-head-verworfen strong, .sug-stat.sug-head-veroeffentlicht span, .sug-stat.sug-head-verworfen span { color: #fff; }
.sug-stat { transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@media (hover: hover) { .sug-stat:hover { transform: translateY(-2px); } }
.sug-details > summary.sug-head { cursor: pointer; list-style: none; flex-direction: row; align-items: center; }
.sug-details > summary.sug-head h2 { color: color-mix(in srgb, var(--sec) 75%, var(--text)); }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--sec, #2E6DA4); color: #fff; font-size: 0.8rem; margin-left: 6px; }
.status-veroeffentlicht { background: #15803d; color: #fff; }
:root[data-theme="dark"] .status-veroeffentlicht { background: #15803d; color: #fff; }
.conn-row.conn-veroeffentlicht { border-color: #15803d; background: rgba(21, 128, 61, 0.10); }
.agent-tile.tone-st-veroeffentlicht { --tc: #15803d; --tc2: #6fd39a; --tc-shadow: rgba(21, 128, 61, 0.4); }
.status-verworfen { background: #d9423a; color: #fff; }

.sug-auto.card { padding: 0; overflow: hidden; border-width: 1.5px; border-color: color-mix(in srgb, #2E6DA4 40%, var(--border)); background: linear-gradient(120deg, color-mix(in srgb, #2E6DA4 8%, var(--card)), color-mix(in srgb, #E8950A 10%, var(--card))); box-shadow: 0 18px 38px -24px rgba(46, 109, 164, 0.6); }
.sug-auto.card.ap-on { border-color: color-mix(in srgb, #2fb27d 55%, var(--border)); }
.ap-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: center; padding: 22px 26px; }
.ap-title { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; }
.ap-line { margin: 0 0 14px; font-size: 1rem; max-width: 60ch; }
.ap-actions { margin-top: 0; }
.ap-actions form { margin: 0; }
.ap-art { width: 100%; height: auto; display: block; color: #2E6DA4; }
.ap-ring { fill: none; stroke: currentColor; stroke-opacity: 0.22; stroke-width: 2; }
.ap-ring.r1 { fill: currentColor; fill-opacity: 0.08; }
.ap-route { fill: none; stroke: #E8950A; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 3 9; }
.ap-start { fill: #E8950A; }
.ap-plane path { fill: #2E6DA4; }
.ap-spark { fill: #E8950A; }
.ap-spark.s2 { fill: #2E6DA4; opacity: 0.7; }
.ap-on .ap-art { color: #1a9a66; }
.ap-on .ap-plane path { fill: #1a9a66; }
.ap-on .ap-route { stroke: #1a9a66; animation: ap-route 1.6s linear infinite; }
.ap-on .ap-ring.r3 { animation: ap-ringpulse 3.2s ease-in-out infinite; transform-origin: 120px 84px; }
.ap-on .ap-spark { animation: ap-twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ap-route { to { stroke-dashoffset: -24; } }
@keyframes ap-ringpulse { 50% { transform: scale(1.06); stroke-opacity: 0.4; } }
@keyframes ap-twinkle { 50% { transform: scale(1.35); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .ap-on .ap-route, .ap-on .ap-ring.r3, .ap-on .ap-spark { animation: none; } }
@media (max-width: 760px) { .ap-hero { grid-template-columns: 1fr; padding: 16px; } .ap-art { max-width: 220px; margin: 0 auto; order: -1; } .ap-title { font-size: 1.35rem; } }
.sug-auto.card.ap-on { background: linear-gradient(110deg, color-mix(in srgb, #2fb27d 10%, var(--card)) 0%, color-mix(in srgb, #2fb27d 24%, var(--card)) 55%, color-mix(in srgb, #2fb27d 10%, var(--card)) 100%); background-size: 240% 100%; animation: ap-flow 7s ease-in-out infinite; }

.pv-more { display: flex; justify-content: flex-end; margin: 2px 0 0; }
.pv-more form { margin: 0; }
.li-toolbar { margin: 10px 0 0; }

/* Autopilot-Blase: rot wenn aus, grün und pulsierend wenn an */
.ap-pill-form { margin: 0; display: inline-flex; }
.ap-pill { border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 1em; letter-spacing: -0.01em; color: #fff; padding: 6px 20px; border-radius: 999px; transition: transform 0.15s, filter 0.15s; }
.ap-pill:hover { filter: brightness(1.07); transform: translateY(-1px); }
.ap-pill.off { background: linear-gradient(135deg, #c0352f, #e5645c); box-shadow: 0 8px 18px -10px rgba(217, 66, 58, 0.8); }
.ap-pill.on { background: linear-gradient(135deg, #15803d, #2fb27d); animation: pill-pulse 1.8s ease-out infinite; }
@keyframes pill-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(47, 178, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0); } }
.ap-title .ap-pill { font-size: 1.1rem; }

/* Übersicht: Autopilot als fünfte Kachel, rot (deaktiviert) oder grün (aktiv, pulsiert wenn er wirklich läuft) */
.kpi-form { margin: 0; display: contents; }
.kpis { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 899px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi-form:last-child { display: block; grid-column: 1 / -1; } .kpi-form:last-child .kpi { width: 100%; } }
button.kpi { border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.kpi-text { font-size: 1.55rem !important; line-height: 1.1; }
.kpi-auto.off { background: linear-gradient(135deg, #b32e28, #e5645c); }
.kpi-auto.on { background: linear-gradient(135deg, #1f8f63, var(--success)); }
.kpi-auto.run { animation: kpi-run 1.9s ease-out infinite; }
@keyframes kpi-run { 0% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0.65); } 70% { box-shadow: 0 0 0 14px rgba(47, 178, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 178, 125, 0); } }
@media (prefers-reduced-motion: reduce) { .kpi-auto.run, .ap-pill.on { animation: none; } }

/* Einstellungsübersicht unter jedem Autopilot-Reiter */
.sum-card { margin-top: 16px; }
.conn-row.is-active { border-color: var(--primary-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-2) 25%, transparent); }
.conn-row.is-dirty { border-color: #E8950A; }

.li-toolbar { margin: 4px 0 10px; }

/* Chat: volle Breite, orange Einrandung, deutlicher Hintergrund, alle Mitarbeiter ohne Scrollen */
.chat-shell { display: block; max-width: none; }
.chat-main { border: 2px solid #E8950A; box-shadow: 0 0 0 4px rgba(232, 149, 10, 0.14), 0 18px 40px -22px rgba(15, 30, 50, 0.4); height: clamp(560px, calc(100vh - 230px), 880px); }
.chat-head { background: color-mix(in srgb, #E8950A 10%, var(--card)); border-bottom-color: color-mix(in srgb, #E8950A 40%, var(--border)); }
:root[data-theme="light"] .messages.wa { background: #d6e5f6; }
:root[data-theme="light"] .chat-compose { background: #eef4fb; border-top-color: color-mix(in srgb, #E8950A 40%, var(--border)); }
:root[data-theme="light"] .wa-bubble { border-color: #b9cde4; }
.wa-quick { flex-wrap: wrap; overflow: visible; }
.wa-quick .chip-btn { border: 1.5px solid color-mix(in srgb, #E8950A 65%, var(--border)); background: color-mix(in srgb, #E8950A 7%, var(--card)); font-weight: 600; }
.wa-quick .chip-btn:hover { background: color-mix(in srgb, #E8950A 18%, var(--card)); }
.wa-direct { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.wa-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border: 1.5px solid color-mix(in srgb, #E8950A 65%, var(--border)); border-radius: 14px; background: color-mix(in srgb, #E8950A 7%, var(--card)); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; transition: background 0.15s, transform 0.15s; }
.wa-chip:hover { background: color-mix(in srgb, #E8950A 18%, var(--card)); transform: translateY(-1px); }
.wa-chip .agent-photo { --s: 30px; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.chip-at { color: #E8950A; font-size: 1.1rem; font-weight: 800; line-height: 1; }
.chip-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.chip-name strong { font-size: 0.92rem; }
.chip-name small { font-size: 0.74rem; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-info { margin-top: 16px; }
.chat-info > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 600; list-style: none; }
.chat-info > summary::-webkit-details-marker { display: none; }
.chat-info[open] > summary { color: var(--link); margin-bottom: 12px; }
.chat-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.chat-info-grid .card { margin: 0; box-shadow: none; }
@media (max-width: 1000px) { .chat-info-grid { grid-template-columns: 1fr; } }
@media (max-width: 899px) { .wa-direct { display: flex; overflow-x: auto; scrollbar-width: none; } .wa-chip { flex: 0 0 auto; } .wa-quick { flex-wrap: nowrap; overflow-x: auto; } }

/* Regina im Team: orange Einrandung */
.chief-card { border: 2px solid #E8950A; box-shadow: 0 0 0 4px rgba(232, 149, 10, 0.14), 0 14px 30px -18px rgba(232, 149, 10, 0.5); }

.ap-hero { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 760px) { .ap-hero { grid-template-columns: 1fr; } }

/* Laufanimation der Kacheln: Autopilot aktiv, oder ein Agent arbeitet gerade */
.kpi-green.run, .kpi-auto.on.run { background: linear-gradient(110deg, #1f8f63 0%, #43d49b 50%, #1f8f63 100%); background-size: 240% 100%; animation: ap-flow 5s ease-in-out infinite, kpi-run 1.9s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .kpi-green.run, .kpi-auto.on.run { animation: none; } }

.pulse-green { animation: pill-pulse 1.8s ease-out infinite; }
.run-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.run-tile { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); }
.run-tile small { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.run-tile strong { font-size: 0.98rem; }
.run-tile-next { border-color: #E8950A; background: color-mix(in srgb, #E8950A 10%, var(--card)); }
.run-info-box { border-top: 0; margin-top: 6px; padding-top: 0; }
@media (prefers-reduced-motion: reduce) { .pulse-green { animation: none; } }

.run-card .run-info { flex: 1 1 320px; min-width: 0; }
.run-card .run-actions { flex: 0 0 auto; }

.ap-hero { grid-template-columns: 240px auto minmax(0, 1fr); gap: 28px; }
.ap-hero-title { display: flex; justify-content: center; }
.ap-hero-title .ap-pill { font-size: 1.5rem; padding: 10px 30px; }
.ap-hero-text { text-align: right; }
.ap-hero-text .ap-line { margin-left: auto; }
.ap-hero-text .ap-actions { justify-content: flex-end; }
@media (max-width: 1100px) { .ap-hero { grid-template-columns: 200px 1fr; } .ap-hero-text { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ap-hero { grid-template-columns: 1fr; } .ap-hero-text { text-align: left; } .ap-hero-text .ap-actions { justify-content: flex-start; } .ap-hero-title { order: 0; } }

/* iPhone: Recherche-Karte und Autopilot-Karte brechen sauber um */
@media (max-width: 899px) {
  .run-card .run-info { flex: 1 1 100%; }
  .run-card .run-actions { flex: 1 1 100%; justify-content: flex-start; }
  .run-tiles { gap: 8px; }
}

/* iPhone: nichts darf seitlich überstehen (Auswahlfelder, Tabellen, Tagesreihen) */
@media (max-width: 899px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .content, .card, .conn-row, .conn-text { min-width: 0; }
  select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { max-width: 100%; }
  .form select, .form input:not([type="checkbox"]):not([type="radio"]), .conn-row select { width: 100%; }
  .conn-row .row-select { max-width: 100%; width: 100%; }
  .plain-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .day-row, .day-chips { flex-wrap: wrap; }
  .day-row .check { margin: 0 8px 8px 0; }
  .form-grid, .format-grid, .field-grid { grid-template-columns: 1fr !important; }
  img, video, svg { max-width: 100%; }
  .conn-row .row-actions form { flex: 1 1 auto; }
  fieldset { min-width: 0; }
}

/* iPhone: Autopilot-Karte kompakt (Grafik klein neben der Blase, Knöpfe zu zweit) */
@media (max-width: 899px) {
  .ap-hero { grid-template-columns: 104px 1fr !important; gap: 10px 14px; padding: 14px; align-items: center; }
  .ap-hero .ap-art { max-width: 104px; margin: 0; order: 0; }
  .ap-hero-title { order: 0; justify-content: flex-start; }
  .ap-hero-title .ap-pill { font-size: 1.2rem; padding: 8px 22px; }
  .ap-hero-text { grid-column: 1 / -1 !important; text-align: left !important; }
  .ap-hero-text .ap-line { font-size: 0.95rem; margin-bottom: 10px; }
  .ap-hero-text .ap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ap-hero-text .ap-actions > form, .ap-hero-text .ap-actions > a { width: 100%; }
  .ap-hero-text .ap-actions .btn { width: 100%; padding-left: 8px; padding-right: 8px; }
  .ap-hero-text .ap-actions > form:first-child { grid-column: 1 / -1; }
}

.run-tile-off { opacity: 0.85; }
.run-tile strong em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.day-chip { position: relative; }
.day-chip input { left: 0; top: 0; width: 100%; height: 100%; }

.ap-hero-text .ap-actions { margin-top: 0; }
@media (max-width: 899px) { .ap-hero-text .ap-actions > form:first-child { grid-column: auto; } }

/* Vorschläge: Autopilot links als Info-Karte (vier Spalten), rechts groß als Schalter (zwei Spalten, so breit wie Veröffentlicht und Verworfen) */
.sug-auto-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sug-auto-row .sug-auto { grid-column: span 4; margin: 0; }
.ap-info { display: flex; align-items: center; gap: 22px; padding: 18px 24px; }
.ap-info .ap-art { width: 210px; flex: 0 0 auto; }
.ap-note { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, #E8950A 12%, var(--card)); border: 1px solid color-mix(in srgb, #E8950A 45%, var(--border)); max-width: 420px; }
.ap-note small { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.ap-note strong { font-size: 1.15rem; }
.ap-note span { font-size: 0.9rem; color: var(--muted); }
.ap-big { grid-column: span 2; position: relative; min-height: 190px; }
.ap-big-form { margin: 0; height: 100%; }
.ap-big-btn { width: 100%; height: 100%; min-height: 190px; border: 0; border-radius: 18px; color: #fff; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: filter 0.15s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.ap-big-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.ap-big-btn span { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.ap-big-btn small { font-size: 0.85rem; opacity: 0.92; }
.ap-big-btn.off { background: linear-gradient(135deg, #b32e28, #e5645c); box-shadow: 0 14px 28px -16px rgba(217, 66, 58, 0.9); }
.ap-big-btn.on { background: linear-gradient(110deg, #1f8f63 0%, #43d49b 50%, #1f8f63 100%); background-size: 240% 100%; animation: ap-flow 5s ease-in-out infinite, kpi-run 1.9s ease-out infinite; }
.ap-big-set { position: absolute; right: 14px; bottom: 12px; padding: 6px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.5); }
.ap-big-set:hover { background: rgba(255, 255, 255, 0.36); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .ap-big-btn.on { animation: none; } }
@media (max-width: 1100px) { .sug-auto-row .sug-auto { grid-column: span 6; } .ap-big { grid-column: span 6; min-height: 150px; } .ap-big-btn { min-height: 150px; } }
@media (max-width: 760px) { .ap-info { flex-direction: column; align-items: stretch; padding: 14px; gap: 12px; } .ap-info .ap-art { width: 150px; margin: 0 auto; } .ap-note { max-width: none; } .ap-big-btn span { font-size: 2rem; } }

.run-tile .run-note { font-style: normal; font-size: 0.78rem; color: var(--muted); }
.run-tile-next.run-tile-off { border-color: var(--border); background: var(--card); opacity: 0.9; }

/* Zugangsdaten und Adressen direkt auf der Verbindungsseite */
.cred-row { padding: 12px 0; border-top: 1px solid var(--border); }
.cred-row:first-of-type { border-top: 0; padding-top: 4px; }
.cred-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cred-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.cred-form input { flex: 1 1 280px; min-width: 0; }
.cred-row .muted { margin: 6px 0 0; }

/* Vorschläge: eine durchgehende Autopilot-Karte. Links Grafik und zwei Kacheln, rechts der große Schalter, darunter die weiße Pille Einstellungen */
.sug-auto.card { padding: 0; }
.ap-card { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(250px, 31%); gap: 22px; align-items: center; padding: 18px 22px; }
.ap-card .ap-art { width: 100%; }
.ap-tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.ap-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); min-width: 190px; }
.ap-tile small { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.ap-tile strong { font-size: 1.1rem; }
.ap-tile em { font-style: normal; font-size: 0.8rem; color: var(--muted); }
.ap-tile-next { border-color: #E8950A; background: color-mix(in srgb, #E8950A 12%, var(--card)); }
.ap-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.ap-side .ap-big-form { width: 100%; }
.ap-side .ap-big-btn { min-height: 150px; height: auto; }
.ap-set-pill { padding: 6px 18px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--border); font-weight: 700; font-size: 0.9rem; text-decoration: none; box-shadow: 0 6px 14px -10px rgba(13, 35, 64, 0.5); }
.ap-set-pill:hover { border-color: var(--primary-2); text-decoration: none; }
@media (max-width: 1100px) { .ap-card { grid-template-columns: 170px 1fr; } .ap-side { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ap-card { grid-template-columns: 1fr; padding: 14px; gap: 12px; } .ap-card .ap-art { width: 150px; margin: 0 auto; } .ap-tile { min-width: 0; flex: 1 1 100%; } .ap-side { align-items: stretch; } .ap-set-pill { align-self: flex-end; } }
.cred-form input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.cred-form input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.22); }

.chat-member-me { background: #fff; padding: 4px; }
.chat-member-me img { width: 100%; height: auto; display: block; }

/* Autorecherche-Karte: Titel und Lauf steuern oben, darunter zwei Kacheln auf einer Zeile (links Einstellung, rechts nächste Recherche) */
.run-card { display: block; }
.run-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.run-card .run-info { flex: 1 1 auto; }
.run-card .run-actions { flex: 0 0 auto; }
.run-tiles-split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.run-tiles-split .run-tile-next { margin-left: auto; text-align: right; align-items: flex-end; }
@media (max-width: 899px) { .run-tiles-split .run-tile { flex: 1 1 100%; text-align: left; align-items: flex-start; } .run-tiles-split .run-tile-next { margin-left: 0; } .run-card .run-actions { flex: 1 1 100%; justify-content: flex-start; } }

/* Quellen: Termine der Partnerseite */
.partner-events { margin: -4px 0 14px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, #E8950A 8%, var(--card)); border: 1px solid color-mix(in srgb, #E8950A 40%, var(--border)); }
.pe-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.pe-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pe-tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 34px 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid #E8950A; }
.pe-date { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #b46f00; }
.pe-tile form { position: absolute; top: 4px; right: 4px; margin: 0; }
.pe-add { margin-top: 10px; }
.pe-add summary { cursor: pointer; font-weight: 700; color: var(--link); }
.pe-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 8px; align-items: center; }
.pe-form input { min-width: 0; }

/* Quelle hinzufügen: farbige Schritte, nichts läuft mehr über */
.src-add-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.src-add-head h2 { margin: 0; }
.src-add-head p { margin: 2px 0 0; }
.src-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.src-step { min-width: 0; margin: 0; padding: 14px 16px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--tc) 45%, var(--border)); border-top: 4px solid var(--tc); background: color-mix(in srgb, var(--tc) 6%, var(--card)); display: flex; flex-direction: column; gap: 6px; }
.src-step legend { display: flex; align-items: center; gap: 8px; font-weight: 800; padding: 0 6px; }
.src-step .step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tc); color: #fff; font-size: 0.8rem; }
.src-step input, .src-step select { width: 100%; max-width: 100%; min-width: 0; }
.src-step .check { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.src-step .check input { width: auto; margin-top: 4px; }
.src-hint { margin-top: 14px; }
@media (max-width: 1000px) { .src-steps { grid-template-columns: 1fr; } }
.src-step .check input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; }
.conn-row[id^="s"] { flex-wrap: wrap; }
.conn-row[id^="s"] .conn-text { flex: 1 1 320px; }
.conn-row[id^="s"] .row-actions { flex: 0 1 auto; justify-content: flex-start; }

/* Einstellungen: aufgeräumt in Gruppen, Betriebsart eingeklappt */
.settings-fold > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.settings-fold > summary::-webkit-details-marker { display: none; }
.settings-fold > summary .fold-title { font-weight: 800; font-size: 1.15rem; }
.settings-fold > summary::after { content: "Anzeigen"; margin-left: auto; font-size: 0.82rem; font-weight: 700; color: var(--link); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); }
.settings-fold[open] > summary::after { content: "Zuklappen"; }
.settings-fold[open] > summary { margin-bottom: 14px; }
.settings-fold h3 { margin: 16px 0 6px; font-size: 1rem; }

/* Bibliothek: farbige Kacheln wie bei Vorschlägen und Quellen, Hinzufügen als deutlicher Knopf */
.lib-tone-alle { --lt: #E8950A; }
.lib-tone-img { --lt: #8b5cd6; }
.lib-tone-doc { --lt: #2b7fe0; }
.lib-tone-link { --lt: #0e8f9a; }
.lib-tone-post { --lt: #1a9a66; }
.lib-tile { background: color-mix(in srgb, var(--lt, #2E6DA4) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--lt, #2E6DA4) 40%, var(--border)); }
.lib-tile.active { background: color-mix(in srgb, var(--lt, #2E6DA4) 18%, var(--card)); border: 2px solid var(--lt, #2E6DA4); box-shadow: 0 12px 24px -16px var(--lt, #2E6DA4); }
.lib-tile:hover { border-color: var(--lt, #2E6DA4); }
.lib-card { border-top: 4px solid var(--lt, var(--border)); }
.lib-add-panel { padding: 0; border: 2px solid #E8950A; background: color-mix(in srgb, #E8950A 6%, var(--card)); }
.lib-add-summary { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; }
.lib-add-summary::-webkit-details-marker { display: none; }
.lib-add-plus { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, #f2a124, #E8950A); color: #fff; font-size: 1.8rem; font-weight: 800; line-height: 1; box-shadow: 0 10px 20px -10px rgba(232, 149, 10, 0.9); }
.lib-add-text { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.lib-add-text strong { font-size: 1.1rem; }
.lib-add-text span { color: var(--muted); font-size: 0.9rem; }
.lib-add-go { padding: 8px 18px; border-radius: 999px; background: linear-gradient(135deg, #f2a124, #E8950A); color: #1a1a1a; font-weight: 800; box-shadow: 0 8px 16px -10px rgba(232, 149, 10, 0.9); }
.lib-add-panel[open] .lib-add-go { background: var(--card); border: 1px solid var(--border); box-shadow: none; }
.lib-add-panel[open] .lib-add-go::before { content: "Zuklappen"; }
.lib-add-panel[open] .lib-add-go { font-size: 0; }
.lib-add-panel[open] .lib-add-go::before { font-size: 0.95rem; }
.lib-add-panel .lib-add, .lib-add-panel > p { margin-left: 18px; margin-right: 18px; }
.lib-add-panel > p:last-child { margin-bottom: 14px; }
.lib-add-up { border-top: 4px solid #8b5cd6; background: color-mix(in srgb, #8b5cd6 6%, var(--card)); }
.lib-add-link { border-top: 4px solid #0e8f9a; background: color-mix(in srgb, #0e8f9a 6%, var(--card)); }
.lib-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-actions form { margin: 0; }
.lib-toolbar input[type="search"] { border: 1.5px solid color-mix(in srgb, #E8950A 40%, var(--border)); }

/* Partnertermine: immer vier Plätze, rücken nach */
.pe-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pe-empty { border-style: dashed; background: transparent; opacity: 0.75; }
@media (max-width: 1100px) { .pe-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pe-list { grid-template-columns: 1fr; } }
.pe-head .pe-read { margin: 0 0 0 auto; }
@media (max-width: 560px) { .pe-empty ~ .pe-empty { display: none; } }

/* Vorschauen näher an den echten Apps (nach Screenshots von LinkedIn und Instagram) */
.li-menu { margin-left: auto; align-self: flex-start; color: #5f6368; display: inline-flex; padding: 2px 0 0 8px; }
.li-menu .icon { fill: currentColor; stroke: none; }
.ig-menu { align-self: center; color: #262626; }
.ig-menu .icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.li-post .li-who strong { font-size: 15px; font-weight: 700; }
.li-post .li-body { line-height: 1.45; font-size: 14.5px; }
.li-post .li-text.collapsed { -webkit-line-clamp: 3; }
.li-actions .icon { stroke-width: 1.8; }
.ig-post .li-head { padding-top: 10px; padding-bottom: 10px; }
.ig-post .li-who strong { font-size: 14.5px; }
.ig-post .li-who span { font-size: 12.5px; color: #737373; }
.ig-avatar { border-radius: 50%; width: 38px; height: 38px; border: 1px solid #efefef; }
.ig-actions { align-items: center; gap: 16px; padding: 10px 14px 4px; }
.ig-actions .icon { width: 26px; height: 26px; stroke-width: 1.8; }
.ig-actions .ig-save { margin-left: auto; display: inline-flex; }
.ig-caption { font-size: 14.5px; line-height: 1.4; }
.ig-caption strong { font-weight: 700; }
.ig-post .li-text.collapsed { -webkit-line-clamp: 2; }
.ig-post .li-more { color: #737373; padding: 0; }
.ig-date { margin: 4px 0 6px; font-size: 12.5px; color: #737373; }
.dev-frame[data-device="mobile"] .li-actions span { font-size: 0; flex: 1; justify-content: center; gap: 0; }
.dev-frame[data-device="mobile"] .li-actions .icon { width: 22px; height: 22px; }

/* Chat: Fenster füllt die Seite bis unten, Auswahlleisten kompakt */
@media (min-width: 900px) {
  body:has(.chat-shell) .topbar { margin-bottom: 10px; }
  body:has(.chat-shell) .topbar p { display: none; }
  body:has(.chat-shell) .content { padding-bottom: 16px; }
  .chat-main { height: calc(100dvh - 124px); min-height: 520px; }
  .chat-compose { gap: 6px; padding-top: 8px; padding-bottom: 10px; }
  .wa-quick { gap: 6px; }
  .wa-quick .chip-btn { font-size: 0.76rem; padding: 3px 10px; }
  .wa-direct { display: flex; flex-wrap: wrap; gap: 5px; }
  .wa-chip { flex: 0 0 auto; gap: 5px; padding: 2px 10px 2px 7px; border-radius: 999px; }
  .wa-chip .agent-photo { --s: 20px; width: 20px; height: 20px; }
  .chip-at { font-size: 0.85rem; }
  .chip-name { flex-direction: row; align-items: baseline; gap: 5px; }
  .chip-name strong { font-size: 0.8rem; }
  .chip-name small { font-size: 0.7rem; }
}
@media (min-width: 900px) { .chat-info { margin-top: 56px; } }

/* Quellenzeile: Einstellungen links (weiß), Aktionen rechts (leicht getönte Knöpfe) */
.conn-row[id^="s"] .src-actions { display: flex; flex: 1 1 100%; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.src-settings, .src-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.src-buttons { margin-left: auto; justify-content: flex-end; }
.src-pick { display: inline-flex; align-items: center; gap: 0; margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.src-pick label { padding: 0 4px 0 12px; font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.src-pick .row-select { border: 0; background: transparent; padding: 8px 8px 8px 2px; font-weight: 600; }
:root[data-theme="dark"] .src-pick { background: var(--card); }
.src-btn { background: color-mix(in srgb, var(--primary-2, #2E6DA4) 13%, #fff); border-color: color-mix(in srgb, var(--primary-2, #2E6DA4) 40%, var(--border)); color: #1a3a5c; font-weight: 700; }
.src-btn:hover { background: color-mix(in srgb, var(--primary-2, #2E6DA4) 24%, #fff); }
.btn-danger.small-btn { background: color-mix(in srgb, #d9534f 10%, #fff); }
@media (max-width: 899px) { .src-buttons { margin-left: 0; justify-content: flex-start; } }

/* ===== Vorschau-Beiträge im Stil der echten Apps (LinkedIn und Instagram, Computer und Handy) ===== */
.pp { background: #fff; color: #1d2226; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; width: 100%; }
.dev-frame[data-device="desktop"] .pp-m, .dev-frame[data-device="mobile"] .pp-d { display: none; }
.pp-text { white-space: pre-wrap; word-break: break-word; }
.pp-text.collapsed { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.pp-more { border: 0; background: none; font: inherit; cursor: pointer; padding: 0; color: #666; }
.pp-img { width: 100%; height: auto; display: block; }
.pv-empty { color: #8a8f94; font-style: italic; }

/* LinkedIn gemeinsam */
.pp-li-head { display: flex; align-items: flex-start; gap: 12px; }
.pp-li-avatar { flex: 0 0 auto; display: grid; place-items: center; background: #fff; border: 1px solid #e3e1dd; overflow: hidden; }
.pp-li-avatar img { width: 82%; height: auto; }
.pp-li-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pp-li-who strong { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.pp-li-who span { color: #666; }
.pp-in { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 3px; background: #0a66c2; color: #fff; font: 800 11px/1 Arial, sans-serif; font-style: normal; letter-spacing: -0.5px; }
.pp-dots { margin-left: auto; display: inline-flex; gap: 3px; padding: 8px 4px 0 8px; }
.pp-dots i { width: 5px; height: 5px; background: #4a4a4a; display: block; }
.pp-li-body { position: relative; }
.pp-li .pp-text.collapsed { -webkit-line-clamp: 3; }
.pp-li .pp-more { position: absolute; right: 0; bottom: 0; background: #fff; padding-left: 10px; box-shadow: -8px 0 8px #fff; }
.pp-li .pp-text:not(.collapsed) + .pp-more { position: static; display: block; margin-top: 4px; box-shadow: none; padding: 0; }
.pp-tag { color: #0a66c2; font-weight: 600; }
.pp-li-actions { display: flex; color: #5f6368; }
.pp-li-actions span { display: inline-flex; align-items: center; justify-content: center; }
.pp-li-actions .icon { stroke-width: 1.7; }

/* LinkedIn Computer */
.pp-li.pp-d { border: 1px solid #e0dfdc; border-radius: 12px; overflow: hidden; font-size: 15.5px; max-width: 520px; }
.pp-li.pp-d .pp-li-head { padding: 16px 18px 12px; }
.pp-li.pp-d .pp-li-avatar { width: 52px; height: 52px; border-radius: 50%; }
.pp-li.pp-d .pp-li-who strong { font-size: 16px; }
.pp-li.pp-d .pp-li-who span { font-size: 13.5px; }
.pp-li.pp-d .pp-li-body { padding: 4px 18px 14px; line-height: 1.55; }
.pp-li.pp-d .pp-li-actions { margin: 4px 18px 0; padding: 6px 0 8px; border-top: 1px solid #e3e1dd; justify-content: space-between; }
.pp-li.pp-d .pp-li-actions span { gap: 8px; font-weight: 600; font-size: 14.5px; padding: 8px 10px; }

/* LinkedIn Handy */
.pp-li.pp-m { font-size: 14.5px; }
.pp-li.pp-m .pp-li-head { padding: 12px 14px 8px; gap: 10px; }
.pp-li.pp-m .pp-li-avatar { width: 40px; height: 40px; border-radius: 4px; }
.pp-li.pp-m .pp-li-who strong { font-size: 15.5px; }
.pp-li.pp-m .pp-li-who span { font-size: 12.5px; }
.pp-li.pp-m .pp-li-body { padding: 2px 14px 12px; line-height: 1.5; }
.pp-li.pp-m .pp-li-actions { padding: 10px 14px 12px; gap: 30px; justify-content: flex-start; }

/* Instagram gemeinsam */
.pp-ig { container-type: inline-size; }
.pp-igimg { position: relative; width: 100%; background: #fafafa; overflow: hidden; }
.pp-igimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-igimg.orig:not(.pp-igempty) { aspect-ratio: auto; max-height: 125cqw; background: #fff; }
.pp-igimg.orig:not(.pp-igempty) img { height: auto; max-height: 125cqw; object-fit: contain; }
.pp-igempty { display: grid; place-items: center; color: #8e8e8e; background: #efefef; }
.pp-ig-actions { display: flex; align-items: center; gap: 18px; color: #262626; }
.pp-ig-actions .icon { stroke-width: 1.7; }
.pp-ig-save { margin-left: auto; display: inline-flex; }
.pp-ig-body { color: #262626; line-height: 1.4; }
.pp-ig .pp-text.collapsed { -webkit-line-clamp: 2; }
.pp-ig .pp-text strong { font-weight: 700; }
.pp-more-ig { color: #8e8e8e; display: inline; }
.pp-ig-date { margin: 6px 0 0; color: #8e8e8e; }

/* Instagram Computer (klassische Ansicht mit Kopfleiste und Fußleiste) */
.pp-ig.pp-d { border: 1px solid #dbdbdb; max-width: 440px; font-size: 15px; background: #fff; }
.pp-ig-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #dbdbdb; color: #262626; }
.pp-ig-word { font-family: "Billabong", "Grand Hotel", "Segoe Script", "Snell Roundhand", "Brush Script MT", cursive; font-size: 30px; line-height: 1; padding-bottom: 4px; }
.pp-ig-add { position: relative; display: inline-flex; }
.pp-ig-add i { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: #ed4956; }
.pp-ig.pp-d .pp-ig-actions { padding: 12px 16px 6px; }
.pp-ig.pp-d .pp-ig-body { padding: 4px 16px 14px; }
.pp-ig.pp-d .pp-ig-date { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.04em; }
.pp-ig-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 26px; border-top: 1px solid #dbdbdb; color: #262626; }
.pp-ig-nav .icon { stroke-width: 1.7; }

/* Instagram Handy (neue App) */
.pp-ig.pp-m { font-size: 14px; }
.pp-ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.pp-ig-avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #efefef; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.pp-ig-avatar img { width: 80%; height: auto; }
.pp-ig-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.pp-ig-who strong { font-size: 15px; }
.pp-ig-who span { font-size: 12.5px; color: #737373; }
.pp-ig-menu { color: #262626; display: inline-flex; }
.pp-ig.pp-m .pp-ig-actions { padding: 12px 14px 4px; gap: 17px; }
.pp-ig.pp-m .pp-ig-actions .icon { width: 26px; height: 26px; }
.pp-ig.pp-m .pp-ig-body { padding: 4px 14px 14px; font-size: 14.5px; }
.pp-ig.pp-m .pp-ig-date { font-size: 13px; }

/* Rahmen: Computer zeigt die Seite in einem Fenster, Handy füllt den Bildschirm */
.dev-frame[data-device="mobile"] .dev-screen { padding: 0; background: #fff; }
.dev-frame[data-device="mobile"] .dev-screen .pp { max-width: 100%; }
.dev-frame[data-device="mobile"] .dev-notch { background: #fff; }
.dev-frame[data-device="desktop"] .dev-screen { padding: 16px; }
.pv-col-ig .dev-frame[data-device="desktop"] .dev-screen { padding: 14px; background: #fafafa; }
.pv-col-ig .dev-frame[data-device="desktop"] { background: #fafafa; }
.pp-li-who strong { display: block; }
.pp-in { margin-left: 6px; vertical-align: 2px; }
.pp-li.pp-d .pp-more { right: 18px; bottom: 14px; }
.pp-li.pp-m .pp-more { right: 14px; bottom: 12px; }
.pp-li.pp-m .pp-li-who strong { font-size: 14px; } .pp-li.pp-m .pp-in { margin-left: 4px; }

/* Handyvorschau: ganze Handyseite, so hoch wie der Beitrag, Maße wie in den echten Apps */
.dev-frame[data-device="mobile"] { max-width: 340px !important; height: auto !important; }
.dev-frame[data-device="mobile"] .dev-screen { overflow: visible; display: block; }
.dev-frame[data-device="mobile"] .dev-notch { padding: 8px 0 6px; }
.pp-li.pp-m { font-size: 15.5px; }
.pp-li.pp-m .pp-li-head { padding: 14px 16px 10px; gap: 12px; align-items: center; }
.pp-li.pp-m .pp-li-avatar { width: 44px; height: 44px; border-radius: 50%; }
.pp-li.pp-m .pp-li-who strong { font-size: 16.5px; line-height: 1.25; }
.pp-li.pp-m .pp-li-who span { font-size: 14px; }
.pp-li.pp-m .pp-in { width: 19px; height: 19px; font-size: 12px; }
.pp-li.pp-m .pp-dots { align-self: flex-start; padding-top: 6px; }
.pp-li.pp-m .pp-dots i { width: 4px; height: 4px; border-radius: 50%; }
.pp-li.pp-m .pp-li-body { padding: 2px 16px 14px; line-height: 1.45; font-size: 16px; }
.pp-li.pp-m .pp-li-actions { padding: 14px 16px 16px; gap: 34px; }
.pp-li.pp-m .pp-li-actions .icon { stroke-width: 1.8; }
.pp-ig.pp-m .pp-ig-head { padding: 12px 16px; gap: 12px; }
.pp-ig.pp-m .pp-ig-avatar { width: 40px; height: 40px; }
.pp-ig.pp-m .pp-ig-who strong { font-size: 17px; }
.pp-ig.pp-m .pp-ig-who span { font-size: 14px; color: #262626; }
.pp-ig.pp-m .pp-ig-actions { padding: 14px 16px 6px; gap: 20px; }
.pp-ig.pp-m .pp-ig-actions .icon { width: 28px; height: 28px; stroke-width: 1.9; }
.pp-ig.pp-m .pp-ig-body { padding: 6px 16px 18px; font-size: 16.5px; line-height: 1.3; }
.pp-ig.pp-m .pp-text.collapsed { -webkit-line-clamp: 3; }
.pp-ig.pp-m .pp-ig-date { font-size: 15px; margin-top: 8px; }

/* Handyrahmen: immer iPhone-Format (9:19,5), bei beiden Netzwerken gleich groß. Längere Beiträge scrollen im Bildschirm. */
.dev-frame[data-device="mobile"] { width: 100%; max-width: 320px !important; height: auto !important; aspect-ratio: 9 / 19.5; box-sizing: border-box; border-radius: 44px; margin-left: auto; margin-right: auto; }
.dev-frame[data-device="mobile"] .dev-screen { flex: 1 1 0; min-height: 0; overflow-x: hidden; overflow-y: auto; display: block; background: #fff; }
.dev-frame[data-device="mobile"] .dev-notch { padding: 10px 0 8px; }

/* Reiter Veröffentlichen */
.pub-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 16px; }
.pub-hero h2 { margin: 2px 0 6px; font-size: 1.25rem; }
.pub-hero h2 a { color: inherit; text-decoration: none; }
.pub-hero p { margin: 0 0 6px; }
.pub-hero-side { border-left: 1px solid var(--border); padding-left: 20px; }
.pub-item { padding: 0; margin-bottom: 14px; overflow: hidden; }
.pub-sum { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.pub-sum::-webkit-details-marker { display: none; }
.pub-item[open] > .pub-sum { border-bottom: 1px solid var(--border); }
.pub-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; padding: 16px; }
.pub-body h3 { margin: 0 0 8px; font-size: 1rem; }
.pub-nets { display: flex; flex-direction: column; gap: 12px; }
.pub-net { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--card) 96%, var(--text)); }
.pub-net-linkedin { border-left: 4px solid #2E6DA4; }
.pub-net-instagram { border-left: 4px solid #d6336c; }
.pub-net.is-done { border-color: #1a9a66; background: color-mix(in srgb, #1a9a66 8%, var(--card)); }
.pub-net.is-off { opacity: 0.65; }
.pub-img { margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pub-img img { width: 100%; max-width: 260px; border-radius: 10px; border: 1px solid var(--border); }
.pub-mark { margin-top: 8px; }
.pub-when { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.pub-when label { margin: 0; font-weight: 700; }
.pub-when input { width: auto; }
@media (max-width: 860px) {
  .pub-hero, .pub-body { grid-template-columns: 1fr; }
  .pub-hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .pub-sum { flex-wrap: wrap; }
}
form.form.pub-when { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 10px; }
.pub-when input[type=datetime-local] { width: auto; min-width: 220px; }

/* Wegleiste und nächster Schritt */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.flow-step:not(:last-child)::after { content: "›"; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.3rem; z-index: 1; }
.flow-step strong { font-size: 1.4rem; line-height: 1.1; }
.flow-step span { font-weight: 700; font-size: 0.92rem; }
.flow-step small { color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.flow-step:hover { border-color: var(--primary-2, #2E6DA4); }
.flow-step.is-active { border-color: #e8820c; box-shadow: 0 0 0 1px #e8820c inset; background: color-mix(in srgb, #e8820c 8%, var(--card)); }
.flow-freigabe strong { color: #e8820c; }
.next-step { font-size: 0.78rem; font-weight: 700; color: var(--primary-2, #2E6DA4); white-space: nowrap; }
.flow-list { list-style: none; counter-reset: fl; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flow-list li { counter-increment: fl; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.flow-list li::before { content: counter(fl); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); font-size: 0.8rem; font-weight: 700; }
.flow-list li.is-done { color: var(--text); }
.flow-list li.is-done::before { content: "✓"; background: #1a9a66; border-color: #1a9a66; color: #fff; }
.flow-list li.is-now { color: var(--text); font-weight: 700; }
.flow-list li.is-now::before { background: #e8820c; border-color: #e8820c; color: #fff; }
.decision-card { max-width: 640px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.decision-card h1 { font-size: 1.4rem; margin: 0; }
.decision-form { display: flex; flex-direction: column; gap: 10px; }
.pub-body h4 { margin: 12px 0 6px; font-size: 0.9rem; }
.pub-checks { margin: 10px 0; }
@media (max-width: 860px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step:not(:last-child)::after { display: none; }
  .flow-step small { display: none; }
}

/* Wegleiste (Themen bis Veröffentlicht) und Reiter beim Veröffentlichen: farbig wie die anderen Kacheln */
.flow-neu { --ft: #2b7fe0; }
.flow-arbeit { --ft: #8b5cd6; }
.flow-freigabe { --ft: #E8950A; }
.flow-bereit { --ft: #0e8f9a; }
.flow-fertig { --ft: #1a9a66; }
.flow-step { background: color-mix(in srgb, var(--ft) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--ft) 40%, var(--border)); border-top: 4px solid var(--ft); }
.flow-step strong { color: var(--ft); }
.flow-step:hover { border-color: var(--ft); background: color-mix(in srgb, var(--ft) 15%, var(--card)); }
.flow-step.is-active { background: color-mix(in srgb, var(--ft) 20%, var(--card)); border: 2px solid var(--ft); border-top-width: 4px; box-shadow: 0 12px 24px -16px var(--ft); }
.tab-tinted .ap-tab { background: color-mix(in srgb, var(--tc) 9%, var(--card)); border-color: color-mix(in srgb, var(--tc) 40%, var(--border)); }
.tab-tinted .ap-tab.active { background: color-mix(in srgb, var(--tc) 20%, var(--card)); border-color: var(--tc); }

/* Chat: Themenvorschläge als weiße, eckige Felder mit grauem Rand, deutlich getrennt von den runden Mitarbeiter-Kacheln */
.wa-quick { gap: 12px; margin-bottom: 4px; }
.wa-quick .chip-btn { background: #fff; border: 1px solid #c9d1dc; border-radius: 8px; padding: 6px 14px; font-size: 0.8rem; font-weight: 600; color: #1d2733; box-shadow: 0 1px 2px rgba(15, 30, 50, 0.06); }
.wa-quick .chip-btn:hover { background: #f4f7fb; border-color: #9aa7b8; }
:root[data-theme="dark"] .wa-quick .chip-btn { background: var(--card); color: var(--text); border-color: var(--border); }
.agent-tile.tone-conn-telegram { --tc: #229ed9; --tc2: #7cc8ee; --tc-shadow: rgba(34, 158, 217, 0.35); }

/* Funktionssuche */
.sidebar-search { margin-top: auto; padding-top: 6px; }
.sidebar-search + .sidebar-foot { margin-top: 0; }
.fsearch { position: relative; }
.fsearch input[type="search"] { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px; border-radius: 12px; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); color: inherit; font: inherit; font-size: 0.9rem; }
.fsearch input[type="search"]::placeholder { color: inherit; opacity: 0.6; }
.fsearch input[type="search"]:focus { outline: none; border-color: #E8950A; box-shadow: 0 0 0 3px rgba(232, 149, 10, 0.25); }
.fsearch-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); opacity: 0.65; pointer-events: none; }
.fsearch-list { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--card, #fff); color: var(--text, #1d2733); border: 1px solid var(--border, #d6dde6); border-radius: 12px; box-shadow: 0 16px 36px -14px rgba(15, 30, 50, 0.45); z-index: 60; max-height: 320px; overflow-y: auto; }
.fsearch-list a { display: block; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 0.9rem; }
.fsearch-list a:hover, .fsearch-list a.on { background: color-mix(in srgb, #E8950A 18%, var(--card, #fff)); }
.more-search { margin-bottom: 14px; }
.more-search .fsearch-list { bottom: auto; top: calc(100% + 6px); }
.more-search .fsearch input[type="search"] { background: var(--card, #fff); border-color: var(--border, #d6dde6); font-size: 1rem; padding: 12px 12px 12px 36px; }

/* Video */
.pp-video { width: 100%; display: block; background: #000; max-height: 70vh; object-fit: contain; }
.pp-vid { background: #000; }
.vid-steps { display: grid; gap: 14px; }
.vid-step { border: 1px solid var(--border); border-left: 4px solid var(--tc, #2E6DA4); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.vid-step h3 { margin: 0 0 6px; font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.vid-step .step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--tc, #2E6DA4); color: #fff; font-weight: 800; font-size: 0.85rem; }
.vid-step.tb-blue { --tc: #2b7fe0; } .vid-step.tb-purple { --tc: #8b5cd6; } .vid-step.tb-orange { --tc: #E8950A; } .vid-step.tb-green { --tc: #1a9a66; } .vid-step.tb-red { --tc: #d93a68; }
.vid-step textarea { width: 100%; box-sizing: border-box; font: inherit; }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.vid-state { display: inline-flex; gap: 6px; align-items: center; }
.vid-order { max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 0.85rem; background: color-mix(in srgb, var(--primary-2, #2E6DA4) 6%, var(--card)); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.vid-big { font-size: 1.05rem; padding: 12px 22px; }

/* Medien: drei Karten nebeneinander */
.media-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) { .media-top { grid-template-columns: 1fr 1fr; } .media-top > #video-gen { grid-column: 1 / -1; } }
@media (max-width: 900px) { .media-top { grid-template-columns: 1fr; } }
.media-top #video-gen textarea[readonly] { width: 100%; box-sizing: border-box; min-height: 160px; }

/* Medien: untereinander wie Bibliothek und Quellen, farbige Kacheln und hervorgehobene Aktionen */
.media-top { display: block; }
.lib-tone-vid { --lt: #d93a68; }
.media-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .media-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.media-act { margin-bottom: 14px; }
.media-act-img { --lt: #8b5cd6; } .media-act-vid { --lt: #d93a68; } .media-act-up { --lt: #2b7fe0; }
.media-act.lib-add-panel { border: 2px solid var(--lt); background: color-mix(in srgb, var(--lt) 6%, var(--card)); }
.media-act .lib-add-go { background: linear-gradient(135deg, var(--lt), color-mix(in srgb, var(--lt) 70%, #fff)); color: #fff; box-shadow: 0 8px 16px -10px var(--lt); }
.media-act[open] .lib-add-go { background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.media-act > form, .media-act > div, .media-act > details { margin-left: 18px; margin-right: 18px; margin-bottom: 14px; }
.media-form textarea { width: 100%; box-sizing: border-box; min-height: 100px; }
.media-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; margin-top: 8px; }
.media-opts select { width: 100%; }
.media-lib-title { margin: 22px 0 12px; font-size: 1.25rem; }
.media-grid2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.media-grid2 .lib-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-edit { flex: 1 1 100%; }
.media-edit > summary { list-style: none; cursor: pointer; display: inline-flex; }
.media-edit[open] > summary { margin-bottom: 8px; }
.media-loc { word-break: break-all; }
.media-tiles .lib-tile-text { min-width: 0; }
.media-tiles .lib-tile strong { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 560px) { .media-tiles .lib-tile { padding: 12px; gap: 10px; } .media-tiles .lib-tile .logo-tile { --s: 36px !important; } }

/* Bibliothek: Kachel Videos, Detailseite eines Video-Auftrags */
nav.lib-tiles:not(.media-tiles) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { nav.lib-tiles:not(.media-tiles) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { nav.lib-tiles:not(.media-tiles) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lib-tone-video { --lt: #d93a68; }
.lib-vidmark { position: absolute; left: 10px; top: 10px; }
.vj-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; border-left: 4px solid #d93a68; }
.vj-thumb { width: 150px; border-radius: 12px; object-fit: cover; }
.vj-state { flex: 1 1 320px; min-width: 0; }
.vj-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.vj-steps li { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.vj-steps li.is-done { background: color-mix(in srgb, #1a9a66 14%, var(--card)); color: var(--text); border-color: #1a9a66; }
.vj-steps li.is-now { background: color-mix(in srgb, #d93a68 16%, var(--card)); color: var(--text); border-color: #d93a68; }
.vj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0; }
.vj-facts > div { background: color-mix(in srgb, #d93a68 5%, var(--card)); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.vj-facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.vj-facts dd { margin: 2px 0 0; font-weight: 600; }

/* Medien: nur die Werkstatt, darunter eine kleine Auswahl der zuletzt dazugekommenen Einträge */
.media-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.media-mini { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; }
.media-mini-pic { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--primary-soft); }
.media-mini-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-mini strong { font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; }
.media-mini-actions { display: flex; gap: 12px; font-size: 0.85rem; }

/* Übersicht, Social Media Team: Foto vorn, Name, kleine Symbol-Kachel dahinter, gleich große Stand-Pillen */
.card .team-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 28px 96px; align-items: center; gap: 12px; padding: 8px 10px; text-align: left; }
.card .team-row.sub-row { padding-left: 10px; }
.team-row .list-title { text-align: left; min-width: 0; }
.team-row .agent-photo { --s: 40px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.team-row .agent-tile { --s: 28px !important; justify-self: center; }
.team-row .agent-tile .logo-spark { width: 10px; height: 10px; }
.team-row .team-pill { width: 96px; box-sizing: border-box; text-align: center; justify-self: end; padding-left: 0; padding-right: 0; white-space: nowrap; }
@media (max-width: 420px) { .card .team-row { grid-template-columns: 36px minmax(0, 1fr) 26px 84px; gap: 8px; } .team-row .team-pill { width: 84px; font-size: 0.85rem; } }

/* Team-Seite: Ablauf als einzelne Kacheln ohne Pfeile, Verbindungslinien enden bei der letzten Reihe */
.flow-details .flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.flow-details .flow-item { position: static; display: block; min-width: 0; }
.flow-details .flow-step { display: flex; align-items: flex-start; gap: 12px; height: 100%; box-sizing: border-box; padding: 14px 16px; border: 2px solid color-mix(in srgb, var(--tc) 55%, var(--border)); border-radius: 16px; background: color-mix(in srgb, var(--tc) 7%, var(--card)); color: var(--text); box-shadow: none; }
.flow-details .flow-step::after { display: none; }
.flow-details .flow-n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; font-size: 0.9rem; }
.flow-details .flow-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.flow-details .flow-step strong { font-size: 1rem; color: var(--text); line-height: 1.2; }
.flow-details .flow-text span { font-size: 0.85rem; font-weight: 400; color: var(--muted); line-height: 1.35; }
.flow-details .flow-current .flow-step { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 30%, transparent); }
.flow-details .flow-next, .flow-details .flow-wrap, .flow-details .flow-down { display: none; }
@media (max-width: 1100px) { .flow-details .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .flow-details .flow { grid-template-columns: 1fr; } }

@media (min-width: 901px) {
  .agents-tree::before { top: -14px; bottom: auto; height: 66px; }
  .agent-node.col-l::before { display: block; content: ""; position: absolute; left: calc(100% + var(--gap) / 2 - 1.5px); width: 3px; background: var(--trunk); border-radius: 2px; top: -22px; bottom: -22px; }
  .agent-node.col-l.first-row::before { top: 0; }
  .agent-node.col-l.last-row::before { bottom: calc(100% - 40px); }
}
