/* =========================
   DIVY Chatbot – consolidated frontend styles
   Theme vars: <style id="divy-theme-vars"> on #chatWindow, #divyCtaWrap, …
   ========================= */

/* === Utilities === */
.display-none { display: none; }
.display-flex { display: flex; }

/* === Isolation from host page CSS === */
#chatWindow.divyWindow,
#divyCtaWrap,
#divyDevDock {
  font-family: var(--divy-font, Arial), sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#chatWindow.divyWindow *,
#divyCtaWrap * {
  box-sizing: border-box;
}

/* Rich HTML inside chat bubbles, disclaimer, welcome hint */
#chatWindow.divyWindow :is(
  .bot-message,
  .user-message,
  .divy-disclaimer-html,
  .chat-disclaimer-header,
  .disc-panel,
  .divy-end-session-panel,
  .divy-mic-required-panel,
  .divy-live-error-panel
) :is(
  p, span, div, li, ul, ol, dl, dt, dd,
  h1, h2, h3, h4, h5, h6,
  b, strong, em, i, u, s, del, ins, small, sub, sup,
  blockquote, cite, q, code, pre, kbd, samp, var,
  table, thead, tbody, tfoot, tr, th, td,
  figure, figcaption, address, mark, abbr, time, a
),
#divyCtaWrap .divy-hint-content :is(
  p, span, div, li, ul, ol, dl, dt, dd,
  h1, h2, h3, h4, h5, h6,
  b, strong, em, i, u, s, del, ins, small, sub, sup,
  blockquote, cite, q, code, pre, kbd, samp, var,
  table, thead, tbody, tfoot, tr, th, td,
  figure, figcaption, address, mark, abbr, time, a
) {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
  text-align: inherit;
  color: inherit;
  font-style: inherit;
  font-weight: inherit;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .chat-disclaimer-header, .disc-panel) :is(b, strong),
#divyCtaWrap .divy-hint-content :is(b, strong) {
  font-weight: 700 !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .chat-disclaimer-header, .disc-panel) :is(em, i),
#divyCtaWrap .divy-hint-content :is(em, i) {
  font-style: italic !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) :is(ul, ol),
#divyCtaWrap .divy-hint-content :is(ul, ol) {
  margin: 0.35rem 0 !important;
  padding-left: 1.25rem !important;
  list-style-position: outside !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) :is(ul),
#divyCtaWrap .divy-hint-content :is(ul) {
  list-style-type: disc !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) :is(ol),
#divyCtaWrap .divy-hint-content :is(ol) {
  list-style-type: decimal !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) li,
#divyCtaWrap .divy-hint-content li {
  margin: 0 !important;
  padding: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) p,
#divyCtaWrap .divy-hint-content p {
  margin: 0;
}

#chatWindow.divyWindow :is(.bot-message, .user-message, .divy-disclaimer-html, .disc-panel) p + p,
#divyCtaWrap .divy-hint-content p + p {
  margin-top: 0.35rem;
}

#chatWindow.divyWindow :is(button, input, textarea, select) {
  font-family: var(--divy-font, Arial), sans-serif !important;
  letter-spacing: normal;
  text-transform: none;
}

/* === CTA === */
.chat-cta {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.2s ease, opacity 0.28s ease;
}

.chat-cta img {
  height: 100px;
  transition: transform 0.3s ease;
}

.chat-cta img:hover {
  transform: scale(1.2);
}

.chat-cta.cta-hidden {
  opacity: 0;
  pointer-events: none;
}

/* === Chat shell === */
.chat-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* ==== Dynamische Farben ==== */
.divyWindow .chat-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 1rem;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background-color: var(--divy-header);
  color: var(--divy-header-font, #fff);
  font-family: var(--divy-font, Arial), sans-serif;
}

.chat-logo-link {
  display: inline-flex;
  flex-shrink: 0;
  margin-right: 10px;
  line-height: 0;
  text-decoration: none;
}

.chat-logo {
  height: 50px;
}

.chat-title {
  font-weight: 700;
  color: var(--divy-chat-title-color, var(--divy-header-font, #fff));
  font-size: 1.2em;
}

.divyWindow .chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background-color: #f9f9f9;
  font-family: var(--divy-font, Arial), sans-serif;
}

/* Scroll-Lock, solange Disclaimer nicht akzeptiert */
.divyWindow .chat-body.disc-locked {
  overflow: hidden;
}

.divyWindow .bot-message {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 15px;
  margin-bottom: 10px;
  cursor: default;
  box-sizing: border-box;
  background-color: var(--divy-bot);
  color: var(--divy-bot-font, #fff);
  font-family: var(--divy-font, Arial), sans-serif;
}

.divyWindow .chat-body.has-bot-message-icon {
  --divy-bot-icon-slot: calc(2rem + 0.5rem);
  display: grid;
  grid-template-columns: var(--divy-bot-icon-slot) minmax(0, 1fr);
  column-gap: 0.5rem;
  row-gap: 10px;
  align-items: start;
}

.divyWindow .chat-body.has-bot-message-icon > .bot-message--welcome,
.divyWindow .chat-body.has-bot-message-icon > .bot-message[data-divy-welcome="1"] {
  grid-column: 2;
  justify-self: start;
  margin-left: 0;
  margin-bottom: 0;
}

.divyWindow .chat-body.has-bot-message-icon > .user-message {
  grid-column: 2;
  justify-self: end;
  margin-left: 0;
  margin-bottom: 0;
}

.divyWindow .chat-body.has-bot-message-icon > .bot-message:not(.bot-message--welcome):not([data-divy-welcome="1"]) {
  grid-column: 2;
  justify-self: start;
  margin-bottom: 0;
}

.divyWindow .chat-body.has-bot-message-icon .bot-message-row {
  display: contents;
}

.divyWindow .chat-body.has-bot-message-icon .bot-message-icon {
  grid-column: 1;
  align-self: start;
  justify-self: end;
  position: static;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.divyWindow .chat-body.has-bot-message-icon .bot-message-row .bot-message {
  grid-column: 2;
  justify-self: start;
  margin-bottom: 0;
}

.divyWindow .user-message {
  display: inline-block;
  align-self: flex-end;
  margin-left: auto;
  padding: 10px 15px;
  border-radius: 15px;
  margin-bottom: 10px;
  box-sizing: border-box;
  background-color: var(--divy-user);
  color: var(--divy-user-font, #fff);
  font-family: var(--divy-font, Arial), sans-serif;
}

/* Links in Nachrichten */
#chatWindow.divyWindow .bot-message a,
#chatWindow.divyWindow .bot-message a:visited,
#chatWindow.divyWindow .user-message a,
#chatWindow.divyWindow .user-message a:visited,
#chatWindow.divyWindow .chat-link,
#chatWindow.divyWindow .chat-link:visited {
  font-family: inherit !important;
  font-size: inherit !important;
  color: var(--divy-link-color, var(--divy-header)) !important;
  text-decoration: underline;
}
#chatWindow.divyWindow .bot-message a:hover,
#chatWindow.divyWindow .bot-message a:focus,
#chatWindow.divyWindow .user-message a:hover,
#chatWindow.divyWindow .user-message a:focus,
#chatWindow.divyWindow .chat-link:hover,
#chatWindow.divyWindow .chat-link:focus {
  color: var(--divy-link-color, var(--divy-header)) !important;
  text-decoration: underline;
  filter: brightness(1.08);
}

.divyWindow .chat-message-box {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.75rem;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  background-color: var(--divy-box);
  font-family: var(--divy-font, Arial), sans-serif;
}

#chatWindow.divyWindow .chat-link {
  transition: color 0.3s ease, text-decoration 0.3s ease, filter 0.3s ease;
}

.chat-header-controls {
  position: relative;
  z-index: 70;
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}
.chat-icon-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.125em;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}

.chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chat-icon-btn .chat-control-icon,
.chat-close-btn .chat-control-icon {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
  background-color: var(--divy-control-icon, #ffffff);
  -webkit-mask-image: var(--icon-src);
  mask-image: var(--icon-src);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.divyWindow .chat-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.divyWindow .chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Fenstergröße (per CSS-Variablen / Resize) */
.divyWindow .chat-container {
  --divy-chat-header-h: 5.125em;
  container-type: inline-size;
  container-name: divy-chat;
}

.divyWindow:not(.is-fullscreen) .chat-container {
  width: var(--divy-chat-w, 32rem) !important;
  height: var(--divy-chat-h, 640px) !important;
  max-width: calc(100vw - (var(--divy-offset, 20px) * 2));
  max-height: calc(100vh - (var(--divy-offset, 20px) * 2));
  position: relative; /* wichtig für Overlay + Resize-Handle */
}

.divyWindow.is-resizing,
.divyWindow.is-resizing .chat-container {
  transition: none !important;
  user-select: none;
}

/* Vollbild */
.divyWindow.is-fullscreen {
  top: var(--divy-offset, 12px) !important;
  right: var(--divy-offset, 12px) !important;
  bottom: var(--divy-offset, 12px) !important;
  left: var(--divy-offset, 12px) !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
}

.divyWindow.is-fullscreen .chat-container {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.divyWindow.is-fullscreen .divy-resize-handles {
  display: none;
}

/* Fullscreen enter/exit animation */
.divyWindow.is-layout-animating {
  pointer-events: none;
  transition: none !important;
}

.divyWindow.is-layout-animating .chat-container {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

/* Resize-Griffe: obere Kante, Seitenkante, Ecke */
.divy-resize-handles {
  position: absolute;
  inset: 0;
  z-index: 65;
  pointer-events: none;
}

.divy-resize-handle {
  position: absolute;
  touch-action: none;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: auto;
}

.chat-container:hover .divy-resize-handle,
.divyWindow.is-resizing .divy-resize-handle {
  opacity: 1;
}

/* Obere Kante (Höhe) */
.divy-resize-handle--top {
  top: 0;
  height: 8px;
  margin-top: -3px;
  cursor: ns-resize;
}

.divyWindow[data-side="right"] .divy-resize-handle--top {
  left: 18px;
  right: 0;
}

.divyWindow[data-side="left"] .divy-resize-handle--top {
  left: 0;
  right: 18px;
}

/* Seitenkante (Breite): links bei data-side=right, rechts bei data-side=left */
.divy-resize-handle--side {
  top: 18px;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}

.divyWindow[data-side="right"] .divy-resize-handle--side {
  left: 0;
  margin-left: -3px;
}

.divyWindow[data-side="left"] .divy-resize-handle--side {
  right: 0;
  left: auto;
  margin-right: -3px;
}



/* Ecke (Breite + Höhe) */
.divy-resize-handle--corner {
  width: 18px;
  height: 18px;
  top: 0;
}


.divyWindow[data-side="right"] .divy-resize-handle--corner {
  left: 0;
  cursor: nwse-resize;
}

.divyWindow[data-side="left"] .divy-resize-handle--corner {
  right: 0;
  left: auto;
  cursor: nesw-resize;
}

.divyWindow[data-side="left"] .divy-resize-handle--corner::before {
  transform: rotate(90deg);
  border-right: 2px solid rgba(15, 23, 42, 0.35);
  border-left: none;
}

/* Eingabe mit Zeichenzähler */
.chat-input-stack {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.5rem;
  row-gap: 4px;
  align-items: stretch;
}

.chat-input-stack .chat-input-row {
  display: contents;
}

.chat-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 0;
}

.chat-input-wrap {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  box-sizing: border-box;
}

.chat-input-field {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: var(--divy-chat-input-min-h, calc(0.6em + 0.6em + (2 * 1.35em)));
  box-sizing: border-box;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-input-field.has-accent-icon .chat-input-main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.chat-input-main {
  width: 100%;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.divy-accent-icon {
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.chat-input-accent-icon {
  width: 27px;
  height: 27px;
  margin: 0.65em 0 0 0.75em;
  align-self: flex-start;
}

.chat-input-field.has-accent-icon .chat-textarea {
  flex: 1;
  min-width: 0;
  padding-left: 0.45rem;
}

.chat-input-field .chat-textarea {
  background: transparent;
  border-radius: 0;
}

.divy-hint-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.divy-hint-accent-icon {
  width: 28px;
  height: 28px;
  margin-top: 1px;
}

.divy-hint.has-accent-icon {
  padding-left: 12px;
}

.chat-extras {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 0 4px;
  font-size: 0.68em;
  line-height: 1.25;
  color: var(--divy-chat-title-color, var(--divy-header-font, #fff));
  pointer-events: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
  font-family: var(--divy-font, Arial), sans-serif;
  box-sizing: border-box;
  min-width: 0;
}

.chat-input-counter {
  flex: 0 0 auto;
  color: inherit;
}

.chat-input-counter.is-near-limit {
  color: rgba(180, 83, 9, 0.88);
}

.chat-input-counter.is-at-limit {
  color: rgba(185, 28, 28, 0.92);
  font-weight: 600;
}

/* Auto-grow Textarea (default: 2 lines) */
.chat-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--divy-chat-input-min-h, calc(0.6em + 0.6em + (2 * 1.35em)));
  height: auto;
  resize: none;
  padding: .6rem .9rem;
  border: none;
  border-radius: 0;
  font-size: 1em;
  font-family: var(--divy-font, Arial), sans-serif;
  line-height: 1.35;
  overflow-y: auto;
  background: transparent;
  color: #111;
}
.chat-textarea:focus { outline: none; }

.chat-textarea::placeholder {
  color: #888;
}

.chat-send-button img {
  height: 22px;
  width: 22px;
  display: block;
}

.divy-turnstile-wrap {
  position: absolute;
  inset: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(1px);
  box-sizing: border-box;
}

.divy-turnstile-wrap .cf-turnstile {
  max-width: 100%;
}

.divy-turnstile-hint {
  margin: 0;
  font-size: 0.84em;
  line-height: 1.35;
  text-align: center;
  color: #fff;
}

.divy-turnstile-wrap.needs-attention {
  box-shadow: inset 0 0 0 2px rgba(211, 1, 69, 0.55);
}

.divy-turnstile-wrap.is-verified {
  display: none !important;
}

/* Session beenden: Bestätigung + Feedback */
.divy-end-session-overlay {
  position: absolute;
  inset: 0;
  z-index: 52;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
  border-radius: 20px;
}

.divy-end-session-overlay[hidden] {
  display: none !important;
}

/* Speech-to-Speech: no microphone */
.divy-mic-required-overlay {
  position: absolute;
  inset: 0;
  z-index: 53;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
  border-radius: 20px;
}

.divy-mic-required-overlay[hidden] {
  display: none !important;
}

.divy-mic-required-panel {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  color: #334155;
}

.divy-mic-required-title {
  margin: 0 0 0.5rem;
  font-size: 1.05em;
  font-weight: 650;
  color: #0f172a;
}

.divy-mic-required-text {
  margin: 0 0 1rem;
  font-size: 0.9em;
  line-height: 1.45;
  color: #64748b;
}

.divy-mic-required-actions {
  display: flex;
  justify-content: flex-end;
}

.divy-mic-required-close {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  background: #d30145;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.divy-mic-required-close:hover,
.divy-mic-required-close:focus {
  filter: brightness(1.05);
}

.divy-end-session-panel {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  color: #334155;
}

.divy-end-session-panel[hidden] {
  display: none !important;
}

.divy-end-session-title {
  margin: 0 0 0.5rem;
  font-size: 1.05em;
  font-weight: 650;
  color: #0f172a;
}

.divy-end-session-text {
  margin: 0 0 1rem;
  font-size: 0.9em;
  line-height: 1.45;
  color: #64748b;
}

.divy-end-session-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.divy-end-session-btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--divy-font, Arial), sans-serif;
}

.divy-end-session-btn--secondary {
  background: #e2e8f0;
  color: #334155;
}

.divy-end-session-btn--primary {
  background: var(--divy-header, #B89663);
  color: #fff;
}

.divy-end-session-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.divy-feedback-scale {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.divy-feedback-comment-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.85em;
  font-weight: 600;
  color: #475569;
}

.divy-feedback-comment {
  display: block;
  width: 100%;
  min-height: 5rem;
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9em;
  line-height: 1.4;
  font-family: var(--divy-font, Arial), sans-serif;
  color: #0f172a;
  resize: vertical;
  box-sizing: border-box;
}

.divy-feedback-comment:focus {
  outline: none;
  border-color: var(--divy-header, #B89663);
  box-shadow: 0 0 0 2px rgba(184, 150, 99, 0.25);
}

.divy-feedback-scale-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.divy-feedback-scale-btn.is-selected,
.divy-feedback-scale-btn:hover {
  border-color: var(--divy-header, #B89663);
  background: var(--divy-header, #B89663);
  color: #fff;
}

.divy-feedback-error {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.82em;
  color: #b91c1c;
  text-align: center;
}

.divy-feedback-thanks-text {
  margin: 0 0 1.15rem;
  text-align: center;
}

.divy-feedback-thanks-actions {
  justify-content: center;
}

/* Mic + Send button group */
.chat-action-buttons {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  align-self: stretch;
  gap: .5rem;
  flex: 0 0 auto;
  grid-column: 2;
  grid-row: 1;
}

.chat-mic-button,
.chat-send-button {
  width: 42px;
  min-width: 42px;
  height: auto;
  min-height: var(--divy-chat-input-min-h, calc(0.6em + 0.6em + (2 * 1.35em)));
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  align-self: stretch;
}

.chat-mic-button {
  font-size: 1.1em;
  line-height: 1;
}

.chat-mic-button .divy-speech-btn-icon {
  display: block;
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
}

.chat-mic-button.is-live-end-prominent .divy-speech-btn-icon {
  display: none;
}

.chat-mic-button:disabled,
.chat-mic-button.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-mic-button.is-live-connecting {
  animation: divy-mic-pulse 1s ease-in-out infinite;
}

.chat-mic-button.is-live-active {
  background: #d30145;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(211, 1, 69, 0.35);
}

.divy-live-end-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  align-self: stretch;
}

.divy-live-end-hint {
  display: none;
  margin: 0;
  max-width: 9.5rem;
  font-size: 0.78em;
  line-height: 1.35;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.chat-mic-button.is-live-end-prominent {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  width: auto;
  min-width: 5.75rem;
  min-height: 54px;
  padding: 0.45rem 0.9rem 0.4rem;
  font-size: 1.4em;
  line-height: 1;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 3px rgba(211, 1, 69, 0.45),
    0 6px 18px rgba(15, 23, 42, 0.28);
}

.chat-mic-button.is-live-end-prominent .divy-live-end-label {
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Live voice: replace text input with connecting / live status */
.chat-message-box.is-live-voice-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.5rem;
}

.chat-message-box.is-live-voice-active .divy-live-compose-status {
  grid-column: 1;
  grid-row: 1;
}

.chat-message-box.is-live-voice-active .chat-input-stack {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
}

.chat-message-box.is-live-voice-active .chat-input-wrap,
.chat-message-box.is-live-voice-active .chat-send-button,
.chat-message-box.is-live-voice-active .chat-extras {
  display: none !important;
}

.divy-live-compose-status {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
}

.chat-message-box.is-live-voice-active .divy-live-compose-status {
  display: flex;
}

.divy-live-compose-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #fff;
  max-width: 100%;
  text-align: center;
}

.divy-live-compose-text {
  margin: 0;
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  max-width: 16rem;
}

.chat-message-box.is-live-voice-active .divy-live-compose-spinner .gemini-loader-container {
  background: transparent;
  padding: 0;
  margin: 0;
  width: auto;
}

.divy-live-voice-orb {
  display: none;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  isolation: isolate;
}

.chat-message-box.is-live-voice-live .divy-live-voice-orb {
  display: block;
}

.chat-message-box.is-live-voice-connecting .divy-live-voice-orb {
  display: none;
}

.divy-live-voice-orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  z-index: 1;
  transform:
    scale(var(--divy-mic-ring-scale, 1))
    scaleX(var(--divy-mic-ring-scale-x, 1))
    scaleY(var(--divy-mic-ring-scale-y, 1))
    rotate(var(--divy-mic-ring-rotate, 0deg));
  transition:
    transform 80ms linear,
    opacity 120ms ease-out,
    box-shadow 120ms ease-out;
  will-change: transform;
}

.divy-live-voice-orb .divy-mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  box-sizing: border-box;
  transform-origin: center;
  border: 2px solid rgba(255, 255, 255, 0.35);
  opacity: 0.65;
  transform:
    scale(var(--divy-mic-ring-scale, 1))
    scaleX(var(--divy-mic-ring-scale-x, 1))
    scaleY(var(--divy-mic-ring-scale-y, 1))
    rotate(var(--divy-mic-ring-rotate, 0deg));
  box-shadow: 0 0 0 var(--divy-mic-ring-spread, 0px) rgba(255, 255, 255, var(--divy-mic-ring-alpha, 0.25));
  transition:
    transform 80ms linear,
    opacity 140ms ease-out,
    box-shadow 90ms linear,
    border-color 160ms ease-out;
  will-change: transform, box-shadow, opacity;
}

.divy-live-voice-orb .divy-mic-ring--outer {
  inset: -12px;
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.22);
  opacity: 0;
  box-shadow: none;
  transform:
    scale(var(--divy-mic-ring-outer-scale, 1))
    rotate(calc(var(--divy-mic-ring-wobble, 0deg) * -1.4));
  transition:
    transform 70ms linear,
    opacity 110ms ease-out,
    border-color 160ms ease-out;
}

.divy-live-voice-orb.is-mic-ring-idle .divy-mic-ring {
  border-color: rgba(255, 255, 255, 0.4);
  opacity: 0.7;
}

.divy-live-voice-orb.is-mic-ring-idle .divy-mic-ring--outer {
  opacity: 0;
}

.divy-live-voice-orb.is-mic-ring-user .divy-mic-ring {
  border-color: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

.divy-live-voice-orb.is-mic-ring-user .divy-mic-ring--outer {
  border-color: rgba(255, 255, 255, 0.7);
  opacity: var(--divy-mic-ring-outer-alpha, 0);
}

.divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring {
  border-color: rgba(255, 255, 255, 0.9);
  animation: divy-mic-bot-ring 1.1s ease-in-out infinite;
  transition: none;
}

.divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring--outer {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.55);
  animation: divy-mic-bot-ring-outer 1.1s ease-in-out infinite;
  transition: none;
}

.divy-live-voice-orb.is-mic-ring-bot .divy-live-voice-orb-core {
  animation: divy-mic-bot-core 1.1s ease-in-out infinite;
  transition: none;
}

@keyframes divy-mic-bot-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 0.72;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.34);
  }
}

@keyframes divy-mic-bot-ring-outer {
  0%, 100% {
    transform: scale(1.05);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.55;
  }
}

@keyframes divy-mic-bot-core {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .divy-live-voice-orb .divy-mic-ring,
  .divy-live-voice-orb .divy-mic-ring--outer,
  .divy-live-voice-orb-core {
    transition: none;
  }

  .divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring,
  .divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring--outer,
  .divy-live-voice-orb.is-mic-ring-bot .divy-live-voice-orb-core {
    animation: none;
  }

  .divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring {
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.38);
  }

  .divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring--outer {
    opacity: 0;
  }
}

.chat-message-box.is-live-voice-live .divy-live-compose-spinner {
  display: none;
}

/* Speech-to-Speech: scrollable debug error dialog */
.divy-live-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.divy-live-error-panel {
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.divy-live-error-title {
  margin: 0;
  padding: 1rem 1.25rem 0.5rem;
  font-size: 1.05em;
  font-weight: 600;
  color: #111;
}

.divy-live-error-body {
  margin: 0;
  padding: 0.75rem 1.25rem;
  flex: 1 1 auto;
  overflow: auto;
  font-size: 0.8em;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1e293b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  max-height: 60vh;
}

.divy-live-error-actions {
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  justify-content: flex-end;
}

.divy-live-error-close {
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  background: #d30145;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.divy-speech-marker {
  font-size: 0.75em;
  opacity: 0.75;
  font-weight: 600;
}

@keyframes divy-mic-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* === Typing indicator === */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 15px;
  background-color: #f1f1f1;
  border-radius: 15px;
  width: fit-content;
  margin: auto;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: #d30145;
  border-radius: 50%;
  animation: divy-typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0s; }

@keyframes divy-typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* === Gemini loader === */
.gemini-loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 16px;
  width: fit-content;
  margin: auto;
}

