/* ============ PWA: splash, update banner, install help, safe areas ============ */
.splash-screen {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-primary); color: var(--text-primary);
  transition: opacity .35s ease;
}
.splash-screen.hide { opacity: 0; pointer-events: none; }
.splash-mark { font-size: 2.75rem; color: var(--accent-primary); animation: splashPulse 1.4s ease-in-out infinite; }
.splash-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 2.125rem; font-weight: 600; }
.splash-tagline { font-size: 0.875rem; color: var(--text-secondary); }
@keyframes splashPulse { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash-mark { animation: none; } }

#update-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 9999;
  width: min(560px, calc(100% - 32px));
  align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px;
  background: var(--text-primary); color: var(--bg-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: 0.875rem;
}
#update-banner .ub-actions { display: flex; gap: 8px; }
#update-banner button {
  border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent-primary); color: #fff;
}
#update-banner #fsq-update-later { background: transparent; color: inherit; text-decoration: underline; }

.help-steps { padding-left: 22px; line-height: 1.8; font-size: 0.875rem; }
.help-steps li { margin-bottom: 4px; }
.app-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; font-size: 0.875rem; margin: 10px 0 14px; }
.app-status dt { color: var(--text-secondary); }
.app-status dd { margin: 0; font-weight: 600; text-align: right; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Installed on a phone: keep content clear of the notch and home bar. */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.topnav { padding-top: max(12px, env(safe-area-inset-top)); }
.app-footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

@media print { #update-banner, .splash-screen { display: none !important; } }
/* Start-up safety net (scripts/boot.js) */
.splash-help { margin-top: 18px; text-align: center; max-width: 320px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.splash-help-note { font-size: 0.8125rem; color: var(--text-secondary); }

/* Free demo only (html.is-demo is set by scripts/core.js when the demo's shim ran) */
html.is-demo .demo-hide { display: none !important; }
.demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 14px; font-size: 0.8125rem; text-align: center;
  background: var(--callout-bg, var(--highlight)); color: var(--text); border-bottom: 1px solid var(--border);
}
.demo-bar .btn { text-decoration: none; }
@media (max-width: 520px) {
  .demo-bar { flex-wrap: nowrap; font-size: 0.75rem; padding: 6px 10px; gap: 8px; }
  .demo-bar .demo-bar-extra { display: none; }
  .demo-bar .btn { white-space: nowrap; padding: 5px 10px; }
}
.demo-card { border: 2px solid var(--accent-1-deep, var(--accent-primary)); }
@media print { .demo-bar { display: none !important; } }
