/* Installed-PWA on-ramp corner button (Phase 0 — monetization unlock).
 *
 * Hidden on the normal web; shown ONLY when a tool runs as an installed PWA
 * (display-mode: standalone, or body.dtc-standalone which pwa-onramp.js adds for
 * iOS Safari's navigator.standalone). Uses a dedicated class so
 * fullscreen-lockdown.css — which hides .hv2/.site-header/.demo-footer/etc. — never
 * hides it: the on-ramp survives the exact fullscreen state a per-tool install
 * launches into.
 *
 * z-index 9000: above fullscreen tool content, but BELOW the payment modal / trial
 * banner (z9900+) so an opened upgrade modal still covers the button.
 */
.pwa-onramp-fab {
    display: none;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    z-index: 9000;
}

@media (display-mode: standalone) {
    .pwa-onramp-fab { display: block; }
}

body.dtc-standalone .pwa-onramp-fab {
    display: block;
}

.pwa-onramp-fab__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.55);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.pwa-onramp-fab__btn:hover {
    background: rgba(17, 24, 39, 0.75);
}

.pwa-onramp-fab__btn:focus-visible {
    outline: 2px solid #2ba8ff;
    outline-offset: 2px;
}

.pwa-onramp-fab__btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* Anon account sheet — Sign in · Save your work (free) · Go Pro.
   Absolute inside the fixed FAB, so it drops down from the button. */
.pwa-onramp-sheet {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 210px;
    padding: 6px;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.pwa-onramp-sheet__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #e5e7eb;
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.pwa-onramp-sheet__item:hover,
.pwa-onramp-sheet__item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.pwa-onramp-sheet__item--pro {
    color: #fff;
    font-weight: 700;
}

.pwa-onramp-sheet__tag {
    margin-left: auto;
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0a0a0f;
    background: #2ba8ff;
    border-radius: 999px;
}

/* First-run soft card — bottom sheet, shown once on first standalone launch.
   z below modals/banners; position:fixed so it's independent of the FAB. */
.pwa-firstrun {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 8999;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px 40px 16px 16px;
    background: rgba(17, 24, 39, 0.97);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.pwa-firstrun__x {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.pwa-firstrun__title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.pwa-firstrun__body {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #d1d5db;
}

.pwa-firstrun__cta {
    display: inline-block;
    padding: 9px 16px;
    background: #2ba8ff;
    color: #0a0a0f;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 9px;
}