.gemini-dots-group {
  position: relative;
  width: 40px;
  height: 40px;
  animation: gemini-group-rotate 2.5s infinite ease-in-out;
}

.gemini-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #d30145;
  border-radius: 50%;
}

.gemini-dot:nth-child(1) { animation: gemini-dot1 2.5s infinite ease-in-out; }
.gemini-dot:nth-child(2) { animation: gemini-dot2 2.5s infinite ease-in-out; }
.gemini-dot:nth-child(3) { animation: gemini-dot3 2.5s infinite ease-in-out; }

@keyframes gemini-dot1 {
  0%   { left: 7px;  top: 17px; transform: translateY(0); }
  8%   { left: 7px;  top: 17px; transform: translateY(-8px); }
  16%  { left: 7px;  top: 17px; transform: translateY(0); }
  25%  { left: 7px;  top: 17px; transform: translateY(0); }
  40%  { left: 17px; top: 2px;  transform: translateY(0); }
  75%  { left: 17px; top: 2px;  transform: translateY(0); }
  90%  { left: 7px;  top: 17px; transform: translateY(0); }
  100% { left: 7px;  top: 17px; transform: translateY(0); }
}

@keyframes gemini-dot2 {
  0%   { left: 17px; top: 17px; transform: translateY(0); }
  5%   { left: 17px; top: 17px; transform: translateY(0); }
  13%  { left: 17px; top: 17px; transform: translateY(-8px); }
  21%  { left: 17px; top: 17px; transform: translateY(0); }
  25%  { left: 17px; top: 17px; transform: translateY(0); }
  40%  { left: 4px;  top: 24px; transform: translateY(0); }
  75%  { left: 4px;  top: 24px; transform: translateY(0); }
  90%  { left: 17px; top: 17px; transform: translateY(0); }
  100% { left: 17px; top: 17px; transform: translateY(0); }
}

