/* U-ACT Website-Chat */
.ua-chat {
    position: fixed; right: 24px; bottom: 24px; z-index: 10001;
    width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
    background: #fff; color: #1a2332;
    border: 1px solid #b8d9e8; border-radius: 18px;
    box-shadow: 0 18px 50px rgba(14, 94, 129, .25);
    font-family: Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.5;
    overflow: hidden;
}
.ua-chat[hidden] { display: none; }
.ua-chat-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 16px; background: #0E5E81; color: #fff; }
.ua-chat-title { flex: 1; display: flex; flex-direction: column; }
.ua-chat-title strong { font-size: 16px; }
.ua-chat-title span { font-size: 12px; opacity: .85; }
.ua-chat-iconbtn { background: transparent; border: 0; color: #fff; font-size: 18px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.ua-chat-iconbtn:hover, .ua-chat-iconbtn:focus-visible { background: rgba(255,255,255,.18); outline: none; }
.ua-chat-log { flex: 1; overflow-y: auto; padding: 14px; background: #f4f8fb; display: flex; flex-direction: column; gap: 8px; }
.ua-chat-msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ua-chat-assistant { align-self: flex-start; background: #fff; border: 1px solid #e1edf3; border-bottom-left-radius: 4px; }
.ua-chat-user { align-self: flex-end; background: #0E5E81; color: #fff; border-bottom-right-radius: 4px; }
.ua-chat-error { align-self: stretch; background: #fff4f2; border: 1px solid #f3c7bd; color: #8a2a14; font-size: 14px; }
.ua-chat-typing { color: #5a6a7a; letter-spacing: 2px; }
.ua-chat-msg a { color: inherit; text-decoration: underline; }
.ua-chat-assistant a { color: #0E5E81; }
.ua-chat-consent { padding: 12px 14px; border-top: 1px solid #e1edf3; font-size: 13px; color: #5a6a7a; }
.ua-chat-consent p { margin: 0 0 6px; }
.ua-chat-consent[hidden] { display: none; }
.ua-chat-warn { color: #1a2332; font-weight: 500; }
.ua-chat-check { display: flex; gap: 8px; align-items: flex-start; color: #1a2332; cursor: pointer; }
.ua-chat-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #0E5E81; }
.ua-chat-check a { color: #0E5E81; }
.ua-chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e1edf3; }
.ua-chat-form textarea { flex: 1; resize: none; font: inherit; padding: 9px 12px; border: 1px solid #b8d9e8; border-radius: 12px; max-height: 120px; }
.ua-chat-form textarea:focus { outline: 2px solid #1a7a9e; outline-offset: 0; }
.ua-chat-form textarea:disabled { background: #f1f4f6; }
.ua-chat-send { background: #0E5E81; color: #fff; border: 0; border-radius: 12px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer; }
.ua-chat-send:disabled { opacity: .45; cursor: default; }
.ua-chat-foot { padding: 0 12px 10px; text-align: center; font-size: 12px; }
.ua-chat-foot a { color: #5a6a7a; }
/* Bubbles ausblenden, solange der Chat offen ist */
.ua-chat-open .ua-fab-bubble, .ua-chat-open .ua-fab-wa-badge, .ua-chat-open .ua-cart-floating { visibility: hidden; }
@media (max-width: 600px) {
    .ua-chat { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
    .ua-chat-form textarea { font-size: 16px; } /* kein Auto-Zoom auf iOS */
}

/* WhatsApp-Knopf im Chatkopf */
.ua-chat-wabtn { background: #25D366; color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.ua-chat-wabtn:hover, .ua-chat-wabtn:focus-visible { background: #1ebe5b; outline: none; }

/* Eigene Chat-Bubble über der WhatsApp-Bubble (WhatsApp bottom 90px + 54px, „KI“-Schild bis ~146px) */
.ua-fab-bubble.ua-fab-chat {
    bottom: 156px;
    border: 0; cursor: pointer; line-height: 1;
    animation-delay: 0.5s;
}
.ua-fab-chat .ua-fab-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.ua-fab-chat .ua-fab-icon svg { display: block; }
/* Shop: Warenkorb rutscht über die Chat-Bubble */
.ua-has-chat .ua-cart-floating { bottom: 222px; }
@media (max-width: 600px) {
    .ua-fab-bubble.ua-fab-chat { bottom: 140px; }
    .ua-fab-chat .ua-fab-icon, .ua-fab-chat .ua-fab-icon svg { width: 20px; height: 20px; }
    .ua-has-chat .ua-cart-floating { bottom: 200px; }
}

/* Produktkarten (ausklappbar wie im Shop) */
.ua-chat-log { position: relative; }
.ua-chat-card { align-self: flex-start; width: 86%; background: #fff; border: 1px solid #b8d9e8; border-radius: 12px; overflow: hidden; }
.ua-chat-card summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; padding-right: 30px; }
.ua-chat-card summary::-webkit-details-marker { display: none; }
.ua-chat-card summary::after { content: '▾'; position: absolute; right: 12px; top: 11px; color: #0E5E81; transition: transform .2s; }
.ua-chat-card[open] summary::after { transform: rotate(180deg); }
.ua-chat-card summary:focus-visible { outline: 2px solid #1a7a9e; outline-offset: -2px; }
.ua-chat-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ua-chat-card-top strong { color: #0a4a65; font-size: 14px; }
.ua-chat-card-price { color: #0E5E81; font-weight: 700; font-size: 14px; white-space: nowrap; }
.ua-chat-card-desc { color: #5a6a7a; font-size: 13px; }
.ua-chat-card-body { padding: 0 12px 12px; font-size: 13px; }
.ua-chat-card-body p { margin: 8px 0; color: #1a2332; }
.ua-chat-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ua-chat-card-tags span { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e8f4f9; color: #0a4a65; }
.ua-chat-card-tags .ua-tag-info { background: #eef2ff; color: #3730a3; }
.ua-chat-card-tags .ua-tag-warn { background: #fff4e5; color: #8a4b00; }
.ua-chat-card-link { display: inline-block; margin-top: 2px; color: #0E5E81; font-weight: 700; text-decoration: none; }
.ua-chat-card-link:hover { text-decoration: underline; }

/* Ablauf einer Genanalyse */
.ua-chat-steps { align-self: flex-start; width: 86%; background: #e8f4f9; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #0a4a65; }
.ua-chat-steps ol { margin: 6px 0 0; padding-left: 20px; }
.ua-chat-steps li { margin: 2px 0; }

/* Startfragen */
.ua-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ua-chat-chip { background: #fff; border: 1px solid #b8d9e8; color: #0E5E81; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.ua-chat-chip:hover, .ua-chat-chip:focus-visible { background: #e8f4f9; outline: none; }

/* Inhalte im Verlauf nicht zusammendrücken */
.ua-chat-log > * { flex-shrink: 0; }
