/* Event QR Gallery PWA install UI */
.pwa-install-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #e1d6ca;
    border-radius: 999px;
    background: #f8f4ef;
    color: #604d3b;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

    .pwa-install-button.is-available {
        display: inline-flex;
    }

    .pwa-install-button:hover,
    .pwa-install-button:focus-visible {
        border-color: #cfbda9;
        background: #fff;
        outline: none;
        transform: translateY(-1px);
    }

    .pwa-install-button svg {
        width: 15px;
        height: 15px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.pwa-update-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(390px, calc(100vw - 32px));
    padding: 12px 13px;
    border: 1px solid #ded4ca;
    border-radius: 16px;
    background: rgba(255, 253, 250, .98);
    color: #44372d;
    box-shadow: 0 18px 48px rgba(56, 43, 31, .16);
    backdrop-filter: blur(16px);
}

    .pwa-update-toast[hidden] {
        display: none;
    }

.pwa-update-toast-copy {
    min-width: 0;
    flex: 1;
}

    .pwa-update-toast-copy strong,
    .pwa-update-toast-copy span {
        display: block;
    }

    .pwa-update-toast-copy strong {
        font-size: 12px;
    }

    .pwa-update-toast-copy span {
        margin-top: 2px;
        color: #857568;
        font-size: 10px;
    }

.pwa-update-toast button {
    min-height: 34px;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: #755b40;
    color: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 600px) {
    .pwa-install-button span {
        display: none;
    }

    .pwa-install-button {
        width: 34px;
        padding: 0;
        border-radius: 50%;
    }
}

* =========================================================
EVENT QR GALLERY PWA
Guest install controls + iOS instructions
========================================================= */

.pwa-install-button,
.guest-pwa-install,
.guest-gallery-install-btn {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.pwa-install-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #e1d6ca;
    border-radius: 999px;
    background: #f8f4ef;
    color: #604d3b;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

    .pwa-install-button.is-available {
        display: inline-flex;
    }

    .pwa-install-button svg,
    .pwa-install-sheet svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* =========================================================
   GUEST DETAILS INSTALL CARD
   ========================================================= */

.guest-pwa-install {
    display: none !important;
}

    .guest-pwa-install.is-available {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 18px;
        align-items: center;
        width: 100%;
        min-height: 64px;
        margin-top: 2px;
        padding: 10px 14px;
        border: 1px solid rgba(117, 91, 64, .18) !important;
        border-radius: 16px !important;
        background: #fffdf9 !important;
        color: #342d27 !important;
        box-shadow: 0 6px 18px rgba(54, 42, 31, .045);
        text-align: left;
        cursor: pointer;
    }

    .guest-pwa-install::before {
        content: "↓";
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: #efe5d9;
        color: #765d43;
        font-size: 20px;
        font-weight: 800;
    }

    .guest-pwa-install svg {
        display: none !important;
    }

    .guest-pwa-install > span:not(.guest-install-copy):not(.guest-install-chevron) {
        color: #342d27 !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        line-height: 1.25;
    }

    .guest-pwa-install::after {
        content: "›";
        justify-self: end;
        color: #9a8775;
        font-size: 24px;
        line-height: 1;
    }

/* =========================================================
   GALLERY INSTALL CARD
   ========================================================= */

.guest-gallery-install-btn {
    display: none !important;
}

    .guest-gallery-install-btn.is-available {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 18px;
        align-items: center;
        width: 100%;
        min-height: 64px;
        padding: 10px 14px !important;
        border: 1px solid rgba(117, 91, 64, .18) !important;
        border-radius: 16px !important;
        background: #fffdf9 !important;
        color: #342d27 !important;
        box-shadow: 0 6px 18px rgba(54, 42, 31, .045);
        text-align: left;
        white-space: normal !important;
        cursor: pointer;
    }

.guest-gallery-install-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #efe5d9;
    color: #765d43;
    font-size: 20px;
    font-weight: 800;
}