@keyframes gemini-dot3 {
  0%   { left: 27px; top: 17px; transform: translateY(0); }
  10%  { left: 27px; top: 17px; transform: translateY(0); }
  18%  { left: 27px; top: 17px; transform: translateY(-8px); }
  26%  { left: 27px; top: 17px; transform: translateY(0); }
  40%  { left: 30px; top: 24px; transform: translateY(0); }
  75%  { left: 30px; top: 24px; transform: translateY(0); }
  90%  { left: 27px; top: 17px; transform: translateY(0); }
  100% { left: 27px; top: 17px; transform: translateY(0); }
}

@keyframes gemini-group-rotate {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(0deg); }
  80%  { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

/* Narrow chat: icons top-right, title row uses full width beside logo */
@container divy-chat (max-width: 400px) {
  .divyWindow .chat-header {
    flex-wrap: wrap;
    align-items: center;
    padding-top: calc(24px + 0.5rem);
    --divy-chat-header-h: 6.75em;
  }

  .divyWindow .chat-header-controls {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    margin-left: 0;
    gap: 2px;
  }

  .divyWindow #chatFullscreenBtn,
  .divyWindow #chatMinimizeBtn,
  .divyWindow .chat-close-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
  }

  .divyWindow #chatFullscreenBtn .chat-control-icon,
  .divyWindow #chatMinimizeBtn .chat-control-icon,
  .divyWindow .chat-close-btn .chat-control-icon {
    width: 14px;
    height: 14px;
  }

  .divyWindow .chat-logo {
    flex-shrink: 0;
  }

  .divyWindow .chat-title {
    flex: 1 1 0;
    min-width: 0;
    font-size: 1em;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
}

/* Narrow chat: stack mic above send so input gets more width */
@container divy-chat (max-width: 420px) {
  .chat-action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
  @media (max-width: 480px) {
    .divyWindow .chat-action-buttons {
      flex-direction: column;
      align-items: stretch;
    }
  }
}

/* === CTA + Hinweis (Hinweis absolut, kein Layout-Shift) === */
.divy-cta-wrap {
  display: inline-block;
  position: relative;
  opacity: 1;
  visibility: visible !important;
  pointer-events: none;
  transition: opacity .28s ease, transform .18s ease, visibility 0s;
  vertical-align: middle;
}

.divy-cta-wrap.is-fixed {
  position: fixed;
  bottom: var(--divy-offset, 20px);
  z-index: 2147483647 !important;
}

.divy-cta-wrap.is-inline {
  z-index: auto;
}

.divy-cta-wrap > * {
  pointer-events: auto;
}

/* Bildschirm-Ecke nur bei fixiertem CTA (data-side = Chatfenster-Seite) */
.divy-cta-wrap.is-fixed[data-side="right"] {
  right: var(--divy-offset, 20px);
  left: auto;
}

.divy-cta-wrap.is-fixed[data-side="left"] {
  left: var(--divy-offset, 20px);
  right: auto;
}

.divy-cta-wrap.cta-hidden {
  opacity: 0;
  visibility: hidden !important;
  transform: scale(.98);
  pointer-events: none !important;
}

.divy-hint {
  position: absolute;
  z-index: 5;
  width: max-content;
  max-width: min(320px, calc(100vw - 150px));
  padding: 10px 38px 10px 14px;
  background: var(--divy-hint-bg, #fff);
  color: var(--divy-hint-text, #1f2937);
  font-family: var(--divy-font, Arial), sans-serif;
  font-size: 0.95em;
  line-height: 1.35;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
  pointer-events: none;
  white-space: normal;
}

.divy-hint.is-visible {
  pointer-events: auto;
}

.divy-hint-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}

.divy-hint-dismiss:hover,
.divy-hint-dismiss:focus-visible {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  outline: none;
}

.divy-hint-dismiss:active {
  transform: scale(0.96);
}

.divy-hint-dismiss-icon {
  display: block;
  width: 14px;
  height: 14px;
  pointer-events: none;
  background-color: currentColor;
  -webkit-mask-image: var(--divy-hint-dismiss-icon);
  mask-image: var(--divy-hint-dismiss-icon);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.divy-hint-content {
  min-width: 0;
  color: var(--divy-hint-text, #1f2937);
}

#divyCtaWrap .divy-hint-content :is(
  p, span, div, li, ul, ol, dl, dt, dd,
  h1, h2, h3, h4, h5, h6,
  b, strong, em, i, u, s, del, ins, small, sub, sup,
  blockquote, cite, q, code, pre, kbd, samp, var,
  table, thead, tbody, tfoot, tr, th, td,
  figure, figcaption, address, mark, abbr, time
) {
  color: inherit !important;
}

#divyCtaWrap .divy-hint-content a,
#divyCtaWrap .divy-hint-content a:visited {
  font-family: inherit !important;
  font-size: inherit !important;
  color: var(--divy-header, #6366f1) !important;
  text-decoration: underline;
}

.divy-cta-wrap[data-hint-position="left"] .divy-hint {
  right: calc(100% + 14px);
  top: 50%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%) translateX(8px) scale(0.97);
}

.divy-cta-wrap[data-hint-position="left"] .divy-hint.is-visible {
  transform: translateY(-50%) translateX(0) scale(1);
}

.divy-cta-wrap[data-hint-position="right"] .divy-hint {
  left: calc(100% + 14px);
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translateY(-50%) translateX(-8px) scale(0.97);
}

.divy-cta-wrap[data-hint-position="right"] .divy-hint.is-visible {
  transform: translateY(-50%) translateX(0) scale(1);
}

.divy-cta-wrap[data-hint-position="top"] .divy-hint {
  bottom: calc(100% + 14px);
  left: 50%;
  top: auto;
  right: auto;
  transform: translateX(-50%) translateY(8px) scale(0.97);
}

.divy-cta-wrap[data-hint-position="top"] .divy-hint.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

.divy-cta-wrap[data-hint-position="bottom"] .divy-hint {
  top: calc(100% + 14px);
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
}

.divy-cta-wrap[data-hint-position="bottom"] .divy-hint.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

.divy-hint.is-visible:not(.is-dismissed) {
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, transform .28s ease, visibility 0s;
}

#chatCallToAction.chat-cta {
  z-index: 1;
}

/* Airbag: falls irgendwo per Utility fälschlich display:none gesetzt wird */
#chatCallToAction.display-none {
  display: flex !important;
}

