/* PEAK – app client styles. Only .pwa-* classes and the installed-app mode ([data-app-mode]);
   the website's own CSS (assets/css/app.css) is not touched. Colours come from the experience's theme tokens,
   so both themes work here too. The status bar's room in the installed app is C2's own (.pk2-head-inner, c2.css). */

/* ---------- Installed app (standalone) ---------- */

/* No rubber-band bounce of the whole page. */
[data-app-mode="standalone"] body { overscroll-behavior-y: none; }

/* ---------- Offline banner ---------- */

.pwa-offline {
  position: sticky; top: 0; z-index: 40;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--amber) 85%, #000); color: #fff;
  font-size: 0.86rem; font-weight: 600; text-align: center;
}

/* ---------- Install hint (front page and login, phones only) ---------- */

.pwa-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 55;
  display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px;
  max-width: 520px; margin: 0 auto; padding: 10px 10px 10px 12px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: pwa-rise 0.35s ease-out both;
}
.pwa-banner img { border-radius: 10px; }
.pwa-banner p { margin: 0; display: grid; font-size: 0.82rem; line-height: 1.3; color: var(--muted); min-width: 0; }
.pwa-banner p b { color: var(--text); font-size: 0.92rem; }
.pwa-banner-close {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.pwa-banner-close:hover { background: var(--surface-2); color: var(--text); }
@keyframes pwa-rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .pwa-banner { animation: none; } }

/* ---------- The "App" block on the profile ---------- */

.pwa-card { display: grid; gap: 8px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.pwa-card-title { margin: 0; font-weight: 700; }
.pwa-card p { margin: 0; }
.pwa-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* A new app version is ready (app-shell.js showUpdateBanner). */
.pwa-update {
  /* Centred by margins between 16 px edges: with left: 50% + translateX the box could only use half the screen and
     shrank to a four-line blob on a phone. */
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); z-index: 90;
  width: fit-content; margin-inline: auto;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow);
}
@media (min-width: 760px) { .pwa-update { bottom: 24px; } }