.guest-gallery-install-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .guest-gallery-install-copy strong {
        color: #342d27;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.2;
    }

    .guest-gallery-install-copy small {
        color: #82766c;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.35;
    }

.guest-gallery-install-chevron {
    justify-self: end;
    color: #9a8775;
    font-size: 24px;
    line-height: 1;
}

/* =========================================================
   iOS INSTALL SHEET
   ========================================================= */

body.pwa-install-sheet-open {
    overflow: hidden;
}

.pwa-install-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

    .pwa-install-sheet[hidden] {
        display: none;
    }

.pwa-install-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 26, 22, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pwa-install-sheet-card {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: 460px;
    max-height: min(82vh, 720px);
    margin: 0 auto;
    padding: 22px 18px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(117, 91, 64, .12);
    border-radius: 26px;
    background: #fffdfa;
    color: #302923;
    box-shadow: 0 30px 80px rgba(30, 23, 18, .28);
}

.pwa-install-sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #e5ddd4;
    border-radius: 50%;
    background: #faf7f2;
    color: #5f5349;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.pwa-install-sheet-header {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-right: 42px;
}

.pwa-install-sheet-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #7b6043;
    color: #fff;
}

    .pwa-install-sheet-icon svg {
        width: 24px;
        height: 24px;
    }

.pwa-install-sheet-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #8a6d4d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
}

.pwa-install-sheet-card h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(23px, 7vw, 30px);
    line-height: 1.05;
    letter-spacing: -.015em;
}

.pwa-install-sheet-intro {
    margin: 14px 0 0;
    color: #756a60;
    font-size: 14px;
    line-height: 1.55;
}

.pwa-install-sheet-share-callout {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #e8ded3;
    border-radius: 16px;
    background: #f8f3ed;
}

.pwa-install-sheet-share-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: #765d43;
    box-shadow: 0 3px 10px rgba(55, 42, 31, .06);
}

.pwa-install-sheet-share-callout strong,
.pwa-install-sheet-share-callout small {
    display: block;
}

.pwa-install-sheet-share-callout strong {
    font-size: 13px;
    line-height: 1.25;
}

.pwa-install-sheet-share-callout small {
    margin-top: 2px;
    color: #807368;
    font-size: 11px;
    line-height: 1.35;
}