/* === Backdrop (Overlay) === */
#divyBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.38);
  z-index: 2147483645;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
#divyBackdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .28s ease, visibility 0s;
}

/* === Drawer/Chatfenster – rein/raus schieben (mit sauberem Slide-Out) === */
.divyWindow {
  position: fixed;
  bottom: var(--divy-offset, 20px);
  z-index: 2147483646; /* über Overlay, unter CTA */
  will-change: transform, opacity;
  transform: translate3d(120%,0,0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .28s ease, opacity .28s ease, visibility 0s linear .28s;
}

/* Window Seite über data-side steuern */
.divyWindow[data-side="right"] { right: var(--divy-offset, 20px); left: auto; }
.divyWindow[data-side="left"]  { left: var(--divy-offset, 20px); right: auto; transform: translate3d(-120%,0,0); }

.divyWindow.is-open {
  transform: translate3d(0,0,0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform .28s ease, opacity .28s ease, visibility 0s;
}
/* während des Schließens sichtbar lassen, bis Transition fertig ist */
.divyWindow.is-closing {
  visibility: visible;
  pointer-events: none;
}

/* Lange Nachrichten sicher umbrechen */
.divyWindow .bot-message,
.divyWindow .user-message {
  max-width: 90%;
  white-space: pre-wrap; /* overridden to normal by JS when message contains block HTML */
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Lists in bubbles: allow normal wrapping (not pre-wrap) */
.divyWindow .bot-message ul,
.divyWindow .bot-message ol,
.divyWindow .user-message ul,
.divyWindow .user-message ol {
  white-space: normal !important;
}

/* ===== Debug-Dock: neben dem Chatfenster ===== */
#divyDevDock {
  position: fixed;
  bottom: var(--divy-offset, 20px);
  z-index: 2147483648;
  width: 28rem;
  max-height: 750px;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden;
}

/* Dock Seite über data-side steuern */
#divyDevDock[data-side="left"] {
  left: calc(var(--divy-offset, 20px) + var(--divy-chat-w, 32rem) + var(--divy-gap, 16px));
  right: auto;
}
#divyDevDock[data-side="right"] {
  right: calc(var(--divy-offset, 20px) + var(--divy-chat-w, 32rem) + var(--divy-gap, 16px));
  left: auto;
}

