/* Design 1:1 aus der narev-Software (Farben/Tokens identisch), plus Chat-UI. */
[hidden] { display: none !important; }

:root {
  --sidebar-bg: #1E2A4A;
  --sidebar-active: #3B82F6;
  --sidebar-text-inactive: #8B9CC7;
  --sidebar-locked: #4A5578;
  --sidebar-divider: #2D3A5C;

  --main-bg: #F5F7FA;
  --card-bg: #FFFFFF;
  --card-border: #E8ECF1;

  --text-heading: #1A1F36;
  --text-body: #4A5568;
  --text-muted: #9CA3AF;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EBF0FF;

  --progress-bg: #E5E7EB;
  --progress-fill: #1E3A5F;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text-body);
  background: var(--main-bg);
}

.layout { display: flex; min-height: 100vh; }

/* --- Sidebar (identisch zur narev-Software) --- */
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--sidebar-bg); color: #fff;
  padding: 28px 18px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 22px; font-weight: 700; margin: 0 12px 28px; }
.brand span { color: var(--sidebar-active); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px;
  color: var(--sidebar-text-inactive); text-decoration: none; font-weight: 500;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar nav a.active { background: var(--sidebar-active); color: #fff; }
.sidebar svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.divider { height: 1px; background: var(--sidebar-divider); margin: 22px 8px; }
.side-foot { margin-top: auto; color: var(--sidebar-locked); padding: 0 14px; font-size: 12px; line-height: 1.5; }
.side-foot a { color: var(--sidebar-text-inactive); }

.content { flex: 1; min-width: 0; padding: 40px 48px; max-width: 1180px; }
.content.flush { padding: 0; max-width: none; }

/* Schoenes Aufklapp-Symbol fuer alle <details> */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 8px;
  vertical-align: middle; border-left: 6px solid var(--primary); border-top: 5px solid transparent;
  border-bottom: 5px solid transparent; transition: transform .18s ease; }
details[open] > summary::before { transform: rotate(90deg); }
.bew-details > summary { list-style: none; }
.bew-summary { display: flex; align-items: center; gap: 18px; }
.bew-summary::before { align-self: center; }
.page-intro { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }
h1 { color: var(--text-heading); font-size: 24px; margin: 8px 0 12px; }
h2.section-label { color: var(--text-muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 28px 0 14px; }

.card, .stat, .module {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.badge { display: inline-block; background: var(--primary-light); color: var(--primary);
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-hover); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--card-border); }
.btn.secondary:hover { background: var(--main-bg); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.bar { height: 6px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--progress-fill); border-radius: 4px; transition: width .25s ease; }

/* --- Chat-Layout (ChatGPT/Claude-Stil) --- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; min-height: 100vh; }
.chat-list {
  border-right: 1px solid var(--card-border); background: #fff;
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
}
.chat-list-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--card-border); }
.chat-list-head .btn { width: 100%; justify-content: center; }
.chat-items { overflow-y: auto; flex: 1; padding: 8px; }
.chat-item {
  display: block; width: 100%; text-align: left; cursor: pointer; position: relative;
  background: none; border: none; border-radius: 10px; padding: 11px 30px 11px 12px; margin-bottom: 2px;
  color: var(--text-body); font-size: 14px; line-height: 1.35;
}
.ci-del { position: absolute; top: 8px; right: 8px; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1; padding: 2px 5px; border-radius: 6px; opacity: 0; transition: opacity .12s; }
.chat-item:hover .ci-del { opacity: 1; }
.ci-del:hover { color: var(--danger); background: #fef2f2; }
.chat-item.running { background: var(--primary-light); }
.ci-bar { height: 5px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; margin-top: 7px; }
.ci-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s ease; }
.ci-pct { font-size: 11px; color: var(--primary); font-weight: 700; }
.chat-item:hover { background: var(--main-bg); }
.chat-item.active { background: var(--primary-light); }
.chat-item .ci-title { font-weight: 600; color: var(--text-heading); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chat-item .ci-sub { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center;
  margin-top: 4px; flex-wrap: wrap; }
.chat-item .ci-sub .pill { font-size: 10px; padding: 1px 6px; }
.pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.pill.gray { background: var(--progress-bg); color: var(--text-body); }
.pill.blue { background: var(--primary-light); color: var(--primary); }
.pill.green { background: #dcfce7; color: #15803d; }
.pill.amber { background: #fef3c7; color: #b45309; }
.pill.red { background: #fee2e2; color: #b91c1c; }

.chat-main { display: flex; flex-direction: column; height: 100vh; }
.chat-head {
  padding: 18px 28px; border-bottom: 1px solid var(--card-border); background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.chat-head h2 { margin: 0; font-size: 17px; color: var(--text-heading); }
.chat-head .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.chat-scroll { flex: 1 1 0; overflow-y: auto; padding: 28px; min-height: 140px; }
.chat-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.empty { text-align: center; color: var(--text-muted); padding: 80px 20px; line-height: 1.6; }
.empty svg { width: 44px; height: 44px; stroke: var(--primary); fill: none; stroke-width: 1.6; }

/* Nachrichten-Blasen */
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.mia { align-self: flex-end; align-items: flex-end; }
.msg.kunde { align-self: flex-start; align-items: flex-start; }
.msg .who { font-size: 11px; color: var(--text-muted); margin: 0 6px 3px; font-weight: 600; }
.msg-ts { font-weight: 400; opacity: .7; font-variant-numeric: tabular-nums; margin-left: 4px; }
.bubble { padding: 12px 16px; border-radius: 16px; line-height: 1.5; white-space: pre-wrap; }
.msg.mia .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg.kunde .bubble { background: #fff; border: 1px solid var(--card-border); border-bottom-left-radius: 5px; }
/* Bob = blau, Mia = gelb (zwei Verkaeufer unterscheiden) */
.msg.s-bob .bubble { background: #2563EB; color: #fff; }
.msg.s-mia .bubble { background: #F5B301; color: #3a2c00; }
.msg.s-bob .who-name, .msg.s-mia .who-name { font-weight: 700; }
.msg.s-bob .who-name { color: #2563EB; }
.msg.s-mia .who-name { color: #b8860b; }
/* Live-Gespraeche: Verkaeufer gruen */
.msg.s-live .bubble { background: #16a34a; color: #fff; }
.msg.s-live .who-name { color: #15803d; font-weight: 700; }
.msg.corrected .bubble { box-shadow: 0 0 0 2px var(--success); }

.video-msg { align-self: center; width: min(460px, 92%); background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.video-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-heading); margin-bottom: 8px; }
.video-head svg { width: 16px; height: 16px; fill: var(--primary); stroke: none; flex-shrink: 0; }
.video-sub { font-weight: 400; color: var(--text-muted); }
.video-msg video { width: 100%; border-radius: 10px; background: #000; display: block; }

.msg-tools { display: flex; gap: 6px; margin: 5px 6px 0; opacity: 0; transition: opacity .12s; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button { font-size: 12px; cursor: pointer; background: #fff; border: 1px solid var(--card-border);
  border-radius: 8px; padding: 3px 9px; color: var(--text-body); }
.msg-tools button:hover { border-color: var(--primary); color: var(--primary); }
.msg-tools .r-ok.done { background: var(--success); color: #fff; border-color: transparent; }
.msg-tools .r-fix.done { background: var(--warning); color: #fff; border-color: transparent; }
.review-note { font-size: 12px; color: var(--warning); margin: 4px 6px 0; max-width: 480px; }

/* Editor unter einer Nachricht */
.reviewbox { margin: 8px 6px 0; background: #fff; border: 1px solid var(--card-border);
  border-radius: 12px; padding: 12px; width: min(520px, 90%); }
.reviewbox textarea { width: 100%; border: 1px solid var(--card-border); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; min-height: 54px; }
.reviewbox label { font-size: 12px; color: var(--text-muted); display: block; margin: 6px 0 3px; }
.reviewbox .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* Bewertungs-Panel (Christian) */
.bewertung { border-top: 1px solid var(--card-border); background: #fff; padding: 20px 28px;
  flex-shrink: 0; max-height: 46vh; overflow-y: auto; transition: max-height .25s ease; }
/* Aufgeklappte Bewertung nimmt den GANZEN Bereich ein (ueber dem Chat, voll lesbar) */
.chat-main:has(.bew-details[open]) .chat-scroll { display: none; }
.bewertung:has(.bew-details[open]) { max-height: none; flex: 1 1 auto; }
.bewertung-inner { max-width: 820px; margin: 0 auto; }
.score-row { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.score-ring { width: 74px; height: 74px; border-radius: 50%; border: 6px solid var(--progress-fill);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--text-heading); flex-shrink: 0; }
.score-ring.pass { border-color: var(--success); }
.score-ring.mid { border-color: var(--warning); }
.score-ring.low { border-color: var(--danger); }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .cats { grid-template-columns: 1fr; } }
.cat { border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 12px; }
.cat-head { display: flex; justify-content: space-between; font-weight: 600; color: var(--text-heading); font-size: 14px; }
.cat p { margin: 5px 0 0; font-size: 13px; line-height: 1.45; }
.phasen { display: flex; flex-wrap: wrap; gap: 8px; }
.phase { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--card-border); border-radius: 999px; padding: 4px 12px 4px 4px; background: #fff; cursor: default; }
.phase .ph-nr { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--text-muted); }
.phase .ph-icon { font-weight: 700; font-size: 13px; }
.phase.ph-ok { border-color: #a7f3d0; background: #f0fdf4; }
.phase.ph-ok .ph-nr { background: var(--success); }
.phase.ph-ok .ph-icon { color: var(--success); }
.phase.ph-mid { border-color: #fde68a; background: #fffbeb; }
.phase.ph-mid .ph-nr { background: var(--warning); }
.phase.ph-mid .ph-icon { color: var(--warning); }
.phase.ph-no { border-color: #fecaca; background: #fef2f2; }
.phase.ph-no .ph-nr { background: var(--danger); }
.phase.ph-no .ph-icon { color: var(--danger); }

.chat-done { align-self: center; font-size: 13px; font-weight: 600; color: var(--success);
  background: #f0fdf4; border: 1px solid #a7f3d0; border-radius: 999px; padding: 6px 16px; }
.chat-start { align-self: center; text-align: center; font-size: 13px; color: var(--text-body);
  background: var(--main-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 8px 16px; margin-bottom: 6px; max-width: 90%; }
.msg-in { animation: msgIn .32s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.pc-text ul { margin: 4px 0; padding-left: 20px; }
.pc-text li { margin: 2px 0; }
.pc-text div { margin: 2px 0; }

.pruefer-chat { max-width: 820px; margin: 0 auto; }
.pc-log { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.pc-msg { max-width: 85%; }
.pc-msg.user { align-self: flex-end; }
.pc-msg.pruefer { align-self: flex-start; }
.pc-who { font-size: 11px; color: var(--text-muted); margin: 0 4px 3px; font-weight: 600; }
.pc-text { padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; font-size: 14px; }
.pc-msg.user .pc-text { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.pc-msg.pruefer .pc-text { background: #fff; border: 1px solid var(--card-border); border-bottom-left-radius: 5px; }
.pc-input { display: flex; gap: 8px; margin-top: 12px; }
.pc-input input { flex: 1; padding: 10px 14px; border: 1px solid var(--card-border); border-radius: 10px; font: inherit; }

/* Tabellen / Listen */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.data-table th { background: var(--main-bg); color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.data-table tr:last-child td { border-bottom: none; }

.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-card { display: flex; gap: 14px; background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.doc-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; }
.doc-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc-title { font-weight: 700; color: var(--text-heading); font-size: 15px; }
.doc-desc { font-size: 13px; margin: 4px 0 10px; line-height: 1.45; color: var(--text-body); }
.doc-badge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--success);
  background: #dcfce7; border-radius: 999px; padding: 4px 12px; }

.ab-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.ab-table th, .ab-table td { border: 1px solid var(--card-border); padding: 10px 12px; text-align: left; vertical-align: top; font-size: 13px; }
.ab-table thead th { background: var(--main-bg); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.ab-table tbody th { background: var(--main-bg); width: 200px; color: var(--text-heading); }
.ab-table th.ab-ok { color: #15803d; }
.ab-table th.ab-no { color: #b91c1c; }
.ab-table .ab-ok-cell { background: #f0fdf4; }
.ab-table .ab-no-cell { background: #fef2f2; }
.ab-table ul { margin: 0; padding-left: 18px; line-height: 1.55; }
.ab-table li { margin: 3px 0; }

.regel { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.regel.inaktiv { opacity: .5; }
.regel .kat { font-size: 13px; font-weight: 700; color: var(--text-heading); background: none; padding: 0; }
.regel .tag { font-size: 11px; font-weight: 600; margin-left: 10px; display: inline-flex; align-items: center; gap: 5px; }
.regel .tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-auto { color: #15803d; }
.tag-abgleich { color: #6d28d9; }
.tag-pruefen { color: #b45309; }

/* Premium-Vollbild-Video im Live-Gespraech */
.video-ov { position: fixed; inset: 0; z-index: 400; background: rgba(6,8,16,0);
  display: flex; align-items: center; justify-content: center; padding: 1vw;
  backdrop-filter: blur(0px); transition: background .35s ease, backdrop-filter .35s ease; }
.video-ov.an { background: rgba(6,8,16,.97); backdrop-filter: blur(8px); }
.video-ov-inner { position: relative; width: 100%; max-width: 1700px; transform: scale(.85); opacity: 0;
  transition: transform .4s cubic-bezier(.2,.9,.3,1), opacity .35s ease; }
.video-ov.an .video-ov-inner { transform: scale(1); opacity: 1; }
.video-ov video { width: 100%; max-height: 96vh; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.7); display: block; }
.video-ov-close { position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #fff; color: #1a1f36; font-size: 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); }

.ka-inp { flex: 1; min-width: 130px; padding: 9px 11px; border: 1px solid var(--card-border); border-radius: 8px; font: inherit; }
.live-caption { min-height: 24px; font-size: 15px; line-height: 1.5; color: var(--text-body); margin: 6px 0;
  text-align: center; }
.live-caption:empty { display: none; }
.live-caption .cap-akt { background: var(--primary-light); color: var(--primary); font-weight: 700;
  border-radius: 5px; padding: 1px 5px; }

.pf-kat-item { font-size: 11px; border: 1px solid var(--card-border); background: var(--main-bg);
  color: var(--text-body); border-radius: 6px; padding: 3px 7px; cursor: pointer; min-width: 26px; }
.pf-kat-item:hover { border-color: var(--primary); }
.pf-kat-item.done { background: #dcfce7; color: #15803d; border-color: #86efac; }
.pf-kat-item.aktiv { background: var(--primary); color: #fff; border-color: var(--primary); }

.pf-passage { font-size: 18px; line-height: 1.9; color: var(--text-heading); background: var(--main-bg);
  border: 1px solid var(--card-border); border-radius: 12px; padding: 18px 20px; }
.pf-passage .pw { padding: 1px 3px; border-radius: 5px; transition: background .12s, color .12s; }
.pf-passage .pw.gut { background: #dcfce7; color: #15803d; }
.pf-passage .pw.falsch { background: #fee2e2; color: #b91c1c; }
.pf-passage .pw.aktuell { box-shadow: inset 0 -2px 0 var(--primary); }
.pf-bar { height: 12px; background: var(--card-border); border-radius: 999px; overflow: hidden; }
.pf-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #7c3aed); border-radius: 999px; transition: width .3s ease; }

.rec-box { display: flex; gap: 16px; align-items: center; background: var(--main-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; }
.rec-orb { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--card-border); color: var(--text-muted); }
.rec-orb svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
.rec-orb.rec-on { background: var(--danger); color: #fff; animation: recPulse 1.2s infinite; }
@keyframes recPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 60% { box-shadow: 0 0 0 12px rgba(239,68,68,0); } }
.msg-highlight .bubble { animation: msgGlow 2.4s ease; box-shadow: 0 0 0 3px rgba(180,83,9,.5); }
@keyframes msgGlow { 0%,100% { box-shadow: 0 0 0 3px rgba(180,83,9,0); } 20%,60% { box-shadow: 0 0 0 3px rgba(180,83,9,.6); } }
.video-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 16px; }
.video-btns-lbl { font-size: 12px; color: var(--text-muted); width: 100%; margin-bottom: 2px; }

.live-voice-wrap { margin: 16px 0 0; text-align: left; }
.select-wrap { position: relative; margin-top: 5px; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select { width: 100%; padding: 11px 34px 11px 13px; border: 1px solid var(--card-border);
  border-radius: 10px; font: inherit; font-size: 14px; background: var(--main-bg); color: var(--text-heading);
  appearance: none; -webkit-appearance: none; cursor: pointer; }
.select-wrap select:focus { outline: none; border-color: var(--primary); background: #fff; }

.live-orb { width: 96px; height: 96px; border-radius: 50%; margin: 8px auto 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; box-shadow: 0 8px 30px rgba(124,58,237,.35); }
.live-orb svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 2; }
.live-orb.aktiv { animation: orbPulse 1.4s ease-in-out infinite; }
@keyframes orbPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,58,237,.4); } 50% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(124,58,237,0); } }

.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.live-dot.on { background: var(--success); box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: pulseDot 1.6s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* Kernregeln - die zwei wichtigsten, unantastbar */
.regel.kernregel { border: 2px solid var(--primary); background: linear-gradient(180deg, var(--primary-light), transparent 60%); }
.kern-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; background: var(--primary); border-radius: 999px; padding: 3px 10px; }
.kern-badge svg { width: 12px; height: 12px; fill: #fff; }

.gv { flex: 1; min-width: 170px; font-size: 12.5px; line-height: 1.45; border-radius: 12px; padding: 11px 13px; }
.gv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gv-head b { font-size: 12.5px; }
.gv-badge { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.gv-ja { background: #f0fdf4; border: 1px solid #a7f3d0; color: #14532d; }
.gv-ja .gv-badge { background: var(--success); }
.gv-nein { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.gv-nein .gv-badge { background: var(--danger); }
.gv span { color: inherit; opacity: .85; }

.confirm-ov { position: fixed; inset: 0; z-index: 300; background: rgba(26,31,54,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-box { background: #fff; border-radius: 16px; padding: 24px 26px; max-width: 380px; width: 100%;
  box-shadow: 0 16px 44px rgba(0,0,0,.3); animation: msgIn .18s ease; }
.confirm-box p { margin: 0 0 18px; line-height: 1.5; color: var(--text-heading); font-size: 15px; }
.confirm-row { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-row .c-yes { background: var(--danger); }
.confirm-row .c-yes:hover { background: #dc2626; }
.regel .bsp { font-style: italic; color: var(--text-body); margin: 6px 0 0; font-size: 13px; }
.regel-quelle { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px;
  font-weight: 600; color: var(--primary); background: var(--primary-light); border: 1px solid transparent;
  border-radius: 999px; padding: 4px 11px; text-decoration: none; }
.regel-quelle:hover { border-color: var(--primary); }
.regel-quelle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.regel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.login-card .brand { color: var(--text-heading); text-align: center; margin-bottom: 6px; }
.login-card p.sub { text-align: center; color: var(--text-muted); margin: 0 0 22px; font-size: 14px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--card-border); border-radius: 10px; font-size: 15px; margin-bottom: 12px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-err { background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

/* --- Telefonieren / Anruf --- */
.call-panel { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 26px; max-width: 560px; }
.call-link { display: flex; gap: 8px; margin: 10px 0 4px; }
.call-link input { flex: 1; padding: 10px 12px; border: 1px solid var(--card-border); border-radius: 8px; font: inherit; font-size: 13px; background: var(--main-bg); }
.mic-hint { display: flex; align-items: center; gap: 10px; background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a; border-radius: 12px; padding: 12px 16px; font-weight: 600; margin: 6px 0 16px; }
.mic-hint svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
body.mic-on .mic-hint { display: none; }
.mic-blocked { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
  border-radius: 12px; padding: 12px 16px; margin: 6px 0 16px; line-height: 1.5; font-size: 14px; }
.mic-blocked strong { color: #991b1b; }
.mic-big { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; border: none;
  background: var(--primary); color: #fff; border-radius: 14px; padding: 18px 26px; font: inherit;
  font-size: 17px; font-weight: 700; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.mic-big:hover { background: var(--primary-hover); }
.mic-big svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic-big.pulse { animation: micpulse 1.6s ease-in-out infinite; }
@keyframes micpulse { 0%,100% { box-shadow: 0 6px 18px rgba(37,99,235,.35); } 50% { box-shadow: 0 6px 30px rgba(37,99,235,.7); } }
.call-avatars { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 18px; }
.call-av { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.av-circle { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; }
.av-me { background: var(--primary); }
.av-other { background: var(--text-muted); }
.av-name { font-size: 12px; color: var(--text-body); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-conn { display: flex; gap: 5px; padding: 0 6px; }
.call-conn span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: .4; animation: conn 1.2s infinite; }
.call-conn span:nth-child(2) { animation-delay: .2s; }
.call-conn span:nth-child(3) { animation-delay: .4s; }
@keyframes conn { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
body.call-connected .call-conn span { background: var(--success); opacity: .9; animation: none; }
body.call-connected .av-other { background: var(--success); }

.consent-row { position: relative; background: var(--main-bg); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 14px 32px 14px 16px; margin: 4px 0 16px; font-size: 13px; line-height: 1.55; }
.consent-row label { gap: 12px !important; }
.consent-row[hidden] { display: none; }
.consent-x { position: absolute; top: 6px; right: 8px; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 17px; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.consent-x:hover { color: var(--text-heading); background: rgba(0,0,0,.05); }
.consent-info { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }
.call-status { margin: 16px 0 0; color: var(--text-body); font-size: 15px; }
.presence { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-right: 6px; vertical-align: 1px; }
.hangup { margin-top: 18px; }

.anruf-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); padding: 20px; }
.anruf-card { background: #fff; border-radius: 20px; padding: 40px 34px; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.anruf-card .brand { color: var(--text-heading); justify-content: center; margin-bottom: 4px; }
.anruf-card h1 { font-size: 20px; margin: 4px 0 6px; }
.anruf-card p.lead { color: var(--text-muted); margin: 0 0 22px; line-height: 1.5; }

/* --- Gesamt-Analyse (Prüfer-Bereich) --- */
.an-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 760px) { .an-tiles { grid-template-columns: repeat(2, 1fr); } }
.an-tile { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 18px 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.an-ring { width: 66px; height: 66px; margin: 0 auto 8px; border-radius: 50%; border: 6px solid var(--progress-fill);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--text-heading); }
.an-ring.pass { border-color: var(--success); } .an-ring.mid { border-color: var(--warning); } .an-ring.low { border-color: var(--danger); }
.an-big { font-size: 30px; font-weight: 700; color: var(--text-heading); margin: 6px 0 8px; }
.an-lbl { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.an-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } }
.an-card { padding: 16px 18px; }
.an-h { font-weight: 700; color: var(--text-heading); font-size: 14px; margin-bottom: 12px; }
.an-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.an-row-name { width: 150px; font-size: 13px; color: var(--text-body); flex-shrink: 0; }
.an-bar { flex: 1; height: 8px; background: var(--progress-bg); border-radius: 5px; overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 5px; }
.an-bar-fill.ok { background: var(--success); } .an-bar-fill.mid { background: var(--warning); } .an-bar-fill.no { background: var(--danger); }
.an-row-val { width: 52px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-heading); flex-shrink: 0; }
.an-phases { display: flex; flex-direction: column; gap: 8px; }
.an-phase { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.an-phase-pct { display: inline-block; min-width: 44px; text-align: center; font-weight: 700; font-size: 12px;
  color: #b45309; background: #fef3c7; border-radius: 6px; padding: 3px 6px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-body); cursor: pointer; }
.switch input { width: 40px; height: 22px; -webkit-appearance: none; appearance: none; background: var(--progress-bg);
  border-radius: 999px; position: relative; cursor: pointer; transition: background .18s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { left: 20px; }

.seg-btn { cursor: pointer; border: 1px solid var(--card-border); background: #fff; color: var(--text-body);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; }
.seg-btn:hover { border-color: var(--primary); }
.seg-btn.active { background: var(--primary); color: #fff; border-color: transparent; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text-heading); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 200; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.dark { border-color: var(--progress-bg); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.typing { color: var(--text-muted); font-style: italic; padding: 6px; }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { position: static; height: auto; max-height: 42vh; }
  .chat-main { height: auto; min-height: 60vh; }
}

/* --- Mobil: Sidebar wird zur oberen Leiste, Inhalte stapeln --- */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar .brand { margin: 0 6px 0 4px; font-size: 19px; flex-shrink: 0; }
  .sidebar nav { flex-direction: row; gap: 4px; flex-wrap: nowrap; }
  .sidebar nav a { padding: 9px 12px; white-space: nowrap; border-radius: 10px; font-size: 14px; }
  .sidebar nav a svg { width: 19px; height: 19px; }
  .sidebar .divider, .side-foot { display: none; }

  .content { padding: 18px 14px; }
  h1 { font-size: 21px; }
  .content.flush { padding: 0; }

  /* Dialoge/Modals volle Breite */
  #seed-modal > .card, #ab-modal > .card, .flow-modal-box { max-width: 96vw !important; }

  .an-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .an-row-name { width: 110px; }
  .cats { grid-template-columns: 1fr; }
  .msg, .pc-msg { max-width: 92%; }
  .video-msg { width: 100%; }
  .phase { font-size: 12px; }
  .chat-head { padding: 14px 16px; }
  .chat-scroll { padding: 16px; }
  .bewertung { padding: 16px; max-height: none; overflow: visible; }
}

@media (max-width: 480px) {
  .an-tiles { grid-template-columns: 1fr 1fr; }
  .an-big { font-size: 24px; }
  .an-ring { width: 56px; height: 56px; font-size: 18px; }
  .price-grid, .stats, .modules { grid-template-columns: 1fr; }
  .an-row-name { width: 92px; font-size: 12px; }
}
