#pps-chat,
#pps-chat * {
    box-sizing: border-box;
}

#pps-chat {
    --pps-black: #111111;
    --pps-yellow: #f5c400;
    --pps-white: #ffffff;
    --pps-ink: #111111;
    position: fixed;
    z-index: 100000;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--pps-ink);
    -webkit-font-smoothing: antialiased;
}

#pps-chat.pps-chat--right {
    right: 18px;
}

#pps-chat.pps-chat--left {
    left: 18px;
    align-items: flex-start;
}

#pps-chat button,
#pps-chat input {
    font-family: inherit;
}

#pps-chat button.pps-chat__launcher,
#pps-chat button.pps-chat__close,
#pps-chat button.pps-chat__send,
#pps-chat button.pps-chat__chip {
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    min-height: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.2;
    text-decoration: none;
}

#pps-chat input.pps-chat__input {
    width: auto;
    max-width: none;
}

#pps-chat .pps-chat__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

#pps-chat .pps-chat__launcher {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 6px 18px 6px 6px;
    border: 0;
    border-radius: 999px;
    background: var(--pps-black);
    color: var(--pps-white);
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    position: relative;
    z-index: 2;
}

#pps-chat .pps-chat__launcher:hover {
    background: #000000;
}

#pps-chat .pps-chat__launcher:focus-visible,
#pps-chat .pps-chat__close:focus-visible,
#pps-chat .pps-chat__send:focus-visible,
#pps-chat .pps-chat__input:focus-visible,
#pps-chat .pps-chat__chip:focus-visible {
    outline: 2px solid var(--pps-yellow);
    outline-offset: 2px;
}

#pps-chat .pps-chat__launcher-text {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding-right: 4px;
}

#pps-chat.is-open .pps-chat__launcher {
    display: none;
}

#pps-chat .pps-chat__dock {
    position: relative;
    display: flex;
    align-items: center;
}

#pps-chat .pps-chat__hint {
    display: none;
}

#pps-chat .pps-chat__mark {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--pps-white);
    box-shadow: 0 0 0 2px var(--pps-yellow);
    flex: 0 0 auto;
}

#pps-chat .pps-chat__mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#pps-chat .pps-chat__mark--lg {
    width: 46px;
    height: 46px;
    font-size: 12px;
}

#pps-chat .pps-chat__panel {
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 28px));
    height: min(680px, calc(100dvh - 40px));
    background: var(--pps-white);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

#pps-chat .pps-chat__panel[hidden] {
    display: none !important;
}

#pps-chat .pps-chat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px 16px 16px;
    background: var(--pps-black);
    color: var(--pps-white);
}

#pps-chat .pps-chat__id {
    min-width: 0;
    flex: 1;
}

#pps-chat .pps-chat__eyebrow {
    margin: 0;
    color: var(--pps-yellow);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

#pps-chat .pps-chat__header h2 {
    margin: 1px 0 0;
    color: var(--pps-white);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

#pps-chat .pps-chat__status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 3px 0 0;
    color: var(--pps-white);
    font-size: 12.5px;
}

#pps-chat .pps-chat__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pps-yellow);
    box-shadow: 0 0 0 3px rgba(220, 188, 7, 0.2);
}

#pps-chat .pps-chat__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pps-white);
    cursor: pointer;
}

#pps-chat .pps-chat__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--pps-white);
}

#pps-chat .pps-chat__log {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    background: var(--pps-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#pps-chat .pps-chat__msg {
    max-width: 92%;
    padding: 12px 14px;
    font-size: 14.5px;
    line-height: 1.55;
}

#pps-chat .pps-chat__msg p {
    margin: 0;
}

#pps-chat .pps-chat__msg--bot {
    align-self: flex-start;
    background: var(--pps-white);
    color: var(--pps-ink);
    border: 1px solid var(--pps-black);
    border-radius: 4px 16px 16px 16px;
}

#pps-chat .pps-chat__msg--user {
    align-self: flex-end;
    background: var(--pps-black);
    color: var(--pps-white);
    border-radius: 16px 16px 4px 16px;
}

#pps-chat .pps-chat__msg a {
    color: var(--pps-black);
    font-weight: 600;
}

#pps-chat .pps-chat__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#pps-chat .pps-chat__source {
    display: inline-flex;
    align-items: center;
    color: var(--pps-black);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

#pps-chat .pps-chat__source:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#pps-chat .pps-chat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#pps-chat .pps-chat__chip {
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--pps-black);
    border-radius: 999px;
    background: var(--pps-white);
    color: var(--pps-black);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