#divyDevDock header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
}
#divyDevDock .dock-body {
  padding: 10px;
  max-height: calc(var(--divy-chat-h, 640px) - 60px - 12px - 12px);
  overflow: auto;
}
#divyDevDock #dbgRawJson {
  margin: 10px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #0b1220;
  color: #e5e7eb;
}

.kv { margin: 6px 10px; }
.small { font-size: 0.75em; opacity: .9; }
.ok { color: #34d399; }
.warn { color: #fbbf24; }
.err { color: #f87171; }

/* Fallback: bei schmalen Screens unter den Chat stapeln */
@media (max-width: 1350px) {
  #divyDevDock[data-side="left"] {
    left: var(--divy-offset, 20px);
    right: auto;
    bottom: calc(var(--divy-offset, 20px) + var(--divy-chat-h, 640px) + var(--divy-gap, 16px));
    width: calc(100vw - (var(--divy-offset, 20px) * 2));
    max-height: 50vh;
  }
  #divyDevDock[data-side="right"] {
    right: var(--divy-offset, 20px);
    left: auto;
    bottom: calc(var(--divy-offset, 20px) + var(--divy-chat-h, 640px) + var(--divy-gap, 16px));
    width: calc(100vw - (var(--divy-offset, 20px) * 2));
    max-height: 50vh;
  }
}

/* Bewegungen respektieren */
@media (prefers-reduced-motion: reduce) {
  .divy-cta-wrap,
  #divyBackdrop,
  .divyWindow,
  .divy-hint { transition: none !important; }
}

/* Mobile page scroll lock (class applied by JS on touch/narrow viewports) */
html.divy-page-scroll-lock,
body.divy-page-scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.divy-page-scroll-lock {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  touch-action: none;
}

/* Edge-to-edge fullscreen chat (JS adds .divy-mobile-layout on real phones) */
.divyWindow.divy-mobile-layout.is-open,
.divyWindow.divy-mobile-layout.is-closing {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
}

.divyWindow.divy-mobile-layout.is-open {
  transform: translate3d(0, 0, 0) !important;
  display: flex;
  flex-direction: column;
}

.divyWindow.divy-mobile-layout:not(.is-open) {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translate3d(0, 100%, 0) !important;
}

.divyWindow.divy-mobile-layout.is-fullscreen {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
}

.divyWindow.divy-mobile-layout.is-open .chat-container,
.divyWindow.divy-mobile-layout.is-closing .chat-container,
.divyWindow.divy-mobile-layout.is-fullscreen .chat-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

.divyWindow.divy-mobile-layout .chat-header {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.divyWindow.divy-mobile-layout .chat-message-box {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

.divyWindow.divy-mobile-layout .divy-resize-handles,
.divyWindow.divy-mobile-layout #chatFullscreenBtn {
  display: none !important;
}

/* === BRUTAL ROBUST: Overlay-Kill Vorrang-Klasse === */
#divyBackdrop.force-hidden,
#divyBackdrop[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===== SCHÖNER DISCLAIMER IM OVERLAY ===== */

/* Consent-Overlay nur unterhalb des Headers (Header-Icons bleiben frei) */
#divyConsentOverlay {
  position: absolute;
  top: var(--divy-chat-header-h, 5.125em);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  background: radial-gradient(circle at top, rgba(15,23,42,.55), rgba(15,23,42,.85));
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 1.2rem;
  backdrop-filter: blur(6px);
}
#divyConsentOverlay.is-accepted {
  display: none;
  pointer-events: none;
}

#divyConsentOverlay .chat-disclaimer-panel {
  margin: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  overflow: auto;

  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.5);
  box-shadow:
    0 18px 45px rgba(15,23,42,.45),
    0 0 0 1px rgba(148,163,184,0.15);

  padding: 1.2rem 1.4rem 1.4rem;
  font-size: 0.9em;
  color: #334155;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  animation: divyConsentIn .25s ease-out;
}

