/* Pur Digital - Chat-Assistent */
.pd-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 240;
    font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

.pd-chat-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-height: 54px;
    padding: .78rem 1rem .78rem .9rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background:
        radial-gradient(circle at 25% 20%, rgba(201, 162, 39, .45), transparent 34%),
        linear-gradient(135deg, #520298, #7b2fc4);
    box-shadow: 0 18px 42px rgba(37, 4, 72, .34);
    cursor: pointer;
}

.pd-chat-toggle:hover { transform: translateY(-1px); }

.pd-chat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
}

.pd-chat-icon svg { width: 20px; height: 20px; }

.pd-chat-toggle-text {
    display: grid;
    gap: .03rem;
    text-align: left;
}

.pd-chat-toggle-text strong {
    font-size: .94rem;
    line-height: 1;
}

.pd-chat-toggle-text span {
    color: rgba(255,255,255,.76);
    font-size: .75rem;
    font-weight: 700;
}

.pd-chat-pulse {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, .2);
}

.pd-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(390px, calc(100vw - 28px));
    max-height: min(680px, calc(100vh - 110px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: #171023;
    box-shadow: 0 26px 80px rgba(12, 5, 24, .42);
    transform: translateY(10px) scale(.98);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.pd-chat.is-open .pd-chat-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.pd-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    color: #fff;
    background:
        radial-gradient(circle at 88% 0%, rgba(201, 162, 39, .22), transparent 36%),
        linear-gradient(135deg, #2b0649, #520298);
}

.pd-chat-brand {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.pd-chat-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #201126;
    background: #c9a227;
    font-weight: 950;
}

.pd-chat-head strong {
    display: block;
    line-height: 1.1;
}

.pd-chat-head span {
    color: rgba(255,255,255,.72);
    font-size: .82rem;
}

.pd-chat-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
}

.pd-chat-body {
    display: grid;
    gap: .75rem;
    align-content: start;
    overflow-y: auto;
    padding: 1rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(123, 47, 196, .22), transparent 18rem),
        #171023;
}

.pd-msg {
    max-width: 88%;
    padding: .78rem .9rem;
    border-radius: 16px;
    color: #f7f3ff;
    background: #281a3b;
    font-size: .92rem;
    line-height: 1.45;
    white-space: pre-line;
}

.pd-msg-user {
    justify-self: end;
    color: #201126;
    background: #c9a227;
}

.pd-msg-bot { justify-self: start; }

.pd-chat-chips,
.pd-chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.pd-chip,
.pd-action {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    padding: .55rem .72rem;
    color: #f5f0ff;
    background: rgba(255,255,255,.07);
    cursor: pointer;
    font: 800 .8rem/1 var(--font, system-ui, sans-serif);
}

.pd-chip:hover,
.pd-action:hover {
    color: #201126;
    background: #c9a227;
    border-color: #c9a227;
}

.pd-action-primary {
    color: #201126;
    background: #c9a227;
    border-color: #c9a227;
}

.pd-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .55rem;
    padding: .8rem;
    border-top: 1px solid rgba(255,255,255,.1);
    background: #120b1d;
}

.pd-chat-input {
    min-width: 0;
    min-height: 42px;
    padding: .72rem .85rem;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.07);
    font: inherit;
}

.pd-chat-input::placeholder { color: rgba(255,255,255,.62); }
.pd-chat-input:focus {
    outline: none;
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

.pd-chat-send {
    min-width: 44px;
    border: 0;
    border-radius: 50%;
    color: #201126;
    background: #c9a227;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 900;
}

@media (max-width: 680px) {
    .pd-chat {
        right: 14px;
        bottom: 14px;
    }
    .pd-chat-panel {
        position: fixed;
        inset: auto 10px 78px 10px;
        width: auto;
        max-height: calc(100vh - 96px);
    }
    .pd-chat-toggle-text { display: none; }
    .pd-chat-toggle {
        min-height: 58px;
        width: 58px;
        justify-content: center;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pd-chat-panel,
    .pd-chat-toggle {
        transition: none;
        transform: none;
    }
}