#pps-chat .pps-chat__chip:hover {
    border-color: var(--pps-black);
    background: var(--pps-yellow);
    color: var(--pps-black);
}

#pps-chat .pps-chat__typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 2px;
}

#pps-chat .pps-chat__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pps-black);
    animation: pps-chat-blink 1s infinite ease-in-out;
}

#pps-chat .pps-chat__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

#pps-chat .pps-chat__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes pps-chat-blink {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

#pps-chat .pps-chat__form {
    display: flex;
    gap: 8px;
    padding: 12px 12px 14px;
    background: var(--pps-white);
    border-top: 1px solid var(--pps-black);
}

#pps-chat .pps-chat__input {
    flex: 1;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--pps-black);
    border-radius: 12px;
    background: var(--pps-white);
    color: var(--pps-black);
    font-size: 14.5px;
}

#pps-chat .pps-chat__input::placeholder {
    color: rgba(17, 17, 17, 0.45);
}

#pps-chat .pps-chat__input:focus {
    border-color: var(--pps-yellow);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.35);
}

#pps-chat .pps-chat__send {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    background: var(--pps-yellow);
    color: var(--pps-black);
    cursor: pointer;
    flex: 0 0 auto;
}

#pps-chat .pps-chat__send:hover {
    background: var(--pps-black);
    color: var(--pps-yellow);
}

#pps-chat .pps-chat__send:disabled {
    opacity: 0.55;
    cursor: default;
}

#pps-chat .pps-chat__note {
    margin: 0;
    padding: 0 14px 12px;
    background: var(--pps-white);
    color: var(--pps-black);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 520px) {
    #pps-chat {
        bottom: 14px;
    }

    #pps-chat.pps-chat--right {
        right: 14px;
    }

    #pps-chat.pps-chat--left {
        left: 14px;
    }

    #pps-chat .pps-chat__launcher {
        padding: 6px;
    }

    #pps-chat .pps-chat__launcher-text {
        display: none;
    }

    #pps-chat .pps-chat__hint {
        display: block;
        position: absolute;
        right: calc(100% + 12px);
        top: 50%;
        margin: 0;
        padding: 8px 12px;
        border-radius: 12px;
        background: #111111;
        color: #ffffff;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transform: translateY(-50%) translateX(8px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
        transition: opacity 0.35s ease, transform 0.35s ease;
    }

    #pps-chat .pps-chat__hint::after {
        content: "";
        position: absolute;
        right: -4px;
        top: 50%;
        width: 8px;
        height: 8px;
        background: #111111;
        transform: translateY(-50%) rotate(45deg);
    }

    #pps-chat .pps-chat__hint.is-on {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    #pps-chat.pps-chat--left .pps-chat__hint {
        right: auto;
        left: calc(100% + 12px);
        transform: translateY(-50%) translateX(-8px);
    }

    #pps-chat.pps-chat--left .pps-chat__hint.is-on {
        transform: translateY(-50%) translateX(0);
    }

    #pps-chat.pps-chat--left .pps-chat__hint::after {
        right: auto;
        left: -4px;
    }

    #pps-chat.is-open .pps-chat__hint {
        display: none;
    }

    #pps-chat .pps-chat__input {
        font-size: 16px;
    }

    #pps-chat .pps-chat__panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        height: min(720px, calc(100dvh - 20px));
    }
}

@media (prefers-reduced-motion: reduce) {
    #pps-chat .pps-chat__typing span {
        animation: none;
    }
}

#pps-chat button.pps-chat__launcher {
    background: #111111 !important;
    color: #ffffff !important;
}

#pps-chat .pps-chat__mark {
    background: #ffffff !important;
    box-shadow: 0 0 0 2px #f5c400 !important;
}

#pps-chat .pps-chat__header,
#pps-chat .pps-chat__header h2,
#pps-chat .pps-chat__status {
    background: #111111;
    color: #ffffff !important;
}

#pps-chat .pps-chat__header {
    background: #111111 !important;
}

#pps-chat .pps-chat__eyebrow,
#pps-chat .pps-chat__dot {
    color: #f5c400 !important;
    background: transparent;
}

#pps-chat .pps-chat__dot {
    background: #f5c400 !important;
}

#pps-chat button.pps-chat__send {
    background: #f5c400 !important;
    color: #111111 !important;
}

#pps-chat button.pps-chat__send:hover {
    background: #111111 !important;
    color: #f5c400 !important;
}
