:root { --apa-chat-accent: #c90000; }
#autopark-chatbot-fahrzeugberater { position: fixed; right: 22px; bottom: 22px; z-index: 999999; font-family: inherit; line-height: 1.45; }
.apa-chat-launcher { width: 62px; height: 62px; border: 0; border-radius: 50%; background: var(--apa-chat-accent); color: #fff; cursor: pointer; box-shadow: 0 12px 34px rgba(0,0,0,.25); display: grid; place-items: center; transition: transform .2s ease; }
.apa-chat-launcher:hover { transform: translateY(-2px); }
.apa-chat-launcher svg { width: 34px; height: 34px; display: block; fill: currentColor; }
.apa-chat-launcher-image { width: 36px; height: 36px; object-fit: contain; display: block; }
.apa-chat-panel { position: absolute; right: 0; bottom: 76px; width: min(390px, calc(100vw - 28px)); height: min(650px, calc(100vh - 115px)); background: #fff; border: 1px solid #e2e5ea; border-radius: 18px; box-shadow: 0 20px 55px rgba(19,28,45,.24); overflow: hidden; display: none; grid-template-rows: auto 1fr auto auto auto; color: #1f2937; }
.apa-chat-panel.is-open { display: grid; animation: apa-chat-in .18s ease-out; }
@keyframes apa-chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.apa-chat-header { background: var(--apa-chat-accent); color: #fff; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.apa-chat-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.apa-chat-header-image { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border-radius: 9px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); }
.apa-chat-heading-wrap { display: flex; flex-direction: column; min-width: 0; }
.apa-chat-title { font-size: 16px; line-height: 1.25; }
.apa-chat-subtitle { font-size: 12px; opacity: .85; }
.apa-chat-header-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.apa-chat-new { border: 1px solid rgba(255,255,255,.42); background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap; }
.apa-chat-new:hover { background: rgba(255,255,255,.22); }
.apa-chat-close { border: 0; background: transparent; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 2px; }
.apa-chat-messages { padding: 15px; overflow-y: auto; background: #f6f7f9; scroll-behavior: smooth; }
.apa-chat-message { display: flex; margin: 0 0 10px; }
.apa-chat-message-user { justify-content: flex-end; }
.apa-chat-bubble { max-width: 86%; padding: 10px 12px; border-radius: 13px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.apa-chat-message-assistant .apa-chat-bubble { background: #fff; border: 1px solid #e1e4e8; border-bottom-left-radius: 4px; }
.apa-chat-message-user .apa-chat-bubble { background: var(--apa-chat-accent); color: #fff; border-bottom-right-radius: 4px; }
.apa-chat-cards { display: grid; gap: 10px; margin: 0 0 13px; }
.apa-chat-card { display: grid; grid-template-columns: 102px 1fr; min-height: 92px; border: 1px solid #dde1e6; border-radius: 12px; background: #fff; overflow: hidden; color: inherit; text-decoration: none !important; transition: border-color .2s, transform .2s; }
.apa-chat-card:hover { border-color: var(--apa-chat-accent); transform: translateY(-1px); }
.apa-chat-card img { width: 102px; height: 100%; min-height: 92px; object-fit: cover; }
.apa-chat-card-body { padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.apa-chat-card-title { font-size: 13px; line-height: 1.25; }
.apa-chat-card-facts { font-size: 11px; color: #68707c; }
.apa-chat-card-price { color: var(--apa-chat-accent); font-weight: 700; margin-top: auto; }
.apa-chat-quick-actions { padding: 9px 12px; display: flex; gap: 7px; overflow-x: auto; border-top: 1px solid #e5e7eb; background: #fff; }
.apa-chat-chip { border: 1px solid #d8dce2; background: #fff; color: #293140; border-radius: 999px; padding: 7px 10px; white-space: nowrap; cursor: pointer; font-size: 12px; }
.apa-chat-chip:hover { border-color: var(--apa-chat-accent); color: var(--apa-chat-accent); }
.apa-chat-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.apa-chat-input { width: 100%; min-height: 40px; max-height: 105px; resize: none; border: 1px solid #ccd1d8; border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 14px; box-sizing: border-box; }
.apa-chat-input:focus { outline: 2px solid color-mix(in srgb, var(--apa-chat-accent) 22%, transparent); border-color: var(--apa-chat-accent); }
.apa-chat-send, .apa-chat-lead-submit { border: 0; border-radius: 9px; background: var(--apa-chat-accent); color: #fff; padding: 0 15px; font-weight: 700; cursor: pointer; }
.apa-chat-send:disabled, .apa-chat-lead-submit:disabled { opacity: .55; cursor: wait; }
.apa-chat-footer { padding: 5px 12px 8px; text-align: center; color: #777f8b; font-size: 10px; background: #fff; }
.apa-chat-footer a { color: inherit; text-decoration: underline; }
.apa-chat-typing { display: flex; gap: 4px; align-items: center; min-height: 18px; }
.apa-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; animation: apa-dot 1s infinite ease-in-out; }
.apa-chat-typing i:nth-child(2) { animation-delay: .15s; } .apa-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes apa-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
.apa-chat-notice { margin: -5px 0 10px; color: #6b7280; font-size: 11px; }
.apa-chat-lead-form { margin: 4px 0 13px; padding: 13px; background: #fff; border: 1px solid #dfe3e8; border-radius: 12px; display: grid; gap: 9px; }
.apa-chat-lead-title { font-size: 15px; }
.apa-chat-lead-vehicle { font-size: 12px; color: #68707c; }
.apa-chat-field { display: grid; gap: 3px; font-size: 12px; }
.apa-chat-field input, .apa-chat-field textarea { width: 100%; border: 1px solid #ccd1d8; border-radius: 8px; padding: 8px 9px; font: inherit; box-sizing: border-box; }
.apa-chat-consent { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; }
.apa-chat-consent input { margin-top: 3px; }
.apa-chat-lead-submit { min-height: 40px; }
.apa-chat-lead-status { font-size: 12px; color: #b32d2e; }
.apa-chat-lead-success { padding: 10px; border-radius: 8px; background: #edf8ef; color: #176b2c; }
.apa-chat-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 600px) {
  #autopark-chatbot-fahrzeugberater { right: 14px; bottom: 14px; }
  .apa-chat-launcher { width: 58px; height: 58px; }
  .apa-chat-panel { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .apa-chat-panel.is-open { display: grid; }
  .apa-chat-card { grid-template-columns: 96px 1fr; }
}

.apa-chat-footer strong,
.apa-chat-footer b { font-weight: 700; }
.apa-chat-footer em,
.apa-chat-footer i { font-style: italic; }


.apa-chat-chip-whatsapp {
  border-color: #25d366;
  color: #128c4a;
  font-weight: 700;
}
.apa-chat-chip-whatsapp:hover {
  border-color: #128c4a;
  color: #0f6f3b;
  background: #effcf4;
}
.apa-chat-whatsapp-cta {
  margin: -3px 0 13px;
}
.apa-chat-whatsapp-button {
  width: 100%;
  min-height: 39px;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: #25d366;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.apa-chat-whatsapp-button:hover {
  background: #1fb85a;
}
.apa-chat-whatsapp-button-form {
  margin-top: 1px;
  background: #25d366;
}

@media (max-width: 420px) { .apa-chat-new { font-size: 10px; padding: 6px 8px; } .apa-chat-title { font-size: 14px; } .apa-chat-subtitle { font-size: 11px; } }

/* Antwort-Feedback */
.apa-chat-feedback {
  margin: -4px 0 13px;
  padding: 9px 10px;
  border: 1px solid #e1e4e8;
  border-radius: 10px;
  background: #fff;
  font-size: 11px;
  color: #5f6773;
}
.apa-chat-feedback-prompt { display: block; margin-bottom: 7px; font-weight: 600; color: #4b5563; }
.apa-chat-feedback-actions { display: flex; gap: 7px; }
.apa-chat-feedback-button,
.apa-chat-feedback-reason,
.apa-chat-feedback-cancel,
.apa-chat-feedback-submit {
  font: inherit;
  cursor: pointer;
}
.apa-chat-feedback-button {
  border: 1px solid #d7dce2;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 5px 9px;
}
.apa-chat-feedback-button:hover { border-color: var(--apa-chat-accent); color: var(--apa-chat-accent); }
.apa-chat-feedback-title { display: block; margin-bottom: 8px; color: #374151; font-size: 12px; }
.apa-chat-feedback-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.apa-chat-feedback-reason {
  border: 1px solid #d7dce2;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  padding: 5px 8px;
}
.apa-chat-feedback-reason:hover,
.apa-chat-feedback-reason.is-selected {
  border-color: var(--apa-chat-accent);
  color: var(--apa-chat-accent);
  background: color-mix(in srgb, var(--apa-chat-accent) 6%, #fff);
}
.apa-chat-feedback-comment {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid #ccd1d8;
  border-radius: 8px;
  padding: 8px 9px;
  box-sizing: border-box;
  font: inherit;
  font-size: 12px;
}
.apa-chat-feedback-comment:focus { outline: 2px solid color-mix(in srgb, var(--apa-chat-accent) 18%, transparent); border-color: var(--apa-chat-accent); }
.apa-chat-feedback-privacy { margin-top: 6px; color: #818894; font-size: 10px; line-height: 1.35; }
.apa-chat-feedback-form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.apa-chat-feedback-cancel { border: 0; background: transparent; color: #6b7280; padding: 6px 8px; }
.apa-chat-feedback-submit { border: 0; border-radius: 8px; background: var(--apa-chat-accent); color: #fff; padding: 7px 10px; font-weight: 700; }
.apa-chat-feedback-status { margin-top: 6px; color: #b32d2e; }
.apa-chat-feedback-thanks { color: #176b2c; font-weight: 600; }
.apa-chat-feedback.is-busy { opacity: .72; }
.apa-chat-feedback button:disabled,
.apa-chat-feedback textarea:disabled { cursor: wait; }
