.scu-widget,
.scu-widget * {
    box-sizing: border-box;
}

.scu-widget {
    --scu-button-color: #25d366;
    --scu-header-color: #00695c;
    --scu-phone-color: #22b24c;
    position: fixed;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 99999;
    max-width: calc(100vw - 24px);
    font-family: inherit;
    direction: rtl;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

.scu-widget.scu-right {
    right: 18px;
}

.scu-widget.scu-left {
    left: 18px;
}

.smart-modal-grid-opened .scu-widget {
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.scu-panel {
    width: 340px;
    max-width: calc(100vw - 28px);
    margin-bottom: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 22px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.scu-left .scu-panel {
    transform-origin: bottom left;
}

.scu-panel.scu-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scu-head {
    position: relative;
    padding: 16px 16px 14px;
    color: #fff;
    background: var(--scu-header-color);
    background-image: linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.08));
}

.scu-close {
    position: absolute;
    top: 10px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #fff;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    background: rgba(255, 255, 255, .16);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    appearance: none;
}

.scu-close:hover,
.scu-close:focus-visible {
    background: rgba(255, 255, 255, .24);
    outline: none;
}

.scu-title,
.scu-subtitle {
    padding: 0;
    border: 0;
}

.scu-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.scu-subtitle {
    margin: 0;
    padding-left: 36px;
    font-size: 12px;
    line-height: 1.7;
    opacity: .92;
}

.scu-body {
    padding: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.scu-greeting {
    margin-bottom: 12px;
    padding: 10px 12px;
    color: #263238;
    font-size: 13px;
    line-height: 1.8;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.scu-contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scu-contact-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px 12px;
    color: #fff !important;
    text-decoration: none !important;
    background: var(--scu-contact-color, #25d366);
    background-image: linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.07));
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.scu-contact-btn:hover,
.scu-contact-btn:focus-visible {
    color: #fff !important;
    filter: brightness(.98);
    outline: none;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
    transform: translateY(-1px);
}

.scu-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
}

.scu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scu-avatar .scu-icon-img,
.scu-contact-icon .scu-icon-img,
.scu-main-icon .scu-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 0;
}

.scu-contact-content {
    flex: 1;
    min-width: 0;
}

.scu-contact-name,
.scu-contact-meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.scu-contact-name {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.scu-contact-meta {
    font-size: 11px;
    line-height: 1.5;
    opacity: .9;
}

.scu-contact-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 22px;
}

.scu-contact-icon svg {
    width: 22px;
    height: 22px;
}

.scu-footer-note {
    margin: 12px 2px 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.8;
    text-align: center;
}

.scu-trigger-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    direction: ltr;
    pointer-events: none;
}

/* When the whole widget is placed on the left side, keep the circular trigger
   closest to the viewport edge and move the number toward the page content. */
.scu-left .scu-trigger-wrap {
    direction: rtl;
    justify-content: flex-start;
}

.scu-trigger-label {
    padding: 7px 12px;
    color: #1f2937;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 999px;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .14);
    pointer-events: auto;
}

.scu-phone-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 12px 6px 7px;
    overflow: hidden;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
    direction: ltr;
    background: var(--scu-phone-color);
    background-image: linear-gradient(135deg, rgba(255,255,255,.10), rgba(0,0,0,.08));
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    box-shadow: 0 9px 24px rgba(15, 23, 42, .20), inset 0 1px 0 rgba(255,255,255,.12);
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    transform-origin: right center;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease, box-shadow .18s ease, filter .18s ease;
}

.scu-left .scu-phone-pill {
    transform-origin: left center;
}

.scu-phone-pill:hover,
.scu-phone-pill:focus-visible {
    color: #fff !important;
    outline: none;
    filter: brightness(1.03);
    box-shadow: 0 11px 27px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255,255,255,.14);
    transform: translateY(-1px);
}

.scu-phone-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #fff;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
}

.scu-phone-icon svg {
    width: 16px;
    height: 16px;
}

.scu-phone-number {
    display: inline-block;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .1px;
    unicode-bidi: isolate;
}

.scu-is-open .scu-phone-pill {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(9px) scale(.94);
}

.scu-left.scu-is-open .scu-phone-pill {
    transform: translateX(-9px) scale(.94);
}

.scu-trigger {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    color: #fff;
    font: inherit;
    background: var(--scu-button-color);
    background-image: linear-gradient(145deg, rgba(255,255,255,.10), rgba(0,0,0,.08));
    border: 0;
    border-radius: 50%;
    box-shadow: 0 11px 28px rgba(15, 23, 42, .28), inset 0 0 0 1px rgba(255,255,255,.18);
    cursor: pointer;
    appearance: none;
    isolation: isolate;
    pointer-events: auto;
    animation: scuFloat 3s ease-in-out infinite;
}

.scu-trigger::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .32);
    animation: scuPulse 2.4s ease-out infinite;
}

.scu-trigger:hover {
    filter: brightness(1.03);
}

.scu-trigger:focus-visible {
    outline: 3px solid rgba(15, 23, 42, .20);
    outline-offset: 3px;
}

.scu-main-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.scu-main-icon svg {
    width: 25px;
    height: 25px;
}

@keyframes scuPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, .35);
    }
    70% {
        transform: scale(1.12);
        box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

@keyframes scuFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@media (max-width: 480px) {
    .scu-widget {
        bottom: calc(14px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 20px);
    }

    .scu-widget.scu-right {
        right: 10px;
    }

    .scu-widget.scu-left {
        left: 10px;
    }

    .scu-panel {
        width: min(315px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        border-radius: 18px;
    }

    .scu-trigger-wrap {
        gap: 5px;
    }

    .scu-trigger {
        width: 50px;
        height: 50px;
    }

    .scu-trigger-label {
        display: none;
    }

    .scu-phone-pill {
        min-height: 41px;
        gap: 7px;
        padding: 5px 10px 5px 6px;
    }

    .scu-phone-icon {
        width: 28px;
        height: 28px;
    }

    .scu-phone-icon svg {
        width: 15px;
        height: 15px;
    }

    .scu-phone-number {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .scu-phone-pill {
        gap: 5px;
        padding-right: 8px;
    }

    .scu-phone-number {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scu-panel,
    .scu-phone-pill,
    .scu-contact-btn,
    .scu-trigger {
        transition: none !important;
        animation: none !important;
    }

    .scu-trigger::after {
        animation: none !important;
    }
}
