/* Чат всегда снизу справа; «Наверх» поднимается через body.pk-has-chatbot в core.css */
.pk-chatbot-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 64px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: #2271b1;
    color: #fff;
    font: 600 14px/1.2 system-ui, Segoe UI, Arial, sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.pk-chatbot-launcher:hover {
    background: #135e96;
}

.pk-chatbot-panel {
    position: fixed;
    right: 20px;
    bottom: 76px;
    z-index: 99991;
    width: min(360px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1d2327;
    border: 1px solid #c3c4c7;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font: 14px/1.45 system-ui, Segoe UI, Arial, sans-serif;
}

.pk-chatbot-panel[hidden] {
    display: none !important;
}

.pk-chatbot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: #2271b1;
    color: #fff;
}

.pk-chatbot-head strong {
    font-size: 15px;
}

.pk-chatbot-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.pk-chatbot-body {
    padding: 14px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.pk-chatbot-welcome {
    margin: 0 0 12px;
    color: #3c434a;
}

.pk-chatbot-section {
    margin: 12px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pk-chatbot-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pk-chatbot-msg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.pk-chatbot-msg-user {
    align-items: flex-end;
}

.pk-chatbot-msg-bot {
    align-items: flex-start;
}

.pk-chatbot-bubble {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f0f6fc;
    color: #1d2327;
    max-width: 95%;
    white-space: pre-wrap;
    word-break: break-word;
}

.pk-chatbot-bubble-user {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.pk-chatbot-msg-bot .pk-chatbot-bubble {
    border-bottom-left-radius: 4px;
}

.pk-chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.pk-chatbot-chip,
a.pk-chatbot-chip-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 7px 11px;
    border: 1px solid #c3c4c7;
    border-radius: 999px;
    background: #fff;
    color: #1d2327;
    font: 600 12px/1.3 system-ui, Segoe UI, Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

.pk-chatbot-chip:hover,
a.pk-chatbot-chip-link:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #135e96;
}

.pk-chatbot-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 52px;
    padding: 12px 14px;
}

.pk-chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8c8f94;
    animation: pk-chatbot-blink 1.2s infinite ease-in-out;
}

.pk-chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.pk-chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pk-chatbot-blink {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.pk-chatbot-compose .pk-chatbot-input:disabled,
.pk-chatbot-compose .pk-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pk-chatbot-hint {
    margin: 0 0 10px;
    color: #646970;
    font-size: 13px;
}

.pk-chatbot-cta {
    margin: 0 0 12px;
}

.pk-chatbot-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #2271b1;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
}

.pk-chatbot-cta-btn:hover {
    background: #135e96;
}

.pk-chatbot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pk-chatbot-q {
    width: 100%;
    text-align: left;
    border: 1px solid #dcdcde;
    background: #f6f7f7;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: #1d2327;
}

.pk-chatbot-q:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.pk-chatbot-answer {
    margin: 0;
    white-space: pre-wrap;
    color: #3c434a;
}

.pk-chatbot-answer strong {
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 15px;
}

.pk-chatbot-answer a.pk-chatbot-link,
a.pk-chatbot-link {
    color: #2271b1;
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
}

.pk-chatbot-answer a.pk-chatbot-link:hover {
    color: #135e96;
}

.pk-chatbot-back {
    margin-top: 12px;
    border: 0;
    background: transparent;
    color: #2271b1;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}

.pk-chatbot-foot {
    border-top: 1px solid #e0e0e0;
    padding: 10px 12px 12px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

.pk-chatbot-compose {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pk-chatbot-input {
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 999px;
    font: inherit;
    background: #fff;
    color: #1d2327;
}

.pk-chatbot-input:focus {
    outline: 2px solid rgba(34, 113, 177, 0.35);
    border-color: #2271b1;
}

.pk-chatbot-send {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.pk-chatbot-send:hover {
    background: #135e96;
}

.pk-chatbot-foot-link {
    color: #2271b1;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
    text-align: center;
}

.pk-chatbot-foot-link:hover {
    text-decoration: underline;
}

.pk-chatbot-site {
    margin: 0;
}

.pk-chatbot-site-lead {
    margin: 0 0 8px;
    font-weight: 600;
    color: #1d2327;
}

.pk-chatbot-site-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pk-chatbot-site-item {
    margin: 0;
}

.pk-chatbot-site-link {
    display: block;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
}

.pk-chatbot-site-link:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.pk-chatbot-site-title {
    display: block;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 4px;
}

.pk-chatbot-site-snip {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: #646970;
}

.pk-chatbot-site-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #646970;
    text-decoration: underline;
}

.pk-chatbot-site-more:hover {
    color: #2271b1;
}

@media (max-width: 768px) {
    .pk-chatbot-launcher {
        right: 16px;
        bottom: 16px;
    }

    .pk-chatbot-panel {
        right: 16px;
        bottom: 72px;
        max-height: min(520px, calc(100vh - 100px));
    }
}

@media (max-width: 480px) {
    .pk-chatbot-launcher {
        right: 12px;
        bottom: 12px;
    }

    .pk-chatbot-panel {
        right: 12px;
        bottom: 68px;
    }
}