.pwa-install-sheet-steps {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

    .pwa-install-sheet-steps li {
        display: grid;
        grid-template-columns: 28px 38px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 62px;
        padding: 10px 11px;
        border: 1px solid #ece4dc;
        border-radius: 15px;
        background: #fff;
    }

.pwa-step-number {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #7b6043;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.pwa-step-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f5eee6;
    color: #765d43;
}

    .pwa-step-icon svg {
        width: 18px;
        height: 18px;
    }

.pwa-step-copy strong,
.pwa-step-copy small {
    display: block;
}

.pwa-step-copy strong {
    color: #342d27;
    font-size: 13px;
    line-height: 1.25;
}

.pwa-step-copy small {
    margin-top: 2px;
    color: #82776d;
    font-size: 11px;
    line-height: 1.35;
}

.pwa-install-sheet-tip {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #f6f2ed;
    color: #74685d;
    font-size: 11px;
    line-height: 1.45;
}

    .pwa-install-sheet-tip strong {
        color: #4d4239;
    }

.pwa-install-sheet-done {
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: #3c3732;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* =========================================================
   UPDATE TOAST
   ========================================================= */

.pwa-update-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(390px, calc(100vw - 32px));
    padding: 12px 13px;
    border: 1px solid #ded4ca;
    border-radius: 16px;
    background: rgba(255, 253, 250, .98);
    color: #44372d;
    box-shadow: 0 18px 48px rgba(56, 43, 31, .16);
}

    .pwa-update-toast[hidden] {
        display: none;
    }

.pwa-update-toast-copy {
    min-width: 0;
    flex: 1;
}

    .pwa-update-toast-copy strong,
    .pwa-update-toast-copy span {
        display: block;
    }

    .pwa-update-toast-copy strong {
        font-size: 12px;
    }

    .pwa-update-toast-copy span {
        margin-top: 2px;
        color: #857568;
        font-size: 10px;
    }

.pwa-update-toast button {
    min-height: 34px;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: #755b40;
    color: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 640px) {
    .guest-gallery-install-btn.is-available {
        grid-column: 1 / -1;
    }

    .pwa-install-sheet-card {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 20px 16px 16px;
        border-radius: 24px;
    }
}

@media (max-width: 600px) {
    .pwa-install-fallback span {
        display: none;
    }

    .pwa-install-fallback {
        width: 34px;
        padding: 0;
        border-radius: 50%;
    }
}

/* =========================================================
   EVENT QR GALLERY PWA
   Guest install controls + iOS instructions
   ========================================================= */

.pwa-install-button,
.guest-pwa-install,
.guest-gallery-install-btn {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.pwa-install-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #e1d6ca;
    border-radius: 999px;
    background: #f8f4ef;
    color: #604d3b;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

    .pwa-install-button.is-available {
        display: inline-flex;
    }

    .pwa-install-button svg,
    .pwa-install-sheet svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* =========================================================
   GUEST DETAILS INSTALL CARD
   ========================================================= */

.guest-pwa-install {
    display: none !important;
}

    .guest-pwa-install.is-available {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 18px;
        align-items: center;
        width: 100%;
        min-height: 64px;
        margin-top: 2px;
        padding: 10px 14px;
        border: 1px solid rgba(117, 91, 64, .18) !important;
        border-radius: 16px !important;
        background: #fffdf9 !important;
        color: #342d27 !important;
        box-shadow: 0 6px 18px rgba(54, 42, 31, .045);
        text-align: left;
        cursor: pointer;
    }

    .guest-pwa-install::before {
        content: "↓";
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: #efe5d9;
        color: #765d43;
        font-size: 20px;
        font-weight: 800;
    }

    .guest-pwa-install svg {
        display: none !important;
    }

    .guest-pwa-install > span:not(.guest-install-copy):not(.guest-install-chevron) {
        color: #342d27 !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        line-height: 1.25;
    }

    .guest-pwa-install::after {
        content: "›";
        justify-self: end;
        color: #9a8775;
        font-size: 24px;
        line-height: 1;
    }

/* =========================================================
   GALLERY INSTALL CARD
   ========================================================= */

.guest-gallery-install-btn {
    display: none !important;
}

    .guest-gallery-install-btn.is-available {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 18px;
        align-items: center;
        width: 100%;
        min-height: 64px;
        padding: 10px 14px !important;
        border: 1px solid rgba(117, 91, 64, .18) !important;
        border-radius: 16px !important;
        background: #fffdf9 !important;
        color: #342d27 !important;
        box-shadow: 0 6px 18px rgba(54, 42, 31, .045);
        text-align: left;
        white-space: normal !important;
        cursor: pointer;
    }

.guest-gallery-install-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #efe5d9;
    color: #765d43;
    font-size: 20px;
    font-weight: 800;
}

.guest-gallery-install-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .guest-gallery-install-copy strong {
        color: #342d27;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.2;
    }

    .guest-gallery-install-copy small {
        color: #82766c;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.35;
    }

.guest-gallery-install-chevron {
    justify-self: end;
    color: #9a8775;
    font-size: 24px;
    line-height: 1;
}

/* =========================================================
   iOS INSTALL SHEET - CENTERED FIX
   ========================================================= */

.pwa-install-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

    .pwa-install-sheet[hidden] {
        display: none !important;
    }

.pwa-install-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 26, 22, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


/* Main modal */

.pwa-install-sheet-card {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: max( 16px, env(safe-area-inset-bottom) );
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 440px;
    max-height: calc( 100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom) );
    box-sizing: border-box;
    margin: 0;
    padding: 22px 18px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(117, 91, 64, .12);
    border-radius: 26px;
    background: #fffdfa;
    color: #302923;
    box-shadow: 0 30px 80px rgba(30, 23, 18, .28);
}


