/* Install-as-app prompt + update toast (rx-install.js).
   Self-contained colours with theme fallbacks, so it also works on the login page,
   which does not load rx-glossy.css. */

.rxi-sheet {
    --rxi-navy: var(--ss-navy, #0b3057);
    --rxi-navy-2: var(--ss-navy-2, #123f6f);
    --rxi-ink: var(--ss-navy-ink, #0a2442);
    --rxi-forest: var(--ss-forest, #22694b);
    --rxi-line: var(--ss-line, #e0e6df);
    --rxi-muted: var(--ss-muted, #53647a);
    --rxi-mint: var(--ss-mint, #edf5ef);
    --rxi-ease: cubic-bezier(.16, 1, .3, 1);
    position: fixed;
    z-index: 1090;
    left: 50%;
    bottom: calc(var(--bar, 0px) + 14px + env(safe-area-inset-bottom, 0px));
    width: min(440px, calc(100vw - 32px));
    transform: translate(-50%, 0);
    background: #fff;
    color: var(--rxi-ink);
    border: 1px solid var(--rxi-line);
    border-radius: 18px;
    padding: 16px 16px 14px;
    box-shadow: 0 24px 48px -18px rgba(10, 36, 66, .34), 0 6px 16px -8px rgba(10, 36, 66, .16);
    font-family: var(--ss-text, "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    opacity: 0;
    translate: 0 18px;
    filter: blur(2px);
    transition: opacity .45s var(--rxi-ease), translate .55s var(--rxi-ease), filter .45s var(--rxi-ease);
    pointer-events: none;
}
.rxi-sheet.is-open { opacity: 1; translate: 0 0; filter: none; pointer-events: auto; }

.rxi-head { display: flex; gap: 14px; align-items: center; }
.rxi-icon {
    flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px; background: #fff;
    border: 1px solid var(--rxi-line);
    box-shadow: 0 6px 14px -8px rgba(10, 36, 66, .35);
    display: grid; place-items: center; overflow: hidden;
}
.rxi-icon img { width: 44px; height: 44px; object-fit: contain; }
.rxi-title {
    margin: 0; font: 700 1.02rem/1.25 var(--ss-display, "Montserrat", "Hanken Grotesk", system-ui, sans-serif);
    color: var(--rxi-navy); letter-spacing: -.01em;
}
.rxi-sub { margin: 3px 0 0; font-size: .86rem; line-height: 1.4; color: var(--rxi-muted); }
.rxi-close {
    margin-left: auto; align-self: flex-start; flex: 0 0 auto;
    width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--rxi-muted);
    display: grid; place-items: center; cursor: pointer; font-size: 1.1rem;
}
.rxi-close:hover { background: var(--rxi-mint); color: var(--rxi-ink); }

.rxi-actions { display: flex; gap: 8px; margin-top: 14px; }
.rxi-btn {
    appearance: none; border: 0; cursor: pointer; min-height: 44px; border-radius: 12px; padding: 0 18px;
    font: 600 .95rem/1 inherit; font-family: inherit;
    transition: transform .2s var(--rxi-ease), box-shadow .2s var(--rxi-ease), background-color .2s var(--rxi-ease);
}
.rxi-btn:active { transform: translateY(1px) scale(.99); }
.rxi-primary {
    flex: 1 1 auto; color: #fff;
    background: linear-gradient(180deg, var(--rxi-navy-2), var(--rxi-navy));
    box-shadow: 0 10px 20px -10px rgba(11, 48, 87, .6), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.rxi-primary:hover { box-shadow: 0 14px 24px -10px rgba(11, 48, 87, .65), inset 0 1px 0 rgba(255, 255, 255, .18); }
.rxi-ghost { background: transparent; color: var(--rxi-muted); }
.rxi-ghost:hover { background: var(--rxi-mint); color: var(--rxi-ink); }
.rxi-btn:focus-visible, .rxi-close:focus-visible { outline: 3px solid rgba(62, 143, 82, .45); outline-offset: 2px; }

/* Tablets and desktops: dock bottom-right, clear of forms and above the assistant button */
@media (min-width: 768px) {
    .rxi-sheet { left: auto; right: 24px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: none; width: 380px; }
}

/* iPhone / iPad: Safari has no install API — show the two taps instead */
.rxi-steps { list-style: none; margin: 14px 0 2px; padding: 0; display: grid; gap: 8px; counter-reset: rxi; }
.rxi-steps li {
    counter-increment: rxi; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px; background: var(--rxi-mint); font-size: .92rem;
}
.rxi-steps li::before {
    content: counter(rxi); flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: var(--rxi-forest); color: #fff; font-weight: 700; font-size: .8rem;
}
.rxi-steps .bi { font-size: 1.15rem; color: var(--rxi-navy); }
.rxi-steps b { font-weight: 600; }

/* "Install app" buttons placed in pages (data-rx-install) stay hidden until installing is possible */
[data-rx-install][hidden] { display: none !important; }

/* update-ready toast */
.rxi-toast {
    position: fixed; z-index: 1091; left: 50%;
    top: calc(14px + env(safe-area-inset-top, 0px));
    transform: translate(-50%, 0);
    display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 16px; border-radius: 14px;
    background: var(--ss-navy-ink, #0a2442); color: #fff;
    font: 500 .9rem/1.3 var(--ss-text, "Hanken Grotesk", system-ui, sans-serif);
    box-shadow: 0 18px 36px -14px rgba(10, 36, 66, .5);
    opacity: 0; translate: 0 -12px; transition: opacity .4s cubic-bezier(.16, 1, .3, 1), translate .5s cubic-bezier(.16, 1, .3, 1);
    pointer-events: none; max-width: calc(100vw - 32px);
}
.rxi-toast.is-open { opacity: 1; translate: 0 0; pointer-events: auto; }
.rxi-toast button {
    border: 0; border-radius: 10px; min-height: 36px; padding: 0 14px; cursor: pointer;
    background: #fff; color: var(--ss-navy, #0b3057); font: 600 .88rem/1 inherit; font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
    .rxi-sheet, .rxi-toast { transition: opacity .2s linear; translate: 0 0; filter: none; }
}
@media print { .rxi-sheet, .rxi-toast { display: none !important; } }
