:root,
.__fb-light-mode:root,
.__fb-light-mode,
.__fb-dark-mode,
:root[data-theme],
:root[class] {
    --splashscreen-primary-title: #0a0a0a;
    --splashscreen-progress-background: #e9edef;
    --splashscreen-progress-primary: #00c298;
    --splashscreen-secondary-lighter: #5b6368;
    --splashscreen-startup-background: #fcf5eb;
    --splashscreen-startup-background-rgb: 252, 245, 235;
    --splashscreen-startup-icon: #bbc5cb;
}
@media (prefers-color-scheme: dark) {
    :root {
        --splashscreen-primary-title: #0a0a0a;
        --splashscreen-progress-background: #e9edef;
        --splashscreen-progress-primary: #00c298;
        --splashscreen-secondary-lighter: #5b6368;
        --splashscreen-startup-background: #f7f5f3;
        --splashscreen-startup-background-rgb: 247, 245, 243;
        --splashscreen-startup-icon: #bbc5cb;
    }
}

[data-testid="search-input"]:empty::before {
    content: attr(data-placeholder);
    color: #8696a0;
    pointer-events: none;
}

[data-testid="popover"] {
    box-shadow:
        0 2px 5px 0 rgba(11, 20, 26, 0.04),
        0 10px 25px 0 rgba(11, 20, 26, 0.16);
    border-radius: 8px;
    width: 295px !important;
    max-width: 295px !important;
}

[data-testid="popover"] [data-testid="dropdown"] {
    min-width: 0 !important;
    width: 100% !important;
}

[data-testid="popover"] [data-testid="search-input"] {
    font-size: 14px;
}

[data-testid="link-device-qrcode-alt-linking-hint"] {
    display: none !important;
}

#wa-web-snapshot-root [data-testid="link-device-qrcode-alt-linking-hint"] {
    display: flex !important;
    cursor: pointer;
}

[data-testid="link-device-phone-number-entry-screen"]
    [data-testid="link-device-qrcode-alt-linking-hint"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    cursor: pointer;
}

html[data-device="mobile"]
    [data-testid="link-device-phone-number-entry-screen"]
    [data-testid="link-device-qrcode-alt-linking-hint"] {
    display: none !important;
}

#wa-web-phone-root .wa-phone-error-pill {
    background-color: var(--WDS-red-75, #fde8eb);
    color: var(--WDS-red-500, #b80531);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    font:
        14px/1.35 -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    animation: wa-error-fade 0.16s ease-out;
}

@keyframes wa-error-fade {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-testid="link-with-phone-number-code-cells"] {
    width: 100%;
}

/* Unify loading/error/code box height so the layout does not jump when
   the pairing code arrives.  Both states use WA's natural code-cell
   sizing (height:50 via .x10wjd1d + 24px padding = 98px total). */
[data-cells-area="code"],
[data-cells-area="loading"],
[data-cells-area="error"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 98px !important;
    box-sizing: border-box !important;
}
[data-cells-area="loading"],
[data-cells-area="error"] {
    padding: 24px 0 !important;
}

[data-cells-area="loading"] > *,
[data-cells-area="error"] > * {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

[data-testid="link-with-phone-number-code-cells"] > [data-mode="loading"],
[data-testid="link-with-phone-number-code-cells"] > [data-mode="error"] {
    width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    display: flex !important;
}

.wa-code-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #54656f;
}

.wa-code-loader__svg {
    display: block;
    animation: wa-code-rotate 1.05s linear infinite;
    transform-origin: center;
}

.wa-code-loader__arc {
    stroke-dasharray: 28 100;
    stroke-dashoffset: 0;
}

@keyframes wa-code-rotate {
    to {
        transform: rotate(360deg);
    }
}

#wa-web-snapshot-root [data-testid="link-device-qr-code"] {
    width: 288px !important;
    height: 288px !important;
}

