:root {
  --oenz-rot: #A71D31;
  --oenz-rot-hell: #C03548;
  --oenz-navy: #251F47;
  --oenz-navy-hell: #404E7C;
  --oenz-navy-hell2: #5B6BA8;
  --oenz-tint: #FFE9DF;
  --gruen: #2A9D8F;
  --rot: #E63946;
  --grau: #5C6672;
  --hell: #EFF2F6;
  --grau-hell: #C7CEDB;
  --weiss: #FFFFFF;
  --spoe: #CE0000;
  --oevp: #63C3D0;
  --fpoe: #205CA5;
  --neos: #E40079;
  --gruenepartei: #88B626;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Helvetica, Arial, "Segoe UI", sans-serif; background: var(--hell); color: var(--oenz-navy); line-height: 1.6; }

header { background: var(--oenz-navy); padding: 18px 40px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; letter-spacing: 0.5px; color: var(--weiss); }
.logo-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--oenz-rot); color: var(--weiss); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; }
nav a { color: rgba(255,255,255,0.7); text-decoration: none; margin-left: 24px; font-size: 14px; }
nav a:hover { color: var(--oenz-tint); }

.hero { background: linear-gradient(160deg, var(--oenz-navy) 0%, var(--oenz-navy-hell) 100%); color: var(--weiss); padding: 80px 40px 90px; text-align: center; }
.hero h1 { font-size: 44px; max-width: 820px; margin: 0 auto 20px; font-weight: 800; line-height: 1.2; }
.hero h1 span { color: var(--oenz-tint); }
.hero p { font-size: 18px; color: rgba(255,255,255,0.75); max-width: 680px; margin: 0 auto 34px; }
.btn { display: inline-block; background: var(--oenz-rot); color: var(--weiss); padding: 14px 30px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 16px; border: none; cursor: pointer; }
.btn:hover { background: var(--oenz-rot-hell); }
.btn.secondary { background: transparent; border: 2px solid rgba(255,255,255,0.3); color: var(--weiss); margin-left: 12px; }
.btn.secondary:hover { border-color: var(--oenz-tint); color: var(--oenz-tint); }
.btn:disabled { opacity: 0.6; cursor: default; }

section { padding: 60px 40px; max-width: 1080px; margin: 0 auto; }
.kicker { display: inline-block; background: var(--oenz-rot); color: var(--weiss); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 12px; margin-bottom: 14px; padding: 5px 14px; border-radius: 999px; }
h2 { font-size: 30px; margin-bottom: 14px; font-weight: 800; }
.lead { font-size: 16px; color: var(--grau); max-width: 760px; }

.mission { background: var(--weiss); border-radius: 18px; padding: 44px; box-shadow: 0 2px 14px rgba(37,31,71,0.07); border-left: 6px solid var(--oenz-rot); }
.mission blockquote { font-size: 19px; font-style: italic; }
.mission-meta { margin-top: 18px; font-size: 14px; color: var(--grau); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 40px; }
.card { background: var(--weiss); border-radius: 14px; padding: 26px; box-shadow: 0 2px 10px rgba(37,31,71,0.06); border-top: 4px solid var(--oenz-rot); }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--grau); }
.card .icon { font-size: 26px; margin-bottom: 12px; }

.flow { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.step { flex: 1 1 240px; background: var(--weiss); border-radius: 14px; padding: 24px; box-shadow: 0 2px 10px rgba(37,31,71,0.06); }
.step .num { width: 32px; height: 32px; border-radius: 50%; background: var(--oenz-navy); color: var(--weiss); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--grau); }

