/* Install-on-phone guide: a tabbed (Android / iOS) animated walkthrough shown
   from the login screen. Self-contained, theme-aware (uses app.css vars). */
.pwa-dl { width: 100%; background: none; cursor: pointer; font-family: inherit; }
.pwa-dl.installed { color: var(--online); border-color: color-mix(in srgb, var(--online) 50%, var(--border)); }

.pg-ov { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.62); backdrop-filter: blur(5px); animation: pg-fade .18s ease; }
@keyframes pg-fade { from { opacity: 0; } }
.pg-modal { width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); animation: pg-pop .2s ease; }
@keyframes pg-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.pg-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.pg-head h2 { font-size: 18px; margin: 0; flex: 1; color: var(--text-primary); }
.pg-x { background: none; border: none; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.pg-x:hover { color: var(--text-primary); background: var(--bg-elevated); }
.pg-sub { padding: 4px 20px 0; color: var(--text-secondary); font-size: 13.5px; }
.pg-installed { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--online); background: color-mix(in srgb, var(--online) 12%, transparent); border: 1px solid color-mix(in srgb, var(--online) 35%, transparent); }

.pg-tabs { display: flex; gap: 8px; padding: 16px 20px 0; }
.pg-tab { flex: 1; padding: 11px; border-radius: 12px 12px 0 0; border: 1px solid var(--border); border-bottom: none; background: var(--bg-primary); color: var(--text-secondary); font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pg-tab.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: inset 0 -3px 0 var(--accent); }

.pg-body { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 22px 20px; align-items: start; }
@media (max-width: 600px) { .pg-body { grid-template-columns: 1fr; gap: 18px; } .pg-phone-wrap { order: -1; } }

/* ---- phone mockup ---- */
.pg-phone-wrap { display: flex; justify-content: center; }
.pg-phone { position: relative; width: 220px; height: 440px; border-radius: 34px; background: #0c0d10; border: 9px solid #16171b; box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 0 0 1px #2a2c33; overflow: hidden; }
.pg-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 92px; height: 20px; background: #16171b; border-radius: 0 0 14px 14px; z-index: 6; }
.pg-scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: linear-gradient(160deg, var(--bg-secondary), var(--bg-primary)); }
.pg-bar { display: flex; align-items: center; gap: 8px; padding: 26px 12px 8px; font-size: 12px; color: var(--text-secondary); }
.pg-bar .pg-urlbox { flex: 1; background: var(--bg-elevated); border-radius: 999px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); overflow: hidden; white-space: nowrap; }
.pg-icbtn { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 16px; color: var(--text-primary); }
.pg-canvas { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); }
.pg-canvas .pg-logo { font-size: 40px; color: var(--accent); filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--accent) 60%, transparent)); }
.pg-canvas .pg-name { font-weight: 700; color: var(--text-primary); }
/* iOS bottom Safari toolbar */
.pg-toolbar { display: flex; align-items: center; justify-content: space-around; padding: 10px 8px 14px; border-top: 1px solid var(--border); font-size: 18px; color: var(--accent); }

/* the highlighted "tap" target ring */
.pg-tap { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); animation: pg-pulse 1.6s ease-out infinite; pointer-events: none; }
@keyframes pg-pulse { 0% { transform: scale(.55); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* the action-sheet / menu that slides in showing "Add to home screen" */
.pg-sheet { position: absolute; left: 8px; right: 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.5); z-index: 5; }
.pg-sheet.bottom { bottom: 12px; animation: pg-up 2.6s ease-in-out infinite; }
.pg-sheet.top { top: 56px; right: 10px; left: auto; width: 168px; animation: pg-down 2.6s ease-in-out infinite; }
@keyframes pg-up { 0%, 18% { transform: translateY(120%); opacity: 0; } 34%, 88% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(120%); opacity: 0; } }
@keyframes pg-down { 0%, 18% { transform: translateY(-12px) scale(.96); opacity: 0; } 34%, 88% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-12px) scale(.96); opacity: 0; } }
.pg-srow { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; font-size: 12.5px; color: var(--text-secondary); }
.pg-srow .pg-si { width: 18px; text-align: center; }
.pg-srow.hot { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text-primary); font-weight: 700; animation: pg-glow 2.6s ease-in-out infinite; }
@keyframes pg-glow { 0%, 40%, 100% { box-shadow: 0 0 0 0 transparent; } 60%, 80% { box-shadow: 0 0 0 2px var(--accent); } }

/* ---- steps + actions (right column) ---- */
.pg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pg-steps li { display: flex; gap: 12px; align-items: flex-start; }
.pg-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-contrast); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.pg-step-t { font-size: 14px; color: var(--text-primary); line-height: 1.45; }
.pg-step-t b { color: var(--text-primary); }
.pg-step-t .pg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; margin: 0 1px; border-radius: 6px; background: var(--bg-elevated); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }

.pg-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.pg-btn { padding: 12px 16px; border-radius: 12px; border: none; font-size: 14.5px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pg-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-contrast); }
.pg-btn.ghost { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.pg-btn[disabled] { opacity: .55; cursor: default; }
.pg-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.pg-note.ok { color: var(--online); }
.pg-note.warn { color: var(--danger); }

.pg-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 4100; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.pg-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