#wa-web-snapshot-root .wa-qr-loader {
    width: 288px;
    height: 288px;
    border-radius: 10px;
    background-color: var(--WDS-neutral-gray-75, #f4f4f4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #54656f;
}

#wa-web-snapshot-root .wa-qr-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #ffffff;
}

.wa-code-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 4px 8px;
    color: var(--text-critical, #ea0038);
    font:
        14px/1.35 -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

.wa-code-error__icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--text-critical, #ea0038);
}

.wa-code-error__text {
    flex: 1 1 auto;
}

#wa-web-phone-root,
.wa-modal-backdrop {
    --xevgpr9: 24px;
    --x1lh8xxe: 9999px;
    --xpaog5i: 20px;
    --x1j6lpam: 16px;
    --x14m3oik: 8px;
    --x1qxx2f: 8px;
    --xkyfeqk: 12px;
    --x5t84p7: 16px;
    --xb871un: 12px;
    --x159ertx: cubic-bezier(0.2, 0, 0, 1);
}

.wa-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 20, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
    animation: wa-modal-fade-in 0.18s ease-out;
}

.wa-modal-popup {
    max-width: calc(100vw - 32px);
    animation: wa-modal-pop-in 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
    transform-origin: center;
}

@keyframes wa-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes wa-modal-pop-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#wa-web-snapshot-root strong.x1o2sk6j,
#wa-web-phone-root strong.x1o2sk6j {
    margin: 0 4px;
    white-space: nowrap;
}

#wa-web-snapshot-root strong.x1o2sk6j > div,
#wa-web-phone-root strong.x1o2sk6j > div {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

#wa-web-snapshot-root [data-icon="wa-square-icon"],
#wa-web-phone-root [data-icon="wa-square-icon"] {
    margin: 0 4px;
    vertical-align: middle;
}

#wa-web-snapshot-root a[data-testid="edit-phone-link"],
#wa-web-phone-root a[data-testid="edit-phone-link"] {
    margin-left: 8px;
}

#wa-web-phone-root a[role="link"][href="#"] {
    margin-left: 4px;
}

#wa-web-snapshot-root ul > li,
#wa-web-phone-root ul > li {
    margin-bottom: 4px;
}

#wa-web-snapshot-root [data-testid^="step-"],
#wa-web-snapshot-root ul li > div:first-child,
#wa-web-phone-root ul li > div:first-child {
    margin-right: 4px;
}

#wa-web-phone-root [data-testid="phone-number-country-selector"],
#wa-web-phone-root button[type="button"][role="combobox"] {
    padding-left: 16px;
    padding-right: 12px;
}

#wa-web-snapshot-root [data-testid="qr-code"],
#wa-web-snapshot-root canvas,
#wa-web-snapshot-root img[alt*="QR"] {
    margin-left: 8px;
}

/* Base page color = beige. Matches the .app-wrapper-web content shell so
   tablet/desktop viewports (where the shell is capped at ~560px) don't
   show gray strips on the sides. */