/* --- Chat --- */
.chat-wrap { background: var(--weiss); border-radius: 18px; box-shadow: 0 4px 20px rgba(37,31,71,0.10); overflow: hidden; margin-top: 40px; }
.chat-head { background: var(--oenz-navy); color: var(--weiss); padding: 16px 24px; display: flex; align-items: center; gap: 12px; }
.chat-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gruen); flex-shrink: 0; }
.chat-head .dot.mock { background: #E9C46A; }
.chat-head .dot.off { background: var(--rot); }
.chat-head b { font-size: 15px; }
.chat-head small { color: rgba(255,255,255,0.55); margin-left: auto; font-size: 12px; }
.chat-body { padding: 24px; min-height: 340px; max-height: 480px; overflow-y: auto; background: var(--hell); }
.msg { max-width: 82%; margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { background: var(--oenz-rot); color: var(--weiss); margin-left: auto; border-bottom-right-radius: 4px; }
.msg.bot { background: var(--weiss); border: 1px solid var(--grau-hell); border-bottom-left-radius: 4px; }
.msg.bot.error { border-color: #F0D9A8; background: #FFF6E8; }
.msg .fact { border-left: 3px solid var(--oenz-navy-hell); padding-left: 10px; margin-bottom: 10px; }
.msg .fact b { color: var(--oenz-navy-hell); }
.msg .persp { border-left: 3px solid var(--gruen); padding-left: 10px; margin-top: 10px; }
.msg .persp b { color: var(--gruen); }
.chat-input { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--grau-hell); background: var(--weiss); }
.chat-input input { flex: 1; border: 1px solid #D6DDE4; border-radius: 10px; padding: 12px 14px; font-size: 14px; outline: none; }
.chat-input input:disabled { background: #F0F2F5; color: var(--grau); }
.chat-input input:focus { border-color: var(--oenz-navy-hell); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 16px; background: var(--weiss); }
.chip { background: #EEF2F6; color: var(--oenz-navy); border: none; border-radius: 16px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; }
.chip:hover { background: #E0E7EF; }
.note { font-size: 12px; color: var(--grau); padding: 0 24px 16px; background: var(--weiss); }

/* --- Fragebogen (geführter Einstieg) --- */
.fragebogen { background: var(--weiss); border: 1px solid var(--grau-hell); border-radius: 14px; padding: 18px 22px !important; max-width: 92%; }
.fb-intro { font-size: 14px; margin-bottom: 14px; }
.fb-block { margin-bottom: 14px; }
.fb-block label { display: block; font-size: 12.5px; font-weight: 700; color: var(--oenz-navy); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.fb-block small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--grau); }
.fb-options { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-options button { background: var(--weiss); border: 2px solid var(--grau-hell); border-radius: 999px; padding: 6px 16px; font-size: 13.5px; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.fb-options button:hover { border-color: var(--oenz-navy-hell); }
.fb-options button.selected { background: var(--oenz-rot); color: var(--weiss); border-color: var(--oenz-rot); font-weight: 700; }
.fb-actions { display: flex; gap: 10px; margin-top: 16px; }
.fb-actions .btn { font-size: 14px; padding: 10px 20px; }
.fb-actions .btn:disabled { opacity: 0.5; cursor: default; }

/* --- Markdown-Antworten lesbar --- */
.msg.bot { max-width: 92%; }
.msg.bot .md-h { margin: 14px 0 6px; font-size: 16px; color: var(--oenz-navy); }
.msg.bot .md-h:first-child { margin-top: 0; }
.msg.bot .md-p { margin: 6px 0; }
.msg.bot .md-ul { margin: 6px 0 6px 20px; }
.msg.bot .md-ul li { margin: 3px 0; }
.msg.bot .md-hr { border: none; border-top: 1px solid var(--grau-hell); margin: 12px 0; }
.msg.bot .md-table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 13px; }
.msg.bot .md-table td { border: 1px solid var(--grau-hell); padding: 6px 10px; vertical-align: top; }
.msg.bot .md-table tr:nth-child(even) td { background: var(--hell); }
.msg.bot code { background: #F0EFF4; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.msg.bot em { color: var(--grau); }
.msg.bot .beleg { display: inline-block; font-size: 11px; color: var(--oenz-navy-hell); background: #E8EDF6; border-radius: 6px; padding: 1px 7px; margin-left: 4px; white-space: normal; }
#printDoc .beleg { background: none; border: 1px solid #999; color: #000; }

/* --- Vollbild: echtes Fullscreen-Overlay --- */
.chat-vollbtn { position: absolute; top: 10px; right: 12px; background: none; border: none; font-size: 15px; cursor: pointer; color: var(--grau); }
.chat-wrap { position: relative; }
body.chat-vollbild { overflow: hidden; }
body.chat-vollbild .chat-wrap {
  position: fixed; inset: 0; z-index: 1000;
  max-width: none; width: 100%; margin: 0;
  background: var(--hell);
  display: flex; flex-direction: column;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
body.chat-vollbild .chat-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--oenz-navy);
  margin: 0 24px;
  border-radius: 0 0 12px 12px;
}
body.chat-vollbild .chat-body {
  flex: 1; max-height: none; overflow-y: auto;
  margin: 16px auto 8px; width: 100%; max-width: 1100px;
  padding: 0 24px;
}
body.chat-vollbild .chat-input {
  position: sticky; bottom: 0;
  background: var(--hell);
  padding: 12px 24px 16px;
  max-width: 1100px; margin: 0 auto; width: 100%;
}
body.chat-vollbild .chips, body.chat-vollbild .note { max-width: 1100px; margin: 10px auto 0; padding: 0 24px; }
body.chat-vollbild .chat-vollbtn { position: fixed; top: 12px; right: 20px; z-index: 1001; font-size: 18px; color: #fff; }

/* --- Chatbot-Seite: Hinweis & Anleitung --- */
.pw-hinweis {
  background: var(--weiss); border-radius: 14px; padding: 22px 26px;
  box-shadow: 0 2px 10px rgba(37,31,71,0.06);
  font-size: 14.5px; line-height: 1.7; margin-bottom: 26px;
  border-left: 6px solid var(--oenz-rot);
}
details.pw-anleitung {
  background: var(--weiss); border-radius: 14px;
  box-shadow: 0 2px 10px rgba(37,31,71,0.06);
  overflow: hidden; margin-bottom: 30px;
}
details.pw-anleitung summary {
  cursor: pointer; padding: 16px 22px; font-weight: 800;
  color: var(--oenz-navy); list-style: none;
}
details.pw-anleitung summary::-webkit-details-marker { display: none; }
details.pw-anleitung summary:hover { background: var(--hell); }
.pw-anleitung-inhalt { padding: 6px 22px 20px; font-size: 14.5px; line-height: 1.7; }
.pw-anleitung-inhalt p { margin: 10px 0; }
.pw-anleitung-inhalt ul { margin: 6px 0 14px 22px; }
.pw-anleitung-inhalt li { margin: 4px 0; }
.pw-merke { background: var(--hell); border-radius: 10px; padding: 12px 16px; margin-top: 16px !important; }

/* --- Konsortium --- */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 36px; }
.agent { background: var(--weiss); border-radius: 14px; padding: 22px; text-align: center; box-shadow: 0 2px 10px rgba(37,31,71,0.06); }
.agent .badge { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--weiss); }
.badge-green { background: var(--gruen); }
.badge-red { background: #C0392B; }
.badge-orange { background: #E67E22; }
.badge-grey { background: #7F8C8D; }
.agent h3 { font-size: 15px; }
.agent p { font-size: 12.5px; color: var(--grau); margin-top: 4px; }
.agent .status { background: #E8F5F0; color: var(--gruen); font-weight: 600; font-size: 11px; padding: 3px 10px; border-radius: 10px; margin-top: 10px; display: inline-block; border: none; }
.agent .status.soon { background: #F0F2F5; color: var(--grau); }

footer { background: var(--oenz-navy); color: rgba(255,255,255,0.5); padding: 40px; text-align: center; font-size: 13px; }
.footer-meta { margin-top: 8px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  nav { display: none; }
  .btn.secondary { margin-left: 0; margin-top: 10px; }
  .chat-input { flex-direction: column; }
  .chat-input .btn { padding: 12px 18px; }
  .msg { max-width: 100%; }
  section { padding: 50px 20px; }
  header { padding: 14px 20px; }
  .hero { padding: 60px 20px 70px; }
}

/* --- Antwort-Ebenen als Karten (Faktenebene / Perspektivebene / Nächster Schritt) --- */
.msg.bot .ebene { border: 1px solid var(--grau-hell); border-radius: 12px; padding: 10px 14px 6px; margin: 10px 0; background: #FBFCFE; }
.msg.bot .ebene-head { display: inline-block; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 3px 12px; border-radius: 999px; color: var(--weiss); margin-bottom: 6px; }
.msg.bot .ebene-fakt .ebene-head { background: var(--oenz-navy-hell); }
.msg.bot .ebene-fakt { border-left: 4px solid var(--oenz-navy-hell); }
.msg.bot .ebene-persp .ebene-head { background: var(--gruen); }
.msg.bot .ebene-persp { border-left: 4px solid var(--gruen); }
.msg.bot .ebene-next .ebene-head { background: var(--oenz-rot); }
.msg.bot .ebene-next { border-left: 4px solid var(--oenz-rot); }

/* --- Fragebogen: Textfelder --- */
.fb-text { width: 100%; border: 1px solid #D6DDE4; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none; }
.fb-text:focus { border-color: var(--oenz-navy-hell); }

/* --- Export-Button im Chat-Header --- */
.chat-exportbtn { background: rgba(255,255,255,0.12); color: var(--weiss); border: 1px solid rgba(255,255,255,0.35); border-radius: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.chat-exportbtn:hover:not(:disabled) { background: var(--oenz-rot); border-color: var(--oenz-rot); }
.chat-exportbtn:disabled { opacity: 0.45; cursor: default; }
.chat-head small { margin-left: auto; }
.chat-head .chat-exportbtn { margin-left: 10px; }

/* --- Export-Aktionen unter dem Entwurf --- */
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; white-space: normal; }

/* --- PDF-Export über Druckdialog --- */
#printDoc { display: none; }
@media print {
  body.print-export > *:not(#printDoc) { display: none !important; }
  body.print-export #printDoc { display: block; padding: 0 10mm; color: #000; font-size: 12pt; line-height: 1.5; }
  body.print-export #printDoc .md-h { color: #000; }
  body.print-export #printDoc .ebene { border: 1px solid #999; }
  body.print-export #printDoc .ebene-head { color: #000; background: none; border: 1px solid #999; }
  body.print-export #printDoc .md-table td { border: 1px solid #999; }
}

/* --- Chat-Seite: schlichtes, weißes Interface (ungebrandet, kein ÖNZ-Design) --- */
body.chat-page { background: #FFFFFF; }
body.chat-page header { background: #FFFFFF; color: #111827; border-bottom: 1px solid #E5E7EB; padding: 12px 24px; }
body.chat-page .logo { color: #111827; font-size: 16px; }
body.chat-page .logo-mark { background: #111827; width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
body.chat-page .logo-sub { font-weight: 400; color: #6B7280; font-size: 13px; margin-left: 6px; }
body.chat-page nav a { color: #4B5563; }
body.chat-page nav a:hover { color: #111827; }
body.chat-page .chat-main { max-width: 880px; margin: 0 auto; padding: 24px 20px 60px; }
body.chat-page .chat-wrap { margin-top: 0; border: 1px solid #E5E7EB; box-shadow: 0 1px 4px rgba(17,24,39,0.06); border-radius: 16px; }
body.chat-page .chat-head { background: #FFFFFF; color: #111827; border-bottom: 1px solid #E5E7EB; padding: 12px 18px; }
body.chat-page .chat-head small { color: #6B7280; }
body.chat-page .chat-body { background: #FFFFFF; max-height: 62vh; min-height: 380px; padding: 20px; }
body.chat-page .msg.bot { background: #F5F6F8; border: none; color: #111827; }
body.chat-page .msg.user { background: #111827; }
body.chat-page .msg.bot.error { background: #FEF3F2; border: 1px solid #FCA5A5; }
body.chat-page .chat-input { background: #FFFFFF; border-top: 1px solid #E5E7EB; }
body.chat-page .chat-input input { border-color: #D1D5DB; }
body.chat-page .chat-input input:focus { border-color: #111827; }
body.chat-page .btn { background: #111827; padding: 12px 22px; }
body.chat-page .btn:hover { background: #000000; }
body.chat-page .note { background: #FFFFFF; color: #9CA3AF; }
body.chat-page .fragebogen { border-color: #E5E7EB; }
body.chat-page .fb-options button.selected { background: #111827; border-color: #111827; }
body.chat-page .fb-block label { color: #111827; }
body.chat-page .fb-text:focus { border-color: #111827; }
body.chat-page .chat-exportbtn { background: #F5F6F8; color: #111827; border-color: #D1D5DB; }
body.chat-page .chat-exportbtn:hover:not(:disabled) { background: #111827; color: #FFFFFF; border-color: #111827; }
body.chat-page .ebene { background: #FAFAFB; }
body.chat-page .ebene-fakt .ebene-head { background: #374151; }
body.chat-page .ebene-fakt { border-left-color: #6B7280; }
body.chat-page .ebene-persp .ebene-head { background: #047857; }
body.chat-page .ebene-next .ebene-head { background: #111827; }
body.chat-page .ebene-next { border-left-color: #111827; }
body.chat-page .beleg { background: #EEF0F3; color: #4B5563; }
body.chat-page .export-actions .chip { background: #FFFFFF; border: 1px solid #D1D5DB; color: #111827; }
body.chat-page .export-actions .chip:hover { background: #F5F6F8; }
body.chat-page .chat-vollbtn { color: #6B7280; }
body.chat-vollbild { background: #FFFFFF; }
body.chat-page.chat-vollbild .chat-head { background: #FFFFFF; color: #111827; margin: 0; border-radius: 0; border-bottom: 1px solid #E5E7EB; }
body.chat-page.chat-vollbild .chat-vollbtn { color: #111827; }
body.chat-page.chat-vollbild .chat-body { background: #FFFFFF; }
body.chat-page.chat-vollbild .chat-input { background: #FFFFFF; }

/* --- Login --- */
body.chat-page .org-label { color: #6B7280; font-size: 13px; margin-right: 8px; }
.login-wrap { max-width: 420px; margin: 40px auto 0; }
.login-form { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #111827; }
.login-form input { border: 1px solid #D1D5DB; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: inherit; outline: none; }
.login-form input:focus { border-color: #111827; }
.login-form .btn { margin-top: 8px; }
.login-error { color: #B91C1C; font-size: 13px; min-height: 18px; }

/* --- Chat-App: Hero im Democracy-AI-Design, darunter Chat vollflächig --- */
body.chat-app { background: var(--hell); display: flex; flex-direction: column; min-height: 100vh; }
.hero-chat { text-align: left; padding: 48px 40px 36px; flex-shrink: 0; }
.hero-chat h1 { font-size: 34px; margin-bottom: 10px; }
.hero-chat p { margin-bottom: 0; font-size: 15.5px; }

.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 24px;
  min-height: 0;
}

/* Orga-Pill im Header */
.org-pill { background: var(--oenz-rot); color: var(--weiss); border-radius: 999px; padding: 5px 16px; font-weight: 800; font-size: 13px; margin-right: 14px; letter-spacing: 0.3px; }
.pill-btn { background: rgba(255,255,255,0.12); color: var(--weiss); border: 1px solid rgba(255,255,255,0.35); border-radius: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-left: 14px; }
.pill-btn:hover { background: var(--oenz-rot); border-color: var(--oenz-rot); }

/* Linke Spalte: Archiv + Dokumente */
.archiv { background: var(--weiss); border-radius: 16px; padding: 18px; box-shadow: 0 2px 10px rgba(37,31,71,0.06); overflow-y: auto; min-height: 0; }
.archiv h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--grau); margin: 18px 0 8px; }
.archiv h3:first-of-type { margin-top: 14px; }
.archiv-neu { width: 100%; font-size: 14px; padding: 11px 16px; }
.archiv-hinweis { font-size: 12px; color: var(--grau); margin: -2px 0 8px; }
.chat-list, .doc-list { list-style: none; margin: 0; padding: 0; }
.chat-item, .doc-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.chat-item:hover, .doc-item:hover { background: var(--hell); }
.chat-item.aktiv { background: var(--oenz-tint); font-weight: 700; }
.chat-titel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-del { background: none; border: none; cursor: pointer; font-size: 13px; opacity: 0.5; padding: 2px 4px; }
.chat-del:hover { opacity: 1; }
.doc-item { cursor: default; }
.doc-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status { font-size: 12px; color: var(--grau); margin: 8px 0; min-height: 16px; }

/* Chat füllt den Rest des Fensters (automatisch "Vollbild" unter dem Hero) */
body.chat-app .chat-wrap { margin-top: 0; display: flex; flex-direction: column; min-height: 0; height: 100%; }
body.chat-app .chat-head { flex-shrink: 0; }
body.chat-app .chat-body { flex: 1; max-height: none; min-height: 200px; }
body.chat-app .chat-input { flex-shrink: 0; }
body.chat-app .note { flex-shrink: 0; }

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .archiv { order: 2; }
  body.chat-app .chat-wrap { height: 70vh; }
}


/* ---------- AID-Design (Stone/Indigo, wie AidOnboardingMockup v1.2) ---------- */

body.chat-app { --stone-50:#FAFAF9; --stone-100:#F5F5F4; --stone-200:#E7E5E4; --stone-300:#D6D3D1; --stone-400:#A8A29E; --stone-500:#78716C; --stone-700:#57534E; --stone-800:#44403C; --stone-900:#1C1917; --indigo-50:#EEF2FF; --indigo-100:#E0E7FF; --indigo-400:#818CF8; --indigo-600:#4F46E5; --indigo-700:#4338CA; --indigo-900:#312E81; --emerald-50:#ECFDF5; --emerald-300:#6EE7B7; --emerald-600:#059669; background: var(--stone-100); }

body.chat-app header { background: var(--stone-50); color: var(--stone-900); border-bottom: 1px solid var(--stone-200); padding: 10px 20px; }
body.chat-app .logo { color: var(--stone-900); font-size: 15px; }
body.chat-app .logo-mark { background: #A71D31; width: 26px; height: 26px; font-size: 13px; border-radius: 999px; }
body.chat-app nav a { color: var(--stone-500); }
body.chat-app nav a:hover { color: var(--indigo-700); }
body.chat-app .org-pill { background: var(--indigo-50); color: var(--indigo-700); border: 1px solid var(--indigo-100); }
body.chat-app .pill-btn { background: var(--stone-50); color: var(--stone-500); border: 1px solid var(--stone-300); }
body.chat-app .pill-btn:hover { border-color: var(--indigo-400); color: var(--indigo-700); }

/* Kompakter Mockup-Kopf */
.hero-chat { text-align: left; padding: 20px 20px 6px; flex-shrink: 0; }
.hero-chat-in { max-width: 1040px; margin: 0 auto; width: 100%; }
.hero-chat h1 { font-size: 22px; margin: 2px 0 4px; }
.hero-chat h1 span { color: inherit; }
.hero-chat p { margin-bottom: 0; font-size: 13px; color: var(--stone-500); max-width: 620px; }
body.chat-app .aid-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--indigo-700); }
body.chat-app .hero-chat .kicker { display: none; }

/* Schmale, zentrierte Spalte statt gestrecktem Vollbild-Fenster */
.app-layout { max-width: 1040px; margin: 0 auto; width: 100%; padding: 0 20px 40px; gap: 16px; grid-template-columns: 240px minmax(0, 1fr); }
body.chat-app .archiv { background: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 16px; padding: 14px; align-self: start; }
body.chat-app .archiv h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--stone-400); }
body.chat-app .chat-wrap { max-width: 700px; justify-self: center; width: 100%; background: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 20px; box-shadow: 0 1px 3px rgba(28,25,23,0.06); overflow: hidden; margin-top: 0; }
body.chat-app .chat-head { background: var(--stone-50); color: var(--stone-900); border-bottom: 1px solid var(--stone-200); padding: 10px 16px; }
body.chat-app .chat-head b { font-size: 14px; }
body.chat-app .chat-head small { color: var(--stone-400); font-weight: 600; }
body.chat-app .chat-exportbtn { background: var(--stone-50); color: var(--stone-700); border: 1px solid var(--stone-300); border-radius: 999px; }
body.chat-app .chat-exportbtn:hover:not(:disabled) { background: var(--indigo-600); color: #fff; border-color: var(--indigo-600); }
body.chat-app .chat-body { background: var(--stone-100); min-height: 460px; max-height: 58vh; padding: 18px; }
body.chat-app .chat-input { background: var(--stone-50); border-top: 1px solid var(--stone-200); padding: 12px 16px; }
body.chat-app .note { background: var(--stone-50); color: var(--stone-400); border-top: none; padding: 0 16px 12px; font-size: 11px; }
body.chat-app .btn { background: var(--indigo-600); border-radius: 999px; }
body.chat-app .btn:hover { background: var(--indigo-700); }
body.chat-app .chat-input input { border-radius: 999px; border-color: var(--stone-300); }

/* Bubbles wie im Mockup: AID links mit Avatar, User rechts indigo-getönt */
body.chat-app .msg { border: none; border-radius: 16px; font-size: 14px; line-height: 1.6; max-width: 92%; }
body.chat-app .msg.bot { background: #fff; box-shadow: 0 1px 2px rgba(28,25,23,0.07); padding: 12px 16px; border-top-left-radius: 4px; position: relative; margin-left: 40px; }
body.chat-app .msg.bot::before { content: 'AID'; position: absolute; left: -40px; top: 0; width: 30px; height: 30px; border-radius: 999px; background: var(--indigo-600); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; letter-spacing: 0.04em; }
body.chat-app .msg.user { background: var(--indigo-50); color: var(--indigo-900); margin-left: auto; border-top-right-radius: 4px; padding: 10px 16px; box-shadow: 0 1px 2px rgba(28,25,23,0.05); }
body.chat-app .msg.bot.error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
body.chat-app .md-h { color: var(--stone-900); }

/* Fortschrittskarte im Mockup-Stil: Kopf + 4 Segmente + Annahmen/Plan-Chips */
.ob-progress { background: var(--stone-50); border-bottom: 1px solid var(--stone-200); padding: 10px 16px; }
.ob-kopf { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 8px; }
.ob-taktinfo { font-weight: 600; color: var(--stone-800); }
.ob-prozent { font-size: 11px; color: var(--stone-400); }
.ob-segzeile { display: flex; gap: 6px; }
.ob-seg { flex: 1; }
.ob-segbar { height: 8px; border-radius: 999px; transition: background 0.2s; }
.ob-segbar.offen { background: var(--stone-200); }
.ob-segbar.aktiv { background: var(--indigo-400); }
.ob-segbar.fertig { background: var(--indigo-600); }
.ob-seglabel { text-align: center; font-size: 10px; color: var(--stone-400); margin-top: 3px; font-weight: 600; }
.ob-unterzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ob-annahmen { font-size: 11px; font-weight: 700; color: #B45309; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 999px; padding: 2px 10px; }
.ob-planzeile { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ob-plan { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--stone-200); color: var(--stone-500); }
.ob-plan.aktiv { background: var(--indigo-600); color: #fff; }
.ob-plan.fertig { background: var(--emerald-300); color: #064E3B; }

/* Onboarding-Karten: StepIntro-Look, Chips, WNI */
body.chat-app .fragebogen { background: #fff; border: 1px solid var(--stone-200); border-radius: 16px; box-shadow: 0 1px 2px rgba(28,25,23,0.06); max-width: 100%; margin-left: 40px; }
body.chat-app .fb-titel { font-size: 10.5px; letter-spacing: 0.12em; color: var(--indigo-700); }
body.chat-app .fb-why { background: var(--indigo-50); border: 1px solid var(--indigo-100); border-left: 3px solid var(--indigo-600); border-radius: 12px; font-size: 13px; color: var(--stone-700); }
body.chat-app .fb-why b { color: var(--indigo-800); }
body.chat-app .fb-block label { color: var(--stone-800); font-size: 12px; }
body.chat-app .fb-block small { color: var(--stone-400); }
body.chat-app .fb-options button { border-radius: 999px; border: 1.5px solid var(--stone-300); background: #fff; color: var(--stone-700); font-size: 13px; padding: 6px 14px; }
body.chat-app .fb-options button:hover { border-color: var(--indigo-400); color: var(--indigo-700); }
body.chat-app .fb-options button.selected { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; font-weight: 700; box-shadow: 0 1px 2px rgba(79,70,229,0.3); }
body.chat-app .fb-options.multi button.selected { background: var(--indigo-600); border-color: var(--indigo-600); }
body.chat-app .fb-options button.wn-chip { border-style: dashed; color: var(--stone-400); }
body.chat-app .fb-options button.wn-chip.selected { background: var(--stone-400); border-color: var(--stone-400); color: #fff; }
body.chat-app .wn-btn { background: var(--stone-50); border: 1.5px dashed var(--stone-300) !important; color: var(--stone-500); border-radius: 999px; }
body.chat-app .wn-btn:hover { border-color: var(--indigo-400) !important; color: var(--indigo-700); }
body.chat-app .fb-hinweis-wn { color: var(--stone-400); font-size: 11.5px; }
body.chat-app .fb-text { border-radius: 10px; }
body.chat-app .fb-text:focus { border-color: var(--indigo-400); }
body.chat-app .ebene { background: var(--stone-50); }
body.chat-app .ebene-fakt .ebene-head { background: var(--stone-700); }
body.chat-app .ebene-persp .ebene-head { background: var(--emerald-600); }
body.chat-app .ebene-next .ebene-head { background: var(--indigo-600); }

/* Vollbild-Modus an Design angleichen */
body.chat-app.chat-vollbild .chat-wrap { max-width: 1040px; }
body.chat-app.chat-vollbild .chat-body { max-height: none; height: calc(100vh - 240px); }

/* Responsive: Archiv nach unten */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  body.chat-app .archiv { order: 2; }
  body.chat-app .chat-wrap { order: 1; }
}


/* ---------- UI-Polish: Bildschirmfuellendes Tool-Layout, helle Flaeche mit Blau-Fade, CI-Pill ---------- */
/* Hero: kein Navy mehr - helles Grau mit leichtem Blau-Fade zur Abgrenzung */
.hero-chat { background: linear-gradient(180deg, #F2F6FB 0%, #EFF2F6 65%, #F5F5F4 100%) !important; text-align: left; padding: 10px 18px 6px; }
body.chat-app header { background: linear-gradient(180deg, #EDF2F9 0%, #F4F6F8 100%); border-bottom: 1px solid #E2E8F0; }
body.chat-app .logo { color: #A71D31; }
body.chat-app .logo-mark { background: #A71D31; }
body.chat-app nav a { color: #A71D31; }

/* Org-Pill: Standard in OeNZ-CI (rot/grau), in Org-Farbe sobald verfuegbar */
body.chat-app .org-pill { background: #FBF3F4; border: 1px solid #EFD3D8; color: #A71D31; }

/* AID-Pill im Text (CI) */
.aid-pill { display: inline-block; background: #A71D31; color: #FFFFFF; font-weight: 800; font-size: 11px; letter-spacing: 0.08em; border-radius: 999px; padding: 1px 9px; vertical-align: 1px; }
.msg.bot .aid-pill { background: #A71D31; }

/* Chatfenster als grosses Tool: Sidebar schmal, Chat nimmt den Rest */
.app-layout { grid-template-columns: 200px minmax(0, 1fr) ; gap: 12px; max-width: none; padding: 0 12px 12px; }
body.chat-app .archiv { padding: 10px; border-radius: 12px; }
body.chat-app .archiv h3 { font-size: 10px; margin: 8px 0 4px; }
body.chat-app .archiv-neu { font-size: 12px; padding: 7px 12px; }
body.chat-app .archiv-hinweis { font-size: 10.5px; }
body.chat-app .chat-wrap { max-width: none; border-radius: 12px; }
.app-layout.mit-draft { grid-template-columns: 190px minmax(0, 1fr) minmax(260px, 340px); }

/* Fragen dichter: eine Sektion pro Screen */
body.chat-app .msg { margin-bottom: 6px; font-size: 13.5px; line-height: 1.5; }
body.chat-app .fragebogen { padding: 10px 12px !important; margin-left: 38px; }
body.chat-app .msg.bot { margin-left: 38px; padding: 9px 13px; }
body.chat-app .msg.bot::before { left: -38px; width: 28px; height: 28px; }
body.chat-app .fb-intro { margin-bottom: 6px; font-size: 12.5px; }
body.chat-app .fb-why { padding: 7px 10px; margin-bottom: 8px; font-size: 12px; }
body.chat-app .fb-block { margin-bottom: 7px; }
body.chat-app .fb-block label { font-size: 11.5px; margin-bottom: 4px; }
body.chat-app .fb-options { gap: 5px; }
body.chat-app .fb-options button { font-size: 12px; padding: 4px 11px; }
body.chat-app .fb-actions { margin-top: 8px; gap: 6px; }
body.chat-app .fb-actions .btn { padding: 7px 14px; font-size: 12.5px; }
body.chat-app .fb-hinweis-wn { font-size: 10.5px; }
body.chat-app .wn-btn { font-size: 11px !important; padding: 4px 10px !important; margin-top: 4px; }
.ob-progress { padding: 6px 12px; }
.draft-kopf { padding: 8px 10px; }
.draft-btn { font-size: 11px; padding: 6px 10px; }
