.pvta-footer-actions {
    position: fixed;
    right: 16px;
    top: 50%;
    z-index: 9998;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 92px;
    transform: translateY(-50%);
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
}

.pvta-footer-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 64px;
    padding: 8px 6px;
    border: 0;
    border-radius: 14px;
    background: #0b65c2;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.pvta-footer-action:hover,
.pvta-footer-action:focus {
    color: #fff;
    text-decoration: none;
}

.pvta-footer-action:nth-child(2) {
    background: #f59e0b;
}

.pvta-footer-action:nth-child(3) {
    background: #16a34a;
}

.pvta-footer-action:nth-child(4) {
    background: #0ea5e9;
}

.pvta-footer-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.pvta-footer-action-icon svg {
    display: block;
    width: 19px;
    height: 19px;
}

.pvta-footer-modal[hidden],
.pvta-footer-panel[hidden],
.pvta-chat-prechat[hidden],
.pvta-chat-conversation[hidden] {
    display: none !important;
}

body.pvta-footer-modal-open {
    overflow: hidden;
}

.pvta-footer-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 126px 16px 16px;
}

.pvta-footer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
}

.pvta-footer-modal-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    border-radius: 22px;
    background: #fff;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.pvta-footer-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.pvta-footer-panel h2 {
    margin: 0 44px 16px 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.pvta-consult-form {
    display: grid;
    gap: 14px;
}

.pvta-consult-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.pvta-consult-form textarea,
.pvta-consult-form input[type="text"] {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.45;
}

