.fk-chat-root {
  --fk-chat-primary: #1e73be;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: inherit;
}

/* ── Toggle-Button ─────────────────────────────────────────────────────────── */

.fk-chat-root--open .fk-chat-toggle {
  display: none !important;
}

.fk-chat-toggle {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--fk-chat-primary) !important;
  color: #fff !important;
  width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.fk-chat-toggle:hover {
  transform: scale(1.07) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .25) !important;
}

.fk-chat-toggle svg {
  display: block;
  flex-shrink: 0;
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */

.fk-chat-root--closed .fk-chat-panel {
  display: none !important;
}

.fk-chat-panel {
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 80vh;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.fk-chat-header {
  background: var(--fk-chat-primary);
  color: #fff;
  padding: 13px 14px 13px 16px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px;
}

.fk-chat-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fk-chat-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 2px;
  flex-shrink: 0;
}

/* ── Menü ──────────────────────────────────────────────────────────────────── */

.fk-chat-menu-wrap {
  position: relative;
}

.fk-chat-menu-btn {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s !important;
}

.fk-chat-menu-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15) !important;
}

.fk-chat-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  min-width: 210px;
  padding: 6px;
  z-index: 100000;
  border: 1px solid rgba(0,0,0,.07);
}

.fk-chat-menu[aria-hidden="true"] {
  display: none !important;
}

.fk-menu-item {
  display: flex !important;
  align-items: center !important;
  justify-content: left !important;
  gap: 9px;
  width: 100% !important;
  padding: 10px 12px !important;
  border: 0 !important;
  background: transparent !important;
  color: #222 !important;
  font-size: 14px !important;
  font-family: inherit !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  text-align: left !important;
  transition: background 0.12s !important;
}

.fk-menu-item:hover {
  background: #f4f6f8 !important;
}

.fk-menu-item--danger {
  color: #e53e3e !important;
}

.fk-menu-item--danger:hover {
  background: #fff5f5 !important;
}

.fk-menu-divider {
  height: 1px;
  background: #ececec;
  margin: 4px 0;
}

/* ── Close-Button ──────────────────────────────────────────────────────────── */

.fk-chat-close {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s !important;
}

.fk-chat-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15) !important;
}

/* ── Nachrichten ───────────────────────────────────────────────────────────── */

.fk-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f6f7f9;
  scroll-behavior: smooth;
}

.fk-chat-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.fk-chat-message--user {
  align-items: flex-end;
}

.fk-chat-message--assistant {
  align-items: flex-start;
}