/* Close button */

.pwa-install-sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #e5ddd4;
    border-radius: 50%;
    background: #faf7f2;
    color: #5f5349;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}


/* Header */

.pwa-install-sheet-header {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding-right: 48px;
}


.pwa-install-sheet-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #7b6043;
    color: #fff;
}


    .pwa-install-sheet-icon svg {
        width: 24px;
        height: 24px;
    }


.pwa-install-sheet-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #8a6d4d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
}


.pwa-install-sheet-card h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp( 23px, 7vw, 30px );
    line-height: 1.05;
    letter-spacing: -.015em;
}


.pwa-install-sheet-intro {
    margin: 14px 0 0;
    color: #756a60;
    font-size: 14px;
    line-height: 1.55;
}


/* Share callout */

.pwa-install-sheet-share-callout {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #e8ded3;
    border-radius: 16px;
    background: #f8f3ed;
}


.pwa-install-sheet-share-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    color: #765d43;
    box-shadow: 0 3px 10px rgba(55, 42, 31, .06);
}


.pwa-install-sheet-share-callout strong,
.pwa-install-sheet-share-callout small {
    display: block;
}


.pwa-install-sheet-share-callout strong {
    font-size: 13px;
    line-height: 1.25;
}


.pwa-install-sheet-share-callout small {
    margin-top: 2px;
    color: #807368;
    font-size: 11px;
    line-height: 1.35;
}


/* Steps */

.pwa-install-sheet-steps {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}


    .pwa-install-sheet-steps li {
        min-width: 0;
        display: grid;
        grid-template-columns: 28px 38px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 62px;
        padding: 10px 11px;
        box-sizing: border-box;
        border: 1px solid #ece4dc;
        border-radius: 15px;
        background: #fff;
    }


.pwa-step-number {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #7b6043;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}


.pwa-step-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f5eee6;
    color: #765d43;
}


    .pwa-step-icon svg {
        width: 18px;
        height: 18px;
    }


.pwa-step-copy {
    min-width: 0;
}


    .pwa-step-copy strong,
    .pwa-step-copy small {
        display: block;
        overflow-wrap: anywhere;
    }


    .pwa-step-copy strong {
        color: #342d27;
        font-size: 13px;
        line-height: 1.25;
    }


    .pwa-step-copy small {
        margin-top: 2px;
        color: #82776d;
        font-size: 11px;
        line-height: 1.35;
    }


/* Tip */

.pwa-install-sheet-tip {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 13px;
    background: #f6f2ed;
    color: #74685d;
    font-size: 11px;
    line-height: 1.45;
}


    .pwa-install-sheet-tip strong {
        color: #4d4239;
    }


/* Got it */

.pwa-install-sheet-done {
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: #3c3732;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}


/* =========================================================
   SMALL IPHONES
   ========================================================= */

@media (max-width: 480px) {

    .pwa-install-sheet-card {
        width: calc(100% - 24px);
        max-width: none;
        bottom: max( 12px, env(safe-area-inset-bottom) );
        padding: 20px 16px 16px;
        border-radius: 24px;
    }


    .pwa-install-sheet-header {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 10px;
        padding-right: 42px;
    }


    .pwa-install-sheet-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }


    .pwa-install-sheet-card h2 {
        font-size: 26px;
    }


    .pwa-install-sheet-steps li {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }


    .pwa-step-icon {
        display: none;
    }
}
/* =========================================================
   UPDATE TOAST
   ========================================================= */

.pwa-update-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(390px, calc(100vw - 32px));
    padding: 12px 13px;
    border: 1px solid #ded4ca;
    border-radius: 16px;
    background: rgba(255, 253, 250, .98);
    color: #44372d;
    box-shadow: 0 18px 48px rgba(56, 43, 31, .16);
}

    .pwa-update-toast[hidden] {
        display: none;
    }