.pvta-consult-website {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.pvta-consult-hint {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.pvta-consult-form button[type="submit"] {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: #f59e0b;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.pvta-consult-status {
    margin: 0;
    color: #0f766e;
    font-weight: 700;
}

.pvta-chat-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.pvta-chat-prechat {
    padding: 20px;
    background: #eaf3ff;
}

.pvta-chat-prechat-form {
    display: grid;
    gap: 12px;
}

.pvta-chat-prechat-form p {
    margin: 0 0 4px;
    color: #334155;
}

.pvta-chat-prechat-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.pvta-chat-prechat-form input {
    width: 100%;
    border: 1px solid #c9d3df;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.45;
}

.pvta-chat-prechat-form button {
    min-height: 44px;
    border: 0;
    border-radius: 22px;
    background: #0068ff;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.pvta-chat-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.pvta-chat-form textarea,
.pvta-chat-form input[type="text"] {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.45;
}

.pvta-chat-website {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.pvta-chat-history {
    display: grid;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fafc;
}

.pvta-chat-empty {
    margin: 4px;
    color: #64748b;
}

.pvta-chat-message {
    display: grid;
    gap: 3px;
    max-width: 88%;
    padding: 9px 11px;
    border-radius: 12px;
    background: #e2e8f0;
    color: #0f172a;
}

.pvta-chat-message--visitor {
    justify-self: end;
    background: #dbeafe;
}

.pvta-chat-message strong {
    font-size: 13px;
}

.pvta-chat-message span {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pvta-chat-message small {
    color: #64748b;
    font-size: 11px;
}

.pvta-chat-form button[type="submit"] {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: #f59e0b;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.pvta-chat-status {
    min-height: 1.2em;
    margin: 0;
    color: #0f766e;
    font-weight: 700;
}

.pvta-chat-agent-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 0;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
}

.pvta-chat-agent-status span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pvta-chat-agent-pulse 1s ease-in-out infinite;
}

@keyframes pvta-chat-agent-pulse {
    50% { opacity: .25; transform: scale(.72); }
}

/* Zalo-inspired conversation surface for the visitor chat panel. */
.pvta-footer-panel[data-pvta-panel="chat"] {
    margin: -22px;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 14px 58px 14px 18px;
    background: #0068ff;
    color: #fff;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-topbar h2 {
    margin: 0;
    color: #fff;
    font-size: 17px;
    letter-spacing: 0;
}

.pvta-chat-topbar small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.pvta-chat-avatar {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.58);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.pvta-chat-avatar svg {
    width: 21px;
    height: 21px;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-history {
    max-height: min(48vh, 410px);
    min-height: 250px;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: #eaf3ff;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-message {
    max-width: 82%;
    padding: 9px 11px 7px;
    border-radius: 15px 15px 15px 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-message--visitor {
    margin-left: auto;
    border-radius: 15px 15px 4px 15px;
    background: #f1f3f5;
    color: #1f2937;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-message strong {
    color: #52606d;
    font-size: 11px;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-message--visitor strong,
.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-message--visitor small {
    color: #697586;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin: 0;
    padding: 12px;
    border-top: 1px solid #e5e9ef;
    background: #fff;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-form label {
    min-width: 0;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-form textarea {
    min-height: 44px;
    max-height: 108px;
    padding: 11px 12px;
    border-color: #c9d3df;
    border-radius: 22px;
    resize: vertical;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-form button[type="submit"] {
    min-width: 46px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    background: #0068ff;
    font-size: 0;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-form button[type="submit"]::after {
    content: "➤";
    font-size: 18px;
    line-height: 1;
}

.pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-status {
    grid-column: 1 / -1;
    margin: 0 8px;
    font-size: 12px;
}

.pvta-contact-list {
    display: grid;
    gap: 10px;
}

.pvta-contact-list a {
    align-items: center;
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    text-decoration: none;
}

.pvta-footer-panel[data-pvta-panel="call"] .pvta-contact-list a {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.pvta-footer-panel[data-pvta-panel="call"] .pvta-contact-icon {
    color: #16a34a;
}

.pvta-footer-panel[data-pvta-panel="zalo"] .pvta-contact-list a {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0068ff;
}

.pvta-footer-panel[data-pvta-panel="zalo"] .pvta-contact-icon {
    color: #0068ff;
}

.pvta-contact-list a {
    display: flex;
    gap: 9px;
}

.pvta-contact-icon {
    display: inline-flex;
    flex: 0 0 20px;
    height: 20px;
    width: 20px;
}

.pvta-contact-icon svg {
    height: 100%;
    width: 100%;
}

@media (min-width: 769px) {
    .pvta-footer-actions {
        top: 50%;
        right: 16px;
        bottom: auto;
        gap: 8px;
        width: 92px;
        transform: translateY(-50%);
        padding: 8px;
    }

    .pvta-footer-actions .pvta-footer-action {
        min-height: 64px;
        padding: 8px 6px;
        border-radius: 14px;
        font-size: 13px;
    }

    .pvta-footer-actions .pvta-footer-action:nth-child(2) {
        position: static;
        width: auto;
        min-height: 64px;
        padding: 8px 6px;
        border-radius: 14px;
        background: #f59e0b;
        box-shadow: none;
    }

    .pvta-footer-actions .pvta-footer-action:nth-child(2) > span:not(.pvta-footer-action-icon) {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
    }

    .pvta-footer-actions .pvta-footer-action:nth-child(2):focus-visible {
        outline: 3px solid #0f172a;
        outline-offset: 3px;
    }

    .pvta-footer-modal.pvta-footer-modal--chat {
        inset: auto 20px 92px auto;
        display: block;
        width: min(380px, calc(100vw - 40px));
        padding: 0;
    }

    .pvta-footer-modal.pvta-footer-modal--chat .pvta-footer-modal-backdrop {
        display: none;
    }

    .pvta-footer-modal.pvta-footer-modal--chat .pvta-footer-modal-dialog {
        width: 100%;
        max-height: min(650px, calc(100vh - 112px));
        overflow: hidden;
        border-radius: 18px;
    }

    .pvta-footer-modal.pvta-footer-modal--chat .pvta-footer-panel[data-pvta-panel="chat"] .pvta-chat-history {
        max-height: min(410px, calc(100vh - 274px));
        min-height: 180px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 84px;
    }

    body.pvta-footer-actions-below-footer {
        padding-bottom: 0;
    }

    .pvta-footer-actions {
        left: 50%;
        right: auto;
        top: auto;
        bottom: 12px;
        grid-template-columns: repeat(4, minmax(72px, 1fr));
        width: min(520px, calc(100% - 24px));
        transform: translateX(-50%);
    }

    .pvta-footer-actions.pvta-footer-actions--below-footer {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: min(520px, calc(100% - 24px));
        margin: 12px auto;
        transform: none;
    }

    .pvta-footer-action {
        min-height: 56px;
        padding: 8px 6px;
    }

    .pvta-footer-action-icon {
        width: 26px;
        height: 26px;
    }

    .pvta-footer-action-icon svg {
        width: 17px;
        height: 17px;
    }

    .pvta-footer-modal {
        align-items: flex-end;
        justify-content: center;
        padding: 16px;
    }

    .pvta-footer-modal-dialog {
        max-height: min(82vh, 720px);
        border-radius: 20px;
    }
}