@keyframes divyConsentIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-disclaimer-header {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  border-bottom: 1px solid rgba(148,163,184,0.35);
  padding-bottom: .6rem;
  margin-bottom: .1rem;
}

.chat-disclaimer-header strong {
  display: block;
  font-size: 1.02em;
  font-weight: 650;
  margin: 0;
  color: #0f172a;
}
.chat-disclaimer-header p,
.chat-disclaimer-header .divy-disclaimer-html {
  margin: 0;
  font-size: 0.86em;
  color: #64748b;
}

.disc-accordion {
  border-top: 0;
  padding: .35rem 0;
}

.disc-header {
  width: 100%;
  padding: .35rem 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  color: #0f172a;
  transition: color .18s ease;
}
.disc-header span.disc-arrow {
  font-size: 1.1em;
  transition: transform .18s ease, opacity .18s ease;
  opacity: .7;
}
.disc-accordion.open .disc-header span.disc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}
.disc-header:hover {
  color: var(--divy-header);
}

.disc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
}
.disc-panel p,
.disc-panel .divy-disclaimer-html {
  font-size: 0.84em;
  margin: .15rem 0 .35rem;
  color: #475569;
}

#chatWindow.divyWindow .divy-disclaimer-html a,
#chatWindow.divyWindow .divy-disclaimer-html a:visited {
  font-family: inherit !important;
  font-size: inherit !important;
  color: var(--divy-link-color, var(--divy-header, #6366f1)) !important;
  text-decoration: underline;
}
#discAcceptBtn {
  margin-top: .4rem;
  width: 100%;
  padding: .8rem 1rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--divy-header), var(--divy-bot));
  color: var(--divy-bot-font, #fff);
  font-size: 0.9em;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 10px 25px rgba(15,23,42,.25);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
#discAcceptBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: 0 6px 16px rgba(15,23,42,.16);
}
#discAcceptBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15,23,42,.28);
  filter: brightness(1.03);
}
#discAcceptBtn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(15,23,42,.24);
}

.divy-disc-accept-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  user-select: none;
}

.divy-disc-accept-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  cursor: pointer;
  accent-color: var(--divy-header, #6366f1);
}

.divy-disc-accept-checkbox-text {
  flex: 1;
  min-width: 0;
  font-size: 0.78em;
  line-height: 1.45;
  color: #334155;
}

.divy-disc-accept-checkbox-text p {
  margin: 0;
}

.divy-disc-accept-checkbox-text p + p {
  margin-top: 0.65rem;
}

.chat-disclaimer-panel.needs-accept {
  box-shadow:
    0 0 0 2px var(--divy-header),
    0 18px 45px rgba(15,23,42,.45);
}

@media (max-width: 480px) {
  .divyWindow .chat-title {
    font-size: 1em;
  }

  #divyConsentOverlay { padding: .8rem; }
  #divyConsentOverlay .chat-disclaimer-panel {
    padding: 1rem 1.1rem 1.2rem;
    border-radius: 12px;
  }

  .chat-icon-btn {
    width: 25px;
    height: 25px;
  }

  .chat-icon-btn .chat-control-icon, .chat-close-btn .chat-control-icon {
    width: 13px;
    height: 13px;
  }
}

/* Optional: deaktivierter Speech-Button Styling */
#chatSpeechBtn.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================
   Page mode – embedded Gemini-style landing + in-DOM chat
   ========================================================= */

.divy-page-root {
  --divy-page-accent: var(--divy-user, #d30145);
  --divy-page-text: #2d3232;
  --divy-page-muted: #8b8f97;
  position: relative;
  width: 100%;
  min-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  font-family: var(--divy-font, Arial), sans-serif;
  color: var(--divy-page-text);
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--divy-page-accent) 14%, transparent) 0%, transparent 70%),
    #fbfbfc;
  overflow: hidden;
}

.divy-page-landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem 1.25rem 3rem;
  box-sizing: border-box;
  transition: opacity .22s ease, transform .22s ease;
}

.divy-page-root.is-conversation-active .divy-page-landing {
  display: none;
}

.divy-page-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 46rem;
  text-align: left;
}

.divy-page-logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 50%;
}

.divy-page-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--divy-page-text);
}

.divy-page-composer {
  width: 100%;
  max-width: var(--divy-page-content-max-width, 42rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.divy-page-composer-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  box-sizing: border-box;
  background: #fff;
  border-radius: 999px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.08);
  --divy-page-composer-line-height: 1.4;
}

.divy-page-composer-inner.has-accent-icon .divy-page-accent-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.divy-page-composer-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  line-height: var(--divy-page-composer-line-height, 1.4);
  color: var(--divy-page-text);
  max-height: 7.5rem;
  padding: 0;
  margin: 0;
  display: block;
  overflow-y: hidden;
  box-sizing: border-box;
  align-self: center;
}

.divy-page-composer-input::placeholder {
  color: #a0a4ab;
}

.divy-page-composer-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.divy-page-composer-send,
.divy-page-composer-mic {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.divy-page-composer-send img,
.divy-page-composer-mic img,
.divy-page-composer-mic .divy-speech-btn-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
}

.divy-page-composer-send:hover,
.divy-page-composer-mic:hover {
  background: color-mix(in srgb, var(--divy-page-accent) 10%, transparent);
}

.divy-page-disclaimer {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--divy-page-muted);
}