.fk-chat-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.fk-chat-message--user .fk-chat-bubble {
  background: var(--fk-chat-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.fk-chat-message--assistant .fk-chat-bubble {
  background: #fff;
  color: #222;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ── Zeitstempel ───────────────────────────────────────────────────────────── */

.fk-chat-ts {
  font-size: 13px;
  color: #666;
  margin-top: 3px;
  margin-bottom: 10px;
  padding: 0 2px;
}

/* ── Lade-Animation ────────────────────────────────────────────────────────── */

.fk-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.fk-typing span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bbb;
  animation: fk-bounce 1.2s infinite ease-in-out;
}

.fk-typing span:nth-child(2) { animation-delay: 0.2s; }
.fk-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fk-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ── Eingabe ────────────────────────────────────────────────────────────────── */

.fk-chat-form {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #ececec;
}

.fk-chat-input {
  flex: 1;
  min-height: 40px !important;
  max-height: 120px !important;
  resize: none !important;
  border: 1px solid #d8dbe2 !important;
  border-radius: 12px !important;
  padding: 10px 13px !important;
  font: inherit;
  font-size: 14px !important;
  line-height: 1.45 !important;
  overflow-y: hidden !important;
  transition: border-color 0.15s !important;
}

.fk-chat-input:focus {
  outline: none !important;
  border-color: var(--fk-chat-primary) !important;
}

.fk-chat-input:disabled {
  background: #f6f7f9 !important;
  color: #aaa !important;
}

.fk-chat-input::-webkit-scrollbar {
  display: none !important;
}

.fk-chat-input {
  scrollbar-width: none !important;
}

/* ── Zeichenzähler ──────────────────────────────────────────────────────────── */

.fk-chat-input-wrap {
  flex: 1;
  position: relative;
  display: flex !important;
  flex-direction: column;
}

.fk-chat-input-wrap .fk-chat-input {
  width: 100%;
}

.fk-char-counter {
  font-size: 12px;
  color: #666;
  text-align: right;
  padding: 2px 4px 0;
  line-height: 1;
  transition: color 0.15s;
}

.fk-char-counter--warn {
  color: #e8a020 !important;
}

.fk-char-counter--max {
  color: #e53e3e !important;
  font-weight: 600;
}

/* ── AI Disclaimer ──────────────────────────────────────────────────────────── */

.fk-disclaimer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fk-chat-disclaimer {
  padding: 6px 12px;
  background: #fff;
  border-top: 1px solid #ececec;
}

.fk-disclaimer-toggle {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  font-size: 11px !important;
  color: #666 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  text-decoration: underline!important;
  text-decoration-style: dotted!important;


}

.fk-disclaimer-toggle svg {
    transition: all 0.7s linear 0.1s;
    transform: rotate(0deg);
}

.fk-disclaimer-toggle.fk-disclaimer-toggle--open svg {
  transform: rotate(-45deg);
}

.fk-disclaimer-toggle:hover {
  color: #888 !important;
}

.fk-disclaimer-text {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin: 6px 0 0;
  display: none;
}

.fk-disclaimer-text[aria-hidden="false"] {
  display: block;
}

.fk-chat-send {
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--fk-chat-primary) !important;
  color: #fff !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s, transform 0.1s !important;
}

.fk-chat-send:hover:not(:disabled) {
  background: #1a65ab !important;
}

.fk-chat-send:active:not(:disabled) {
  transform: scale(0.93) !important;
}

.fk-chat-send:disabled {
  opacity: .5;
  cursor: not-allowed !important;
}

/* ── Bot-Sender ─────────────────────────────────────────────────────────────── */

.fk-chat-sender-row {
  display: flex !important;
  align-items: center !important;
  gap: 5px;
  margin-bottom: 4px;
  padding: 0 2px;
}

.fk-chat-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fk-chat-primary);
  color: #fff;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
}

.fk-chat-sender-name {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Footer-Branding ────────────────────────────────────────────────────────── */

.fk-chat-footer {
  padding: 7px 12px;
  text-align: center;
  font-size: 13px;
  color: #666;
  background: #fff;
  border-top: 1px solid #ececec;
  letter-spacing: 0.02em;
}

/* ── Listen & Chips ─────────────────────────────────────────────────────────── */

/* ── Mobile: Fullscreen ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .fk-chat-root {
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .fk-chat-root--closed {
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    right: 16px !important;
    bottom: 16px !important;
  }

  .fk-chat-panel {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
  }
}

.fk-line {
  margin-bottom: 5px;
}

.fk-chip {
  display: inline-block !important;
  margin: 5px 5px 0 0 !important;
  padding: 6px 13px !important;
  border-radius: 999px !important;
  border: 1.5px solid var(--fk-chat-primary) !important;
  background: #fff !important;
  color: var(--fk-chat-primary) !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-family: inherit !important;
  transition: background 0.12s, color 0.12s !important;
}

.fk-chip:hover {
  background: var(--fk-chat-primary) !important;
  color: #fff !important;
}

/* ── Kontaktformular ────────────────────────────────────────────────────────── */

.fk-contact-form {
  margin-top: 10px;
  background: #fff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
}

.fk-contact-label {
  font-size: 13px;
  color: #444;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.fk-contact-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fk-contact-input-row {
  display: flex !important;
  gap: 8px;
  align-items: center !important;
}

.fk-contact-value {
  flex: 1;
  border: 1px solid #d8dbe2 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font: inherit;
  font-size: 13px !important;
  outline: none !important;
  transition: border-color 0.15s !important;
}

.fk-contact-value:focus {
  border-color: var(--fk-chat-primary) !important;
}

.fk-contact-submit {
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--fk-chat-primary) !important;
  color: #fff !important;
  padding: 8px 14px !important;
  font: inherit;
  font-size: 13px !important;
  cursor: pointer !important;
  white-space: nowrap;
  transition: background 0.15s !important;
}

.fk-contact-submit:hover {
  background: #1a65ab !important;
}

.fk-contact-submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.fk-contact-done {
  font-size: 13px;
  color: #22a35a;
  font-weight: 600;
  margin: 0;
}

.fk-contact-error {
  font-size: 13px;
  color: #e53e3e;
  margin: 0;
}