.pwa-update-toast-copy {
    min-width: 0;
    flex: 1;
}

    .pwa-update-toast-copy strong,
    .pwa-update-toast-copy span {
        display: block;
    }

    .pwa-update-toast-copy strong {
        font-size: 12px;
    }

    .pwa-update-toast-copy span {
        margin-top: 2px;
        color: #857568;
        font-size: 10px;
    }

.pwa-update-toast button {
    min-height: 34px;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: #755b40;
    color: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 640px) {
    .guest-gallery-install-btn.is-available {
        grid-column: 1 / -1;
    }

    .pwa-install-sheet-card {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 20px 16px 16px;
        border-radius: 24px;
    }
}

@media (max-width: 600px) {
    .pwa-install-fallback span {
        display: none;
    }

    .pwa-install-fallback {
        width: 34px;
        padding: 0;
        border-radius: 50%;
    }
}

/* =========================================================
   GUEST INSTALL VISIBILITY + DETAILS CARD COMPATIBILITY
   Keep explicit event install controls visible outside standalone mode.
   ========================================================= */

.guest-install-card {
    width: 100%;
    min-height: 64px;
    display: none;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 0;
    border: 1px solid rgba(117, 91, 64, .18);
    border-radius: 16px;
    background: #fffdf9;
    color: var(--guest-text, #342d27);
    box-shadow: 0 6px 18px rgba(54, 42, 31, .045);
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

    .guest-install-card.is-available {
        display: grid !important;
    }

.guest-install-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #efe5d9;
    color: var(--guest-primary, #765d43);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.guest-install-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .guest-install-copy strong {
        display: block;
        color: var(--guest-text, #342d27);
        font-size: 14px;
        font-weight: 800;
        line-height: 1.2;
    }

    .guest-install-copy small {
        display: block;
        margin-top: 1px;
        color: var(--guest-muted, #82766c);
        font-size: 11px;
        font-weight: 500;
        line-height: 1.35;
    }

.guest-install-chevron {
    justify-self: end;
    color: #9a8775;
    font-size: 24px;
    line-height: 1;
}

/* Explicit guest install controls are available even before
   beforeinstallprompt fires. JavaScript hides them only when the app is
   already running in standalone mode. */
[data-pwa-install].is-available {
    visibility: visible;
}

@media (max-width: 640px) {
    .guest-install-card,
    .guest-gallery-install-btn.is-available {
        width: 100%;
    }
}

/* =========================================================
   FINAL DETAILS INSTALL CARD OVERRIDE
   Matches the current Details.cshtml markup exactly.
   ========================================================= */

.guest-landing-actions .guest-install-card.guest-pwa-install {
    width: 100% !important;
    min-height: 64px !important;
    display: none !important;
    grid-template-columns: 42px minmax(0, 1fr) 18px !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    border: 1px solid rgba(117, 91, 64, .18) !important;
    border-radius: 16px !important;
    background: #fffdf9 !important;
    color: var(--guest-text, #342d27) !important;
    box-shadow: 0 6px 18px rgba(54, 42, 31, .045) !important;
    text-align: left !important;
    font: inherit !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

    .guest-landing-actions .guest-install-card.guest-pwa-install.is-available {
        display: grid !important;
    }

    /* Remove the duplicate decorative arrows generated by older pwa.css rules. */
    .guest-landing-actions .guest-install-card.guest-pwa-install::before,
    .guest-landing-actions .guest-install-card.guest-pwa-install::after {
        content: none !important;
        display: none !important;
    }

.guest-landing-actions .guest-install-card-icon {
    width: 40px !important;
    height: 40px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    background: #efe5d9 !important;
    color: var(--guest-primary, #765d43) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.guest-landing-actions .guest-install-card-copy {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

    .guest-landing-actions .guest-install-card-copy strong {
        display: block !important;
        margin: 0 !important;
        color: var(--guest-text, #342d27) !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }

    .guest-landing-actions .guest-install-card-copy small {
        display: block !important;
        margin: 1px 0 0 !important;
        color: var(--guest-muted, #82766c) !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;
        white-space: normal !important;
    }

.guest-landing-actions .guest-install-card-chevron {
    justify-self: end !important;
    color: #9a8775 !important;
    font-size: 24px !important;
    line-height: 1 !important;
}

@media (max-width: 640px) {
    .guest-landing-actions .guest-install-card.guest-pwa-install {
        grid-template-columns: 40px minmax(0, 1fr) 18px !important;
        gap: 11px !important;
        padding: 10px 12px !important;
    }
}

/* =========================================================
   FINAL iOS INSTALL SHEET CONTENT RESET
   IMPORTANT: keep this block LAST in pwa.css.
   Older PWA rules target every span inside the step list.
   These rules reset those descendants and restore a responsive layout.
   ========================================================= */

/* Prevent legacy ".pwa-install-sheet-steps span" rules from turning
   every nested span into a padded bordered card. */
.pwa-install-sheet .pwa-install-sheet-steps span {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-align: left !important;
    white-space: normal !important;
}

/* Each instruction row */
.pwa-install-sheet .pwa-install-sheet-steps > li {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 11px 12px !important;
    box-sizing: border-box !important;
    border: 1px solid #ece4dc !important;
    border-radius: 15px !important;
    background: #fff !important;
}

    /* Number */
    .pwa-install-sheet .pwa-install-sheet-steps > li > .pwa-step-number {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        display: grid !important;
        place-items: center !important;
        flex: 0 0 28px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #7b6043 !important;
        color: #fff !important;
        font-size: 11px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        text-align: center !important;
    }

    /* Step icon */
    .pwa-install-sheet .pwa-install-sheet-steps > li > .pwa-step-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        display: grid !important;
        place-items: center !important;
        flex: 0 0 38px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 11px !important;
        background: #f5eee6 !important;
        color: #765d43 !important;
    }

        .pwa-install-sheet .pwa-install-sheet-steps > li > .pwa-step-icon svg {
            width: 18px !important;
            height: 18px !important;
        }

    /* Copy takes all remaining horizontal space */
    .pwa-install-sheet .pwa-install-sheet-steps > li > .pwa-step-copy {
        width: auto !important;
        min-width: 0 !important;
        display: block !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

.pwa-install-sheet .pwa-step-copy > strong,
.pwa-install-sheet .pwa-step-copy > small {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
}

.pwa-install-sheet .pwa-step-copy > strong {
    margin-top: 0 !important;
    margin-bottom: 3px !important;
    color: #342d27 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
}

.pwa-install-sheet .pwa-step-copy > small {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    color: #82776d !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Responsive modal shell - no model-specific dimensions */
.pwa-install-sheet {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    box-sizing: border-box !important;
}

    .pwa-install-sheet[hidden] {
        display: none !important;
    }

    .pwa-install-sheet .pwa-install-sheet-card {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 440px !important;
        min-width: 0 !important;
        max-height: calc( 100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)) ) !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

/* Smaller phones: preserve copy width by hiding decorative step icon only. */
@media (max-width: 360px) {
    .pwa-install-sheet .pwa-install-sheet-steps > li > .pwa-step-icon {
        display: none !important;
    }
}

/* iPad and larger screens: center the card vertically. */
@media (min-width: 768px) {
    .pwa-install-sheet {
        align-items: center !important;
    }

        .pwa-install-sheet .pwa-install-sheet-card {
            max-width: 460px !important;
        }
}

/* Landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
    .pwa-install-sheet {
        align-items: center !important;
    }

        .pwa-install-sheet .pwa-install-sheet-card {
            max-width: 520px !important;
            max-height: calc( 100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)) ) !important;
        }
}
