.lf-pwa-prompt {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10620;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(430px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 15px;
    background: linear-gradient(145deg, #20242a 0%, #171a1f 100%);
    color: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
    animation: lf-pwa-in 180ms ease-out;
}

.lf-pwa-prompt__icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.32);
}

.lf-pwa-prompt__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.lf-pwa-prompt__copy strong {
    font-size: 0.86rem;
    font-weight: 700;
}

.lf-pwa-prompt__copy span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.73rem;
    line-height: 1.35;
}

.lf-pwa-prompt__actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lf-pwa-prompt__primary,
.lf-pwa-prompt__close {
    border: 0;
    border-radius: 9px;
    font: inherit;
    cursor: pointer;
}

.lf-pwa-prompt__primary {
    padding: 0.55rem 0.78rem;
    background: #f12c4c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.lf-pwa-prompt__primary:hover,
.lf-pwa-prompt__primary:focus-visible {
    background: #d61f3d;
}

.lf-pwa-prompt__close {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 1.2rem;
}

.lf-pwa-prompt__close:hover,
.lf-pwa-prompt__close:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

[data-theme="light"] .lf-pwa-prompt {
    border-color: rgba(15, 23, 42, 0.13);
    background: linear-gradient(145deg, #fff 0%, #f5f7fa 100%);
    color: #111827;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .lf-pwa-prompt__copy span {
    color: rgba(17, 24, 39, 0.62);
}

[data-theme="light"] .lf-pwa-prompt__close {
    color: rgba(17, 24, 39, 0.55);
}

[data-theme="light"] .lf-pwa-prompt__close:hover,
[data-theme="light"] .lf-pwa-prompt__close:focus-visible {
    background: rgba(15, 23, 42, 0.07);
    color: #111827;
}

@keyframes lf-pwa-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767.98px) {
    .lf-pwa-prompt {
        right: 14px;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .lf-pwa-prompt__icon {
        width: 42px;
        height: 42px;
    }

    .lf-pwa-prompt__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lf-pwa-prompt { animation: none; }
}

.lf-pwa-update-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(7, 9, 12, 0.78);
    backdrop-filter: blur(9px);
    animation: lf-pwa-overlay-in 160ms ease-out;
}

.lf-pwa-update-card {
    width: min(410px, 100%);
    padding: 30px 28px 27px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    outline: none;
    background: linear-gradient(155deg, #20242a 0%, #15181d 100%);
    color: #fff;
    text-align: center;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.lf-pwa-update-symbol {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto 17px;
    border: 1px solid rgba(241, 44, 76, 0.34);
    border-radius: 17px;
    background: rgba(241, 44, 76, 0.09);
}

.lf-pwa-update-symbol span {
    position: absolute;
    inset: 13px;
    border: 3px solid transparent;
    border-top-color: #f12c4c;
    border-right-color: #f12c4c;
    border-radius: 50%;
    animation: lf-pwa-update-spin 1.15s linear infinite;
}

.lf-pwa-update-symbol span:last-child {
    inset: 20px;
    border-width: 2px;
    border-top-color: #fff;
    border-right-color: transparent;
    animation-direction: reverse;
    animation-duration: 0.8s;
}

.lf-pwa-update-card strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 750;
}

.lf-pwa-update-card p {
    min-height: 1.4em;
    margin: 7px 0 18px;
    color: rgba(255, 255, 255, 0.63);
    font-size: 0.8rem;
}

.lf-pwa-update-card small {
    display: block;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.68rem;
}

.lf-pwa-update-progress {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.lf-pwa-update-progress__bar {
    position: absolute;
    inset-block: 0;
    left: -38%;
    width: 38%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d61f3d, #ff5c7a, #f12c4c);
    box-shadow: 0 0 18px rgba(241, 44, 76, 0.52);
    animation: lf-pwa-update-progress 1.15s ease-in-out infinite;
}

.lf-pwa-update-overlay.is-complete .lf-pwa-update-symbol {
    border-color: rgba(46, 212, 122, 0.38);
    background: rgba(46, 212, 122, 0.1);
}

.lf-pwa-update-overlay.is-complete .lf-pwa-update-symbol::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 15px;
    width: 14px;
    height: 23px;
    border-right: 3px solid #2ed47a;
    border-bottom: 3px solid #2ed47a;
    transform: rotate(45deg);
}

.lf-pwa-update-overlay.is-complete .lf-pwa-update-symbol span { display: none; }

.lf-pwa-update-overlay.is-complete .lf-pwa-update-progress__bar {
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #16a34a, #2ed47a);
    box-shadow: 0 0 18px rgba(46, 212, 122, 0.42);
    animation: none;
}

[data-theme="light"] .lf-pwa-update-overlay {
    background: rgba(226, 232, 240, 0.72);
}

[data-theme="light"] .lf-pwa-update-card {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(155deg, #fff 0%, #f5f7fa 100%);
    color: #111827;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .lf-pwa-update-card p { color: rgba(17, 24, 39, 0.62); }
[data-theme="light"] .lf-pwa-update-card small { color: rgba(17, 24, 39, 0.42); }
[data-theme="light"] .lf-pwa-update-progress { background: rgba(15, 23, 42, 0.09); }

@keyframes lf-pwa-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lf-pwa-update-spin {
    to { transform: rotate(360deg); }
}

@keyframes lf-pwa-update-progress {
    0% { left: -38%; }
    55% { width: 52%; }
    100% { left: 100%; width: 38%; }
}

@media (prefers-reduced-motion: reduce) {
    .lf-pwa-update-overlay { animation: none; }
    .lf-pwa-update-symbol span { animation-duration: 2.4s; }
    .lf-pwa-update-progress__bar { animation-duration: 2.4s; }
}