.divy-page-composer-footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.divy-page-composer-footer .divy-page-disclaimer {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.divy-page-composer-footer .chat-input-counter,
.divy-page-chat .divy-page-chat-disclaimer .chat-input-counter {
  display: block;
  flex: 0 0 auto;
  align-self: flex-start;
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--divy-page-muted, #8b8f97);
  pointer-events: none;
  user-select: none;
}

.divy-page-composer-footer .chat-input-counter.is-near-limit,
.divy-page-chat .divy-page-chat-disclaimer .chat-input-counter.is-near-limit {
  color: rgba(180, 83, 9, 0.88);
}

.divy-page-composer-footer .chat-input-counter.is-at-limit,
.divy-page-chat .divy-page-chat-disclaimer .chat-input-counter.is-at-limit {
  color: rgba(185, 28, 28, 0.92);
  font-weight: 600;
}

.divy-page-root .divyWindow.divy-page-chat {
  position: relative;
  inset: auto;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  transform: none !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  box-shadow: none;
  background: transparent;
}

.divy-page-root.is-conversation-active .divyWindow.divy-page-chat {
  display: flex;
}

.divy-page-root .divyWindow.divy-page-chat .chat-container {
  width: 100% !important;
  height: min(78vh, 720px) !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.divy-page-root .divyWindow.divy-page-chat .divy-resize-handles,
.divy-page-root .divyWindow.divy-page-chat #chatFullscreenBtn,
.divy-page-root .divyWindow.divy-page-chat #chatMinimizeBtn {
  display: none !important;
}

.divy-page-chat .chat-header {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.divy-page-chat .chat-message-box {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 0;
}

.divy-page-content-column {
  width: 100%;
  max-width: var(--divy-page-content-max-width, none);
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

.divy-page-chat-body-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: var(--divy-page-body-shell-bg, #f9f9f9);
  overflow: hidden;
}

.divy-page-chat-body-shell > .divy-page-content-column {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-inline: 0;
}

.divy-page-chat .divy-page-chat-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  background-color: transparent;
}

.divy-page-chat .chat-message-box > .divy-page-input-column {
  padding-block: 1rem 1.25rem;
}

.divy-page-chat .divy-page-chat-input-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  box-sizing: border-box;
  background: #fff;
  border-radius: 999px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.08);
  --divy-page-composer-line-height: 1.4;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-wrap {
  position: static;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 0;
  grid-column: auto;
  grid-row: auto;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-field {
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
  min-width: 0;
  background: transparent;
  border-radius: 0;
  min-height: 0;
  overflow: visible;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-field.has-accent-icon .chat-input-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-main {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-accent-icon,
.divy-page-chat .divy-page-chat-input-stack .divy-page-accent-icon {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  align-self: center;
}

.divy-page-chat .divy-page-chat-input-stack .chat-textarea,
.divy-page-chat .divy-page-chat-input-stack .divy-page-composer-input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  line-height: var(--divy-page-composer-line-height, 1.4);
  color: var(--divy-page-text, #2d3232);
  max-height: 7.5rem;
  resize: none;
  display: block;
  overflow-y: hidden;
  box-sizing: border-box;
  align-self: center;
}

.divy-page-chat .divy-page-chat-input-stack .chat-textarea::placeholder,
.divy-page-chat .divy-page-chat-input-stack .divy-page-composer-input::placeholder {
  color: #a0a4ab;
}

.divy-page-chat .divy-page-chat-input-stack .chat-input-field.has-accent-icon .chat-textarea {
  padding-left: 0;
}

.divy-page-chat .divy-page-chat-input-stack .chat-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  align-self: center;
  grid-column: auto;
  grid-row: auto;
}

.divy-page-chat .divy-page-chat-input-stack .chat-send-button,
.divy-page-chat .divy-page-chat-input-stack .chat-mic-button {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  flex: 0 0 auto;
  align-self: center;
}

.divy-page-chat .divy-page-chat-input-stack .chat-send-button {
  order: 1;
}

.divy-page-chat .divy-page-chat-input-stack .chat-mic-button {
  order: 2;
}

.divy-page-chat .divy-page-chat-input-stack .chat-send-button img,
.divy-page-chat .divy-page-chat-input-stack .chat-mic-button .divy-speech-btn-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
}

.divy-page-chat .divy-page-chat-input-stack .chat-send-button:hover,
.divy-page-chat .divy-page-chat-input-stack .chat-mic-button:hover {
  background: color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 10%, transparent);
}

.divy-page-chat .divy-page-chat-disclaimer {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--divy-page-muted, #8b8f97);
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0;
  pointer-events: none;
  padding: 0 20px;
}

.divy-page-chat .divy-page-chat-disclaimer > span:first-child {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.divy-page-chat .chat-message-box.is-live-voice-active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.divy-page-chat .chat-message-box.is-live-voice-active > .divy-page-input-column {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-compose-status {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-compose-text {
  color: var(--divy-page-muted, #8b8f97);
  max-width: 18rem;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-voice-orb-core {
  background: var(--divy-page-accent, var(--divy-user, #d30145));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 28%, transparent);
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-voice-orb .divy-mic-ring {
  border-color: color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 40%, transparent);
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-voice-orb.is-mic-ring-user .divy-mic-ring {
  border-color: color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 85%, #fff);
  box-shadow: 0 0 0 var(--divy-mic-ring-spread, 2px)
    color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 45%, transparent);
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-live-voice-orb.is-mic-ring-bot .divy-mic-ring {
  border-color: color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 80%, #fff);
  animation-name: divy-mic-bot-ring-page;
}

@keyframes divy-mic-bot-ring-page {
  0%, 100% {
    transform: scale(1);
    opacity: 0.72;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 22%, transparent);
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--divy-page-accent, var(--divy-user, #d30145)) 34%, transparent);
  }
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-input-stack {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: auto;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-input-stack .chat-input-row {
  flex: 0 0 auto;
  min-width: 0;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-input-stack .chat-input-wrap,
.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-input-stack .chat-send-button,
.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-disclaimer {
  display: none !important;
}

.divy-page-chat .chat-message-box.is-live-voice-active .divy-page-chat-input-stack .chat-action-buttons {
  flex: 0 0 auto;
}

.divy-page-chat .chat-message-box .chat-input-stack {
  width: 100%;
}

@media (max-width: 640px) {
  .divy-page-root {
    min-height: 70vh;
    border-radius: 0;
  }

  .divy-page-hero {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .divy-page-logo {
    width: 3.75rem;
    height: 3.75rem;
  }

  .divy-page-composer-inner {
    border-radius: 1.35rem;
    padding-left: 0.9rem;
  }

  .divy-page-chat .divy-page-chat-input-stack .chat-input-row {
    border-radius: 1.35rem;
    padding-left: 0.9rem;
  }

  .divy-page-root .divyWindow.divy-page-chat .chat-container {
    height: min(82vh, 680px) !important;
    border-radius: 16px;
  }
}

/* ---------- Iframe-Embed (externe Website) ---------- */
.divy-embed-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  background: #fff;
}

.divy-embed-body #chatWindow.divy-embed-chat {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.divy-embed-body #chatWindow.divy-embed-chat .chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

.divy-embed-body #chatWindow.divy-embed-chat .chat-header {
  display: none;
}

.divy-embed-body #chatWindow.divy-embed-chat .chat-body {
  flex: 1;
  min-height: 0;
}

.divy-embed-body.divy-embed-host-maximized #chatWindow.divy-embed-chat .chat-container {
  border-radius: 0;
}
