.pwa-controls {
    font: 14px/1.5 'Manrope', system-ui, -apple-system, sans-serif;
    color: #191c1d;
    margin: 0;
}

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

.pwa-connection {
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left));
    background: #fbe7e5;
    color: #8f3d35;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 10px rgba(143, 61, 53, 0.08);
}

.pwa-toast-stack {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 1045;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(376px, calc(100vw - 24px));
    pointer-events: none;
}

.pwa-toast {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: #ffffff;
    color: #191c1d;
    box-shadow:
        0 18px 40px rgba(13, 28, 50, 0.14),
        0 2px 10px rgba(13, 28, 50, 0.06),
        inset 0 0 0 1px rgba(13, 28, 50, 0.08);
    animation: pwaToastIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaToastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-toast-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f3f4f5;
    overflow: hidden;
}

.pwa-toast-icon--update {
    background: #fff5dc;
    color: #8f6720;
}

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

.pwa-toast-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #0d1c32;
}

.pwa-toast-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #5d636a;
}

.pwa-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.pwa-toast-close:hover {
    background: #f3f4f5;
    color: #0d1c32;
}

.pwa-toast-close:focus-visible,
.pwa-btn-primary:focus-visible,
.pwa-btn-ghost:focus-visible {
    outline: 3px solid #d6a64f;
    outline-offset: 2px;
}

.pwa-toast-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pwa-btn-primary {
    border: none;
    border-radius: 999px;
    min-height: 38px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0d1c32, #39475f);
    color: #ffffff;
    font: 700 13px/1.2 inherit;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(13, 28, 50, 0.16);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.pwa-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.pwa-btn-ghost {
    border: none;
    border-radius: 999px;
    min-height: 38px;
    padding: 8px 14px;
    background: transparent;
    color: #5d636a;
    font: 600 13px/1.2 inherit;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.pwa-btn-ghost:hover {
    background: #f3f4f5;
    color: #0d1c32;
}

@media (max-width: 767.98px) {
    .pwa-toast-stack {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: auto;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 479.98px) {
    .pwa-toast-actions {
        justify-content: stretch;
    }

    .pwa-toast-actions button {
        flex: 1 1 0;
    }
}

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