/* BUNKM — the FAQ chat: dialog and corner button (shared by every page).

   14.10.2026 — until today the chat lived in bunkm.css and in index.html only, so it existed on
   one page. This file is the one place for its look; bunkm-chat-seite.js builds the markup.

   It carries its own colours (the --bk-* values below) and its own reset, because the pages do
   not agree: bunkm.css names the paper --paper-solid, help-pages.css names it --paper, the text
   pages have neither — and help-pages.css resets `* { margin: 0 }`, which takes the browser's
   centring away from a modal dialog (the same slip as 02.10.2026, see bunkm.css `dialog`). */

.chat-dialog, .chat-fab {
  --bk-ink: #3a3228;
  --bk-mute: #7a6f62;
  --bk-line: rgba(90, 70, 50, .18);
  --bk-paper: #fff9f0;
  --bk-sand: #f3ebe0;
  --bk-teal: #3d7a7a;
  --bk-teal-dark: #2a5c5c;
  --bk-tint: #e8f2f2;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bk-ink);
}
.chat-dialog, .chat-dialog *, .chat-fab, .chat-fab * { box-sizing: border-box; }

.chat-dialog {
  border: 0; border-radius: 20px; padding: 0; margin: auto;
  max-width: 480px; width: 94vw; height: min(580px, 82vh); max-height: none;
  overflow: hidden;
  background: var(--bk-paper);
  box-shadow: 0 30px 80px rgba(40, 32, 24, .4);
}
.chat-dialog::backdrop { background: rgba(40, 32, 24, .55); }
.chat-dialog button, .chat-dialog input, .chat-dialog select { font-family: inherit; }
.chat-dialog p { margin: 0; }

.chat-shell {
  display: flex; flex-direction: column; height: min(580px, 82vh);
  position: relative;
}
.chat-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: rgba(255, 249, 240, .92); border: 0; width: 34px; height: 34px;
  border-radius: 50%; font-size: 17px; cursor: pointer; font-weight: 700; color: var(--bk-ink);
}
.chat-head {
  padding: 18px 48px 14px 20px;
  border-bottom: 1px solid var(--bk-line);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--bk-teal-dark);
}
.chat-log {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #fffdf8, var(--bk-sand));
}
.chat-bubble {
  max-width: 90%; padding: 12px 14px; border-radius: 14px;
  font-size: 16px; line-height: 1.45; font-weight: 600;
  white-space: pre-wrap;
}
.chat-bubble.bot {
  align-self: flex-start;
  background: #fff; border: 1px solid var(--bk-line);
  color: var(--bk-ink);
}
.chat-bubble.me {
  align-self: flex-end;
  background: var(--bk-teal-dark); color: #fff;
}
/* the guided part: the buttons under the last bubble (topics, questions, "← Zurück") */
.chat-opts { align-self: stretch; display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.chat-opt {
  width: 100%; text-align: left;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.3;
  padding: 10px 12px; border: 1px solid var(--bk-line); border-left: 3px solid var(--bk-teal);
  border-radius: 10px; background: #fff; color: var(--bk-ink); cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.chat-opt:hover { background: var(--bk-tint); border-color: var(--bk-teal); transform: translateX(2px); }
.chat-opt.chat-hot { color: var(--bk-teal-dark); background: var(--bk-tint); font-weight: 800; }
.chat-back {
  align-self: flex-start; margin-top: 4px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--bk-mute);
  padding: 7px 14px; border: 1px solid var(--bk-line); border-radius: 999px;
  background: rgba(255, 255, 255, .7); cursor: pointer;
}
.chat-back:hover:not(:disabled) { background: #fff; color: var(--bk-ink); }
.chat-back:disabled { opacity: .4; cursor: default; }


/* the button in the corner: green, white rim, text only */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 2000;
  display: inline-flex; align-items: center;
  font: inherit; font-size: 15px; font-weight: 800; line-height: 1.2;
  padding: 11px 18px; border: 2px solid #fff; border-radius: 999px;
  background: var(--bk-teal-dark); color: #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(40, 32, 24, .32);
  transition: transform .12s, box-shadow .12s;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(40, 32, 24, .38); }
.chat-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--bk-teal-dark); }
@media (max-width: 560px) { .chat-fab { right: 12px; bottom: 12px; padding: 10px 15px; } }
