.pwa-notice {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 14px;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.875rem;
}

.pwa-notice p {
    flex: 1;
    margin: 0;
    color: inherit;
    line-height: 1.45;
}

.pwa-notice-brand {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 9px;
    object-fit: contain;
}

.pwa-notice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-notice button {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 0;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}

.pwa-notice button:disabled {
    cursor: wait;
    opacity: 0.75;
}

.pwa-navigation-controls {
    position: fixed;
    top: max(8px, calc(env(safe-area-inset-top) + 8px));
    right: max(14px, env(safe-area-inset-right));
    z-index: 9990;
    display: flex;
    gap: 7px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(10px);
}

.pwa-navigation-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    color: #334155;
    background: #f1f5f9;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    touch-action: manipulation;
}

.pwa-navigation-button:hover,
.pwa-navigation-button:focus-visible {
    color: #ffffff;
    background: #2563eb;
    outline: none;
}

.pwa-navigation-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pwa-navigation-button:disabled {
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed;
    opacity: 0.65;
}

.pwa-navigation-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pwa-navigation-refresh.is-refreshing svg {
    animation: pwa-navigation-spin 0.7s linear infinite;
}

html.pwa-standalone .pwa-existing-refresh {
    display: none !important;
}

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

.pwa-notice-primary {
    color: #ffffff;
    background: #2563eb;
}

.pwa-notice-secondary {
    color: #475569;
    background: #eef2f7;
}

#pwa-offline-notice {
    border-left: 4px solid #f59e0b;
}

[data-theme="dark"] .pwa-notice {
    color: #f8fafc;
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .pwa-notice-secondary {
    color: #e2e8f0;
    background: #334155;
}

[data-theme="dark"] .pwa-navigation-controls {
    background: rgba(30, 41, 59, 0.94);
    border-color: #475569;
}

[data-theme="dark"] .pwa-navigation-button {
    color: #e2e8f0;
    background: #334155;
}

[data-theme="dark"] .pwa-navigation-button:hover,
[data-theme="dark"] .pwa-navigation-button:focus-visible {
    color: #ffffff;
    background: #2563eb;
}

@media (max-width: 600px) {
    .pwa-navigation-controls {
        top: max(8px, calc(env(safe-area-inset-top) + 8px));
        right: max(10px, env(safe-area-inset-right));
    }

    .pwa-notice {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        max-width: none;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .pwa-notice-brand {
        align-self: flex-start;
    }

    .pwa-notice-actions {
        justify-content: flex-end;
    }
}
