/* ================================================================
   PWA install banner
   ================================================================ */
#pwa-install-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1080;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.9));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.75));
    box-shadow: 0 20px 45px -18px rgba(30, 27, 58, 0.35), 0 2px 8px -2px rgba(30, 27, 58, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-width: 480px;
    margin: 0 auto;
}
#pwa-install-banner.is-visible { display: flex; }
#pwa-install-banner img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}
#pwa-install-banner .pwa-banner-text {
    flex: 1;
    min-width: 0;
}
#pwa-install-banner .pwa-banner-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary, #1E1B3A);
}
#pwa-install-banner .pwa-banner-text span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary, #5B5A72);
}
#pwa-install-banner button {
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}
#pwa-install-banner .pwa-install-btn {
    background: #6366F1;
    color: #fff;
}
#pwa-install-banner .pwa-dismiss-btn {
    background: transparent;
    color: var(--text-secondary, #5B5A72);
    padding: 8px 10px;
}

/* ================================================================
   Download consent modal — a real user-gesture click that
   immediately precedes the actual download call, and the closest
   web equivalent to the "allow storage access?" prompt native apps
   show. Also doubles as user-facing status when a download starts
   or fails.
   ================================================================ */
.dl-consent-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(20, 18, 40, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dl-consent-card {
    width: 100%;
    max-width: 320px;
    background: var(--glass-bg, #fff);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.75));
    border-radius: 24px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.dl-consent-card .dl-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}
.dl-consent-card h3 {
    font-size: 1rem;
    margin: 0 0 6px;
    color: var(--text-primary, #1E1B3A);
}
.dl-consent-card p {
    font-size: 0.82rem;
    color: var(--text-secondary, #5B5A72);
    margin: 0 0 18px;
    line-height: 1.5;
}
.dl-consent-card .dl-actions {
    display: flex;
    gap: 10px;
}
.dl-consent-card button {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.dl-consent-card .dl-allow {
    background: #6366F1;
    color: #fff;
}
.dl-consent-card .dl-cancel {
    background: rgba(99,102,241,0.1);
    color: var(--text-primary, #1E1B3A);
}
.dl-consent-card .dl-remember {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-secondary, #5B5A72);
}

/* Small inline toast used to report the actual outcome of a download
   (which strategy worked, or that all of them failed) — replaces
   silently doing nothing when something goes wrong. */
.dl-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    z-index: 1095;
    background: #1E1B3A;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.25s ease;
    max-width: 90vw;
    text-align: center;
}
.dl-toast.is-visible { opacity: 1; }