html,
body {
    background: #fcf5eb;
    min-height: 100vh;
}
#root,
#app,
.app-wrapper-web,
#wa-web-phone-root {
    background: #fcf5eb;
    min-height: 100vh;
}
.wa-success-check {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: wa-success-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wa-success__phone {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #008069;
    text-align: center;
}
.wa-success__phone strong {
    font-weight: inherit;
}
.wa-success__actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.wa-success__again {
    appearance: none;
    border: none;
    background: transparent;
    color: #008069;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.12s ease;
}
.wa-success__again:hover {
    background-color: rgba(0, 128, 105, 0.08);
}
.wa-success__again:focus-visible {
    outline: 2px solid #008069;
    outline-offset: 2px;
}
@keyframes wa-success-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    html,
    body {
        overflow-x: hidden;
    }
    #wa-web-phone-root .x78zum5.xdt5ytf.x5yr21d,
    #wa-web-phone-root .app-wrapper-web,
    #wa-web-phone-root .app-wrapper-web > .x1c4vz4f {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    #wa-web-phone-root .app-wrapper-web > .x1c4vz4f {
        padding: 12px 16px !important;
        border-radius: 0 !important;
        border: none !important;
    }
    #wa-web-phone-root .x78zum5.xdt5ytf.x5yr21d {
        align-items: stretch !important;
        padding: 0 !important;
        min-height: 100vh !important;
    }
    #wa-web-phone-root .app-wrapper-web {
        min-height: 100vh !important;
        height: 100% !important;
        background: #fcf5eb !important;
    }
    #wa-web-phone-root .app-wrapper-web > .x1c4vz4f {
        min-height: 100vh !important;
    }
    #wa-web-phone-root .app-wrapper-web *[style*="flex-shrink"],
    #wa-web-phone-root .app-wrapper-web *[style*="flexShrink"],
    #wa-web-phone-root .app-wrapper-web .x1c4vz4f {
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }
    #wa-web-phone-root .app-wrapper-web .x1lliihq > div,
    #wa-web-phone-root .app-wrapper-web .x1dr59a3,
    #wa-web-phone-root .app-wrapper-web .xw2csxc {
        box-sizing: border-box !important;
        padding: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    #wa-web-phone-root
        .app-wrapper-web
        button[data-action="next"].x1lliihq
        > div,
    #wa-web-phone-root
        .app-wrapper-web
        button[data-action="next"].x1lliihq
        > div
        > div {
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }
    #wa-web-phone-root .xy296fx,
    #wa-web-phone-root .x91od0,
    #wa-web-phone-root .x14rvwrp,
    #wa-web-phone-root .x1c4ky7w,
    #wa-web-phone-root .x11i3ho8,
    #wa-web-phone-root .x17q7fqb,
    #wa-web-phone-root .x1czfd9k,
    #wa-web-phone-root .x168biu4,
    #wa-web-phone-root .x121pien,
    #wa-web-phone-root .x1c1kv4s,
    #wa-web-phone-root .x16xo58l,
    #wa-web-phone-root .x1cvmir6,
    #wa-web-phone-root .xewp6mh,
    #wa-web-phone-root .xo69b4o {
        width: 100% !important;
    }
    #wa-web-phone-root .xbl0rts,
    #wa-web-phone-root .x15hv16n,
    #wa-web-phone-root .x15icp18,
    #wa-web-phone-root .x17upfok,
    #wa-web-phone-root .x18ip3f8,
    #wa-web-phone-root .x18n5i07,
    #wa-web-phone-root .x19aeb6u,
    #wa-web-phone-root .x12rczxh,
    #wa-web-phone-root .x13o0s5z,
    #wa-web-phone-root .x1htk8sl,
    #wa-web-phone-root .x1q18rhr,
    #wa-web-phone-root .xmj3umr {
        min-width: 0 !important;
    }
    #wa-web-phone-root .x1lwm3bp,
    #wa-web-phone-root .x1n7qst7,
    #wa-web-phone-root .x27kpxv,
    #wa-web-phone-root .x65f84u,
    #wa-web-phone-root .x145dklv,
    #wa-web-phone-root .x17fpy1y,
    #wa-web-phone-root .x19ygybj {
        max-width: 100% !important;
    }
    [data-testid="popover"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    [data-testid="popover"] [data-testid="dropdown"] > div,
    [data-testid="popover"] [role="listitem"] > button {
        min-height: 52px;
    }
    [data-testid="popover"] [data-testid="search-input"] {
        font-size: 16px;
        min-height: 40px;
    }
    #wa-web-phone-root [data-testid="phone-number-input"],
    #wa-web-phone-root input[data-testid="phone-number-input"] {
        font-size: 16px !important;
    }
    #wa-web-phone-root div:has(> button[data-action="next"]) {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    #wa-web-phone-root button[data-action="next"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 48px;
        height: 48px;
        font-size: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 16px !important;
    }
    #wa-web-phone-root [data-testid="phone-number-country-selector"],
    #wa-web-phone-root button[type="button"][role="combobox"] {
        min-height: 48px;
    }
    /* --- Pairing code screen: cells — small enough that the code fits
       inside the natural (content-box) grey box without pushing the
       card past the viewport --- */
    #wa-web-phone-root [data-testid="link-with-phone-number-code-cells"] {
        width: 100% !important;
        overflow: visible;
    }
    #wa-web-phone-root
        [data-testid="link-with-phone-number-code-cells"]
        > div {
        justify-content: center !important;
        flex-wrap: nowrap !important;
    }
    #wa-web-phone-root
        [data-testid="link-with-phone-number-code-cells"]
        .x10h3iyq {
        width: 26px !important;
        flex: 0 0 26px !important;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
        margin-inline-start: 2px !important;
        margin-inline-end: 2px !important;
        font-size: 17px !important;
        border-radius: 7px !important;
    }
    #wa-web-phone-root
        [data-testid="link-with-phone-number-code-cells"]
        .x579bpy {
        font-size: 17px !important;
        margin: 0 3px !important;
        line-height: 1 !important;
    }
    /* Grey code container: reduce vertical padding + tighter radius.
       WA sets height: 50px via .x10wjd1d — force a single shared height
       for both loading and code states so the layout does NOT jump when
       the code arrives.  Content area = 38px (matches the code cell
       height), padding = 10px × 2, total box = 58px. */
    #wa-web-phone-root [data-cells-area="code"],
    #wa-web-phone-root [data-cells-area="loading"],
    #wa-web-phone-root [data-cells-area="error"] {
        height: 58px !important;
        min-height: 58px !important;
        padding: 10px 8px !important;
        margin-top: 10px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    #wa-web-phone-root [data-cells-area="loading"] .wa-code-loader__svg {
        width: 32px !important;
        height: 32px !important;
    }

    /* "Verifying number +X (edit)" — keep phone nowrap, softer wrap for the whole line */
    #wa-web-phone-root .xowvryd.x1c3i2sq.xdod15v.xg6s713 {
        font-size: 14px !important;
        line-height: 1.4 !important;
        text-wrap: balance;
    }
    #wa-web-phone-root .xowvryd.x1c3i2sq.xdod15v.xg6s713 strong {
        white-space: nowrap;
        unicode-bidi: isolate;
    }

    /* Compact instructions list — smaller circles, tighter rows.
       WA sets row-gap: 20px on the <ol> via utility classes — kill it. */
    #wa-web-phone-root #link-device-instructions-list {
        padding: 0 !important;
        margin-top: 2px !important;
        row-gap: 0 !important;
        gap: 0 !important;
    }
    #wa-web-phone-root #link-device-instructions-list > li {
        padding: 4px 0 !important;
        margin: 0 !important;
        font-size: 13.5px !important;
        line-height: 1.35 !important;
        column-gap: 10px !important;
        align-items: center !important;
    }
    /* The digit inside the circle — kill WA margins (6px top/bottom, 4px sides)
       so the number sits perfectly centered in the circle */
    #wa-web-phone-root #link-device-instructions-list .x1f6kntn {
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1 !important;
        display: block !important;
        text-align: center !important;
    }
    /* Container that wraps each number circle — center it vertically to the step text */
    #wa-web-phone-root #link-device-instructions-list li > div:first-child {
        align-self: center !important;
    }
    .wa-modal-popup {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }
    .wa-modal-popup [data-testid="confirm-popup"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 18px !important;
        box-sizing: border-box !important;
    }
    .wa-modal-popup [data-testid="popup-title"] {
        font-size: 17px !important;
        line-height: 1.3 !important;
    }
    .wa-modal-popup [role="button"],
    .wa-modal-popup button {
        min-height: 44px;
        font-size: 15px !important;
    }
    #wa-web-phone-root .wa-phone-error-pill {
        font-size: 13px;
        padding: 10px 14px;
    }
    #wa-web-phone-root [data-testid="wa-logo"] svg {
        height: 22px !important;
        width: auto !important;
    }
    #wa-web-phone-root [data-testid="wa-wordmark"] svg {
        height: 16px !important;
        width: auto !important;
    }
    #wa-web-phone-root [data-testid="wa-logo"],
    #wa-web-phone-root [data-testid="wa-wordmark"] {
        display: inline-flex;
        align-items: center;
    }
    #wa-web-phone-root .wa-success-check svg {
        width: 80px !important;
        height: 80px !important;
    }
    .wa-success__phone {
        font-size: 16px;
    }
    #wa-web-phone-root .x579bpy,
    #wa-web-phone-root .x1c3i2sq {
        text-align: center !important;
    }
    #wa-web-phone-root .x579bpy {
        font-size: 24px !important;
        line-height: 1.2 !important;
    }
    #wa-web-phone-root .x17zd0t2 {
        column-gap: 6px !important;
    }
    #wa-web-phone-root [data-testid="lock-outline"] svg {
        width: 14px !important;
        height: 14px !important;
    }
    #wa-web-phone-root .x65c15g.x9d7mpn.x6ikm8r.x10wlt62 {
        font-size: 12.5px !important;
        line-height: 1.3 !important;
        white-space: nowrap;
    }
    #wa-web-phone-root .x1ypdohk.x65c15g.x2b8uid {
        font-size: 12px !important;
    }
}

