*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, 'Segoe UI', Helvetica Neue, Arial, sans-serif;
    font-size: clamp(14px, 4vw, 16px);
    line-height: 1.4;
    background: #0B141A;
    color: #E9EDEF;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    overscroll-behavior: none;
}

/* ── Top bar ─────────────────────────────────────────── */

.wa-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #202C33;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.wa-topbar__icon {
    color: #00A884;
    display: flex;
    align-items: center;
}

.wa-topbar__title {
    font-size: clamp(16px, 4.8vw, 18px);
    font-weight: 600;
    color: #E9EDEF;
    letter-spacing: 0.01em;
}

/* ── Chat background ─────────────────────────────────── */

.wa-chat-bg {
    flex: 1 0 auto;
    background-color: #0B141A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg opacity='0.035' fill='%23ffffff'%3E%3Cpath d='M36 38c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zm-12 0c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zm24 0c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z'/%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
}

/* ── Contact card ────────────────────────────────────── */

.wa-contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #202C33;
    padding: 12px 16px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.wa-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.wa-avatar {
    width: clamp(46px, 13vw, 56px);
    height: clamp(46px, 13vw, 56px);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #00A884;
}

.wa-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #25D366;
    border: 2px solid #202C33;
}

.wa-contact-name {
    font-size: clamp(15px, 4.6vw, 17px);
    font-weight: 600;
    color: #E9EDEF;
    line-height: 1.2;
    margin-bottom: 2px;
}

.wa-contact-status {
    font-size: 13px;
    color: #00A884;
}

/* ── Messages ────────────────────────────────────────── */

.wa-messages {
    flex: 1;
    padding: 10px 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wa-msg {
    display: flex;
}

.wa-msg--in {
    justify-content: flex-start;
}

.wa-msg--out {
    justify-content: flex-end;
    margin-top: 8px;
}

.wa-bubble {
    max-width: 85%;
    padding: 7px 10px 5px 10px;
    border-radius: 8px;
    position: relative;
    word-break: break-word;
}

.wa-bubble--in {
    background: #202C33;
    border-radius: 0 8px 8px 8px;
}

.wa-bubble--in::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    border-width: 0 8px 8px 0;
    border-style: solid;
    border-color: transparent #202C33 transparent transparent;
}

.wa-bubble--out {
    background: #005C4B;
    border-radius: 8px 0 8px 8px;
}

.wa-bubble--out::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 0;
    border-width: 0 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #005C4B;
}

.wa-bubble__text {
    font-size: clamp(14px, 4.2vw, 15.5px);
    color: #E9EDEF;
    line-height: 1.45;
    padding-right: 6px;
}

.wa-bubble__time {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 11px;
    color: #8696A0;
    margin-top: 3px;
    white-space: nowrap;
}

.wa-tick {
    color: #53BDEB;
    flex-shrink: 0;
}

.wa-cta-link {
    display: block;
    font-size: clamp(15px, 4.4vw, 16px);
    font-weight: 600;
    color: #E9EDEF;
    text-decoration: none;
    padding: 6px 0;
    min-height: 24px;
    letter-spacing: 0.01em;
}

/* ── Bottom bar ──────────────────────────────────────── */

.wa-bottombar {
    background: #202C33;
    padding: 14px 16px 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.4);
}

.wa-bottombar__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #00A884;
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(17px, 5vw, 19px);
    font-weight: 700;
    padding: 19px 24px;
    min-height: 62px;
    border-radius: 34px;
    box-shadow: 0 0 26px rgba(0, 168, 132, 0.6);
    transition: background 0.18s, box-shadow 0.18s, transform 0.15s;
    width: 100%;
    justify-content: center;
    animation: wa-btn-pulse 2.2s ease-in-out infinite;
}

@keyframes wa-btn-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(0, 168, 132, 0.5); }
    50% { box-shadow: 0 0 34px rgba(0, 168, 132, 0.85); }
}

.wa-bottombar__btn:active {
    background: #017a5f;
    transform: scale(0.98);
}

/* ── Larger screens (tablet / desktop fallback) ─────── */

@media (min-width: 601px) {
    .wa-bottombar__btn {
        max-width: 380px;
    }

    .wa-bottombar__btn:hover {
        background: #017a5f;
        box-shadow: 0 0 28px rgba(0, 168, 132, 0.7);
    }
}
