#nbse-popup {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9000;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: min(400px, calc(100vh - 32px));
    overflow: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    background: #ffffff;
    color: #263238;
    border: 1px solid #d5dfc7;
    border-radius: 10px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, .12);
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

#nbse-popup *,
#nbse-popup *::before,
#nbse-popup *::after {
    box-sizing: border-box;
}

#nbse-popup [hidden] {
    display: none !important;
}

#nbse-popup .nbse-header {
    position: relative;
    padding: 6px 44px 6px 12px;
    background: linear-gradient(
        110deg,
        #76b900,
        #d9f99d
    );
    border-bottom: 2px solid #dc2626;
    color: #203500;
}

#nbse-popup .nbse-brand {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}

#nbse-popup .nbse-title {
    margin: 3px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

#nbse-popup .nbse-subtitle {
    font-size: 11px;
}

#nbse-popup button,
#nbse-popup a {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
}

#nbse-popup .nbse-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #203500;
    font-size: 24px;
}

#nbse-popup .nbse-body {
    padding: 6px 10px;
}

#nbse-popup .nbse-question,
#nbse-popup .nbse-message {
    margin: 0 0 5px;
    font-size: 13px;
}

#nbse-popup .nbse-choices {
    display: grid;
    gap: 5px;
}

#nbse-popup .nbse-choice {
    display: block;
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid #d5dfc7;
    border-radius: 5px;
    background: #ffffff;
    color: #263238;
    text-align: left;
    font-weight: 400;
}

#nbse-popup .nbse-choice:hover {
    background: #f3fbe7;
    border-color: #76b900;
}

#nbse-popup .nbse-selected {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 700;
}

#nbse-popup .nbse-contact {
    display: grid;
    gap: 6px;
}

#nbse-popup .nbse-phone,
#nbse-popup .nbse-zalo,
#nbse-popup .nbse-expand {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px;
    border: 0;
    border-radius: 5px;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

#nbse-popup .nbse-phone,
#nbse-popup .nbse-expand {
    background: #3f6212;
}

#nbse-popup .nbse-zalo {
    background: #0068ff;
}

#nbse-popup .nbse-back,
#nbse-popup .nbse-later {
    display: block;
    width: 100%;
    min-height: 32px;
    margin: 0;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #52604a;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
}

#nbse-popup button:focus-visible,
#nbse-popup a:focus-visible {
    outline: 2px solid #365314;
    outline-offset: 2px;
}

#nbse-popup .nbse-invitation {
    padding: 6px 44px 6px 10px;
    background: linear-gradient(
        110deg,
        #a3e635,
        #ecfccb
    );
    border-bottom: 2px solid #dc2626;
    position: relative;
}

#nbse-popup .nbse-invitation-text {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #203500;
}

#nbse-popup .nbse-expand {
    width: auto;
    padding: 6px 12px;
}

@media (max-width: 767px) {
    #nbse-popup {
        left: 8px;
        bottom: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        width: 300px;
        max-width: calc(100vw - 80px);
        max-height: 45vh;
        max-height: 45dvh;
        font-size: 13px;
        border-radius: 8px;
    }

    #nbse-popup .nbse-header {
        padding: 6px 44px 6px 10px;
    }

    #nbse-popup .nbse-title {
        font-size: 14px;
    }

    #nbse-popup .nbse-body {
        padding: 8px;
    }

    #nbse-popup .nbse-choice {
        min-height: 44px;
        font-size: 12px;
    }

    #nbse-popup .nbse-later,
    #nbse-popup .nbse-back {
        min-height: 44px;
    }
}

@media (max-width: 319px),
       (max-height: 479px) {
    #nbse-popup {
        display: none !important;
    }
}

/* K01 compact layout optimization */

#nbse-popup .nbse-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

#nbse-popup .nbse-phone,
#nbse-popup .nbse-zalo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
}

#nbse-popup .nbse-choice {
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    #nbse-popup .nbse-header .nbse-brand,
    #nbse-popup .nbse-header .nbse-subtitle {
        display: none;
    }

    #nbse-popup .nbse-header {
        min-height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #nbse-popup .nbse-title {
        margin: 0;
        font-size: 14px;
    }

    #nbse-popup .nbse-body {
        padding: 6px 8px;
    }

    #nbse-popup .nbse-question,
    #nbse-popup .nbse-message {
        font-size: 13px;
        line-height: 1.35;
    }

    #nbse-popup .nbse-selected {
        font-size: 13px;
        line-height: 1.35;
    }

    #nbse-popup .nbse-choice {
        font-size: 13px;
        padding: 5px 7px;
    }

    #nbse-popup .nbse-choices,
    #nbse-popup .nbse-contact {
        gap: 4px;
    }

    #nbse-popup .nbse-back,
    #nbse-popup .nbse-later {
        min-height: 44px;
        padding: 2px;
        margin: 0;
    }
}