/* Very small screens — tighten further */
@media (max-width: 360px) {
    #wa-web-phone-root .app-wrapper-web > .x1c4vz4f {
        padding: 8px 12px !important;
    }
    #wa-web-phone-root .app-wrapper-web .x1dr59a3.xw2csxc,
    #wa-web-phone-root .app-wrapper-web .x1lliihq > div,
    #wa-web-phone-root .app-wrapper-web .x1dr59a3,
    #wa-web-phone-root .app-wrapper-web .xw2csxc {
        padding: 16px !important;
    }
    #wa-web-phone-root .x579bpy {
        font-size: 22px !important;
    }
    #wa-web-phone-root .x1c3i2sq {
        font-size: 14px !important;
    }
    #wa-web-phone-root .x65c15g.x9d7mpn.x6ikm8r.x10wlt62 {
        font-size: 11.5px !important;
    }
    #wa-web-phone-root
        [data-testid="link-with-phone-number-code-cells"]
        .x10h3iyq {
        min-width: 26px !important;
        flex: 0 1 30px !important;
        font-size: 17px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        margin-inline-start: 2px !important;
        margin-inline-end: 2px !important;
    }
    #wa-web-phone-root
        [data-testid="link-with-phone-number-code-cells"]
        .x579bpy {
        font-size: 18px !important;
        margin: 0 2px !important;
    }
    #wa-web-phone-root [data-cells-area="code"],
    #wa-web-phone-root [data-cells-area="loading"] {
        padding: 12px 6px !important;
    }
    #wa-web-phone-root #link-device-instructions-list > li {
        font-size: 13px !important;
        column-gap: 8px !important;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    #wa-web-phone-root .x78zum5.xdt5ytf.x5yr21d {
        align-items: center !important;
    }
    /* Do NOT cap the outer wrapper — that would center the WhatsApp logo
       with the card. Instead let the wrapper stay full-width (beige on the
       full viewport, logo stays top-left like on desktop/mobile) and rely
       on the card's own intrinsic width (x91od0 = 466px) + parent flex
       to center itself. */
    #wa-web-phone-root .app-wrapper-web > .x1c4vz4f {
        max-width: 100% !important;
        margin: 0 !important;
    }
}
