.chester-shell {
  /* vonHanf neuer Look (Onepager v2) */
  --chester-ink: #1a1a1a;
  --chester-ink-soft: #55554e;
  --chester-paper: #fbfbfa;
  --chester-mist: #f3f3f3;
  --chester-line: #e6e6e4;
  --chester-muted: #8c8c8c;
  --chester-accent: #effd5f;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  max-width: 1180px;
  min-height: 680px;
  margin: 32px auto;
  border-radius: 28px;
  overflow: hidden;
  background: var(--chester-paper);
  box-shadow: 0 22px 90px rgba(26, 26, 26, .16);
  color: var(--chester-ink);
  font-family: inherit;
}

.chester-side {
  background: radial-gradient(circle at 0 0, rgba(239, 253, 95, .16), transparent 46%), var(--chester-ink);
  color: #fff;
  padding: 38px;
}

.chester-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 72px;
}

.chester-brand-mark,
.chester-avatar,
.chester-mini-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--chester-accent);
  color: var(--chester-ink);
  font-weight: 700;
}

.chester-brand-mark { width: 44px; height: 44px; border: 1px solid rgba(26, 26, 26, .25); }
.chester-brand strong, .chester-brand small { display: block; }
.chester-brand small { color: #b4b4af; font-size: 12px; }
.chester-side h2 { margin: 0 0 16px; color: #fff; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.chester-side p { color: #d9d9d5; line-height: 1.65; }
.chester-side ul { margin: 34px 0 0; padding-left: 20px; color: #cfcfca; line-height: 1.8; }
.chester-side li::marker { color: var(--chester-accent); }

.chester-chat {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-width: 0;
  min-height: 680px;
}

.chester-chat-header {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 28px;
  border-bottom: 1px solid var(--chester-line);
}

.chester-avatar { width: 42px; height: 42px; }
/* Bot-Avatar je Nachricht: dunkel, damit das Gelb Marke/Aktion vorbehalten bleibt */
.chester-mini-avatar { flex: 0 0 auto; width: 30px; height: 30px; font-size: 13px; background: var(--chester-ink); color: #fff; }
.chester-chat-header strong, .chester-chat-header small { display: block; }
.chester-chat-header small { margin-top: 3px; color: var(--chester-ink-soft); font-size: 12px; }
.chester-reset { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--chester-muted); cursor: pointer; font-size: 22px; }
.chester-reset:hover { background: var(--chester-mist); }

.chester-messages {
  overflow-y: auto;
  padding: 34px clamp(18px, 5vw, 54px);
}

.chester-message {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.chester-message.user { justify-content: flex-end; }

.chester-bubble {
  max-width: 680px;
  padding: 15px 18px;
  border-radius: 6px 18px 18px 18px;
  background: var(--chester-mist);
  color: var(--chester-ink);
  line-height: 1.6;
  font-size: 15px;
}

.chester-message.user .chester-bubble {
  background: var(--chester-ink);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}

.chester-bubble p { margin: 0 0 10px; }
.chester-bubble p:last-child { margin-bottom: 0; }
.chester-status {
  display: inline-flex;
  margin-top: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--chester-ink);
  color: var(--chester-accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.chester-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: #b4b4af;
  animation: chesterBlink 1s infinite;
}

.chester-typing span:nth-child(2) { animation-delay: .15s; }
.chester-typing span:nth-child(3) { animation-delay: .3s; }

.chester-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 clamp(18px, 5vw, 54px) 14px;
}

.chester-suggestions button {
  border: 1px solid var(--chester-line);
  background: var(--chester-paper);
  color: var(--chester-ink);
  padding: 9px 13px;
  border-radius: 99px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}

.chester-suggestions button:hover {
  background: var(--chester-accent);
  border-color: var(--chester-accent);
  color: var(--chester-ink);
}

.chester-form {
  position: relative;
  margin: 0 clamp(14px, 4vw, 42px) 22px;
}

.chester-form textarea {
  width: 100%;
  resize: none;
  max-height: 130px;
  border: 1px solid var(--chester-line);
  background: #fff;
  border-radius: 17px;
  padding: 16px 58px 16px 18px;
  outline: none;
  line-height: 1.4;
  color: var(--chester-ink);
}

.chester-form textarea:focus {
  border-color: var(--chester-ink);
  box-shadow: 0 0 0 3px rgba(239, 253, 95, .55);
}

.chester-form > button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 12px;
  background: var(--chester-accent);
  color: var(--chester-ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  transition: filter .15s;
}

.chester-form > button:hover { filter: brightness(.94); }

.chester-form > p {
  margin: 8px 0 0;
  text-align: center;
  color: var(--chester-muted);
  font-size: 11px;
}

.chester-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@keyframes chesterBlink {
  50% { opacity: .25; transform: translateY(-2px); }
}

@media (max-width: 820px) {
  .chester-shell { grid-template-columns: 1fr; margin: 16px auto; border-radius: 18px; }
  .chester-side { padding: 26px; }
  .chester-brand { margin-bottom: 30px; }
  .chester-chat, .chester-shell { min-height: 620px; }
}

/* ===== Schwebendes Chat-Fenster (Floating Bubble) ===== */
.chester-fab {
  --chester-ink: #1a1a1a;
  --chester-ink-soft: #55554e;
  --chester-paper: #fbfbfa;
  --chester-mist: #f3f3f3;
  --chester-line: #e6e6e4;
  --chester-muted: #8c8c8c;
  --chester-accent: #effd5f;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99990;
  font-family: inherit;
  color: var(--chester-ink);
}

.chester-fab-toggle {
  position: relative;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--chester-accent);
  color: var(--chester-ink);
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(26, 26, 26, .30);
  display: grid;
  place-items: center;
  transition: transform .15s, box-shadow .15s;
}
.chester-fab-toggle:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(26, 26, 26, .34); }
.chester-fab-toggle svg { width: 27px; height: 27px; display: block; }
.chester-fab-ico-close { display: none; font-size: 30px; line-height: 1; font-weight: 400; }
.chester-fab.is-open .chester-fab-ico-open { display: none; }
.chester-fab.is-open .chester-fab-ico-close { display: block; }

.chester-fab-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(384px, calc(100vw - 44px));
  height: min(560px, calc(100vh - 130px));
  background: var(--chester-paper);
  border: 1px solid var(--chester-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(26, 26, 26, .24);
  display: flex;
  flex-direction: column;
  animation: chesterFabIn .16s ease-out;
}
.chester-fab-panel[hidden] { display: none; }

/* Kompakte Chat-Spalte im Floating-Panel */
.chester-fab-panel .chester-chat {
  min-height: 0;
  height: 100%;
  width: 100%;
}
.chester-fab-panel .chester-chat-header { height: 66px; padding: 0 18px; }
.chester-fab-panel .chester-avatar { width: 36px; height: 36px; }
.chester-fab-panel .chester-messages { padding: 20px 18px; }
.chester-fab-panel .chester-bubble { font-size: 14px; padding: 12px 14px; }
.chester-fab-panel .chester-suggestions { padding: 0 16px 10px; }
.chester-fab-panel .chester-suggestions button { font-size: 12px; padding: 7px 11px; }
.chester-fab-panel .chester-form { margin: 0 16px 16px; }

@keyframes chesterFabIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .chester-fab { right: 14px; bottom: 14px; }
  .chester-fab-panel { right: 0; bottom: 70px; height: min(72vh, calc(100vh - 110px)); }
}
