/* REALM Marketplace — install banner + iPhone steps sheet */
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 52px 14px 14px;
  background: var(--forest, #0b2e1a);
  color: #fff;
  border: 2px solid var(--orange, #f58214);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-family: var(--font, "Archivo", "Helvetica Neue", Arial, sans-serif);
}
.pwa-banner.show { transform: none; opacity: 1; }
.pwa-banner img { width: 48px; height: 48px; border-radius: 10px; flex: none; }
.pwa-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 0.93rem; line-height: 1.35; }
.pwa-banner-text strong { font-size: 1rem; }
.pwa-banner-text span { color: #cfe0d3; }
.pwa-banner-actions { display: contents; }
.pwa-banner .btn.small { min-height: 44px; padding: 0 18px; white-space: nowrap; }
.pwa-close {
  position: absolute;
  top: 4px;
  right: 4px;
  appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.pwa-close:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 480px) {
  .pwa-banner { grid-template-columns: 48px 1fr; }
  .pwa-banner .btn.small { grid-column: 1 / -1; width: 100%; }
}
@media (min-width: 760px) {
  .pwa-banner { left: auto; right: 24px; bottom: 24px; max-width: 460px; }
}

.pwa-sheet {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(11, 46, 26, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font, "Archivo", "Helvetica Neue", Arial, sans-serif);
}
.pwa-sheet-card {
  background: #fff;
  color: var(--ink, #0b2e1a);
  border-radius: 16px;
  padding: 22px 20px;
  width: 100%;
  max-width: 440px;
  text-align: center;
}
.pwa-sheet-card img { border-radius: 14px; margin-bottom: 8px; }
.pwa-sheet-card h2 { margin: 0 0 10px; font-size: 1.3rem; }
.pwa-sheet-card ol { text-align: left; margin: 0 0 12px; padding-left: 22px; line-height: 1.6; font-size: 1rem; }
.pwa-sheet-card li { margin-bottom: 6px; }
.pwa-sheet-card p { color: var(--muted, #4a5d50); margin: 0 0 14px; line-height: 1.5; }
.pwa-note { background: var(--field, #eef3eb); padding: 10px 12px; border-radius: 10px; }
.pwa-share { display: inline-block; color: #0a84ff; font-size: 1.2em; vertical-align: -2px; }
.pwa-sheet-card .btn { width: 100%; min-height: 48px; }
@media (min-width: 760px) {
  .pwa-sheet { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pwa-banner { transition: none; }
}

/* ---------- v2: permanent "Get the app" button + Get the app page ---------- */
[data-install-app][hidden], [data-in-app][hidden] { display: none !important; }
.pwa-ico { width: 1.25em; height: 1.25em; vertical-align: -0.25em; color: #0a84ff; }
.pwa-key { display: inline-block; min-width: 1.6em; padding: 0 0.3em; text-align: center; font-weight: 800; border: 1.5px solid currentColor; border-radius: 6px; line-height: 1.35; }

/* Header pill: <a class="get-app" href="/get-app" data-install-app>…</a> */
a.get-app, .nav a.get-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 2px solid var(--orange, #f58214);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
a.get-app svg { width: 20px; height: 20px; flex: none; }
a.get-app:hover, .nav a.get-app:hover { background: var(--orange, #f58214); color: var(--forest, #0b2e1a); }
a.get-app .lbl-short { display: none; }
@media (max-width: 760px) {
  a.get-app .lbl { display: none; }
  a.get-app .lbl-short { display: inline; }
  a.get-app, .nav a.get-app { padding: 6px 12px; }
}
@media (max-width: 400px) {
  a.get-app svg { display: none; }
  a.get-app, .nav a.get-app { padding: 6px 11px; min-height: 38px; }
}

/* Phones: a slim strip right under the header. The header row is too full for a pill once a member is logged in
   (bell + account menu), so on phones use this strip and give the pill the extra class "wide-only".
   <a class="get-app-bar" href="/get-app" data-install-app>…</a> placed straight after </header>. */
.get-app-bar { display: none; }
@media (max-width: 760px) {
  a.get-app.wide-only, .nav a.get-app.wide-only { display: none; }
  a.get-app-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 8px 16px;
    background: #14432a;
    color: #fff;
    font-family: var(--font, "Archivo", "Helvetica Neue", Arial, sans-serif);
    font-size: 1.02rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 3px solid var(--orange, #f58214);
  }
  a.get-app-bar svg { width: 24px; height: 24px; flex: none; color: var(--orange-light, #ff9e45); }
  a.get-app-bar .go { color: var(--orange-light, #ff9e45); font-size: 1.3rem; line-height: 1; }
  a.get-app-bar:active { background: #1b5535; }
}

/* Get the app page (big type, big targets: written for older eyes and thumbs) */
.ga { max-width: 760px; padding-top: 28px; padding-bottom: 8px; font-size: 1.12rem; line-height: 1.6; }
.ga-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.ga-hero img { width: 96px; height: 96px; border-radius: 22px; flex: none; box-shadow: 0 4px 14px rgba(11, 46, 26, 0.18); }
.ga-hero h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 5.5vw, 2.4rem); line-height: 1.15; }
.ga-lead { margin: 0; color: var(--muted, #4a5d50); }
.ga-cta { margin: 0 0 22px; }
.ga-button { width: 100%; min-height: 68px; font-size: 1.35rem; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 14px; }
.ga-button svg { width: 30px; height: 30px; flex: none; }
.ga-status { margin: 10px 0 0; color: var(--muted, #4a5d50); text-align: center; font-size: 1.02rem; min-height: 1.6em; }
.ga-inapp { margin-bottom: 22px; }
.ga-steps { display: flex; flex-direction: column; gap: 16px; }
.ga-card { background: var(--card, #fff); border: 1.5px solid var(--line, #cad6c6); border-radius: 14px; padding: 18px 20px 14px; scroll-margin-top: 140px; }
.ga-card h2 { margin: 0 0 10px; font-size: 1.35rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.ga-sub { font-size: 0.95rem; font-weight: 500; color: var(--muted, #4a5d50); }
.ga-tag { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--orange, #f58214); color: #fff; padding: 3px 9px; border-radius: 99px; }
.ga-card.is-mine { border-color: var(--orange, #f58214); border-width: 2.5px; box-shadow: 0 4px 18px rgba(245, 130, 20, 0.16); }
.ga-card ol { list-style: none; counter-reset: ga; margin: 0 0 6px; padding: 0; }
.ga-card ol li { counter-increment: ga; position: relative; padding: 9px 0 9px 54px; min-height: 52px; }
.ga-card ol li::before {
  content: counter(ga);
  position: absolute; left: 0; top: 7px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--forest, #0b2e1a); color: #fff; font-weight: 800; font-size: 1.15rem;
  display: grid; place-items: center;
}
.ga-card p { margin: 0 0 10px; }
.ga-after { margin-top: 16px; background: var(--field, #eef3eb); }
.ga-share { margin: 22px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ga-share .btn { min-height: 48px; }
.ga-help { background: #fff; border-left: 5px solid var(--orange, #f58214); border-radius: 10px; padding: 14px 16px; margin: 8px 0 28px; }
.ga-help a { font-weight: 700; overflow-wrap: anywhere; } /* a long support email must wrap at large text sizes */
@keyframes ga-flash { 0% { background: #ffe9d2; } 100% { background: var(--card, #fff); } }
.ga-card.flash { animation: ga-flash 1.6s ease-out 1; }
@media (max-width: 480px) {
  .ga-hero img { width: 72px; height: 72px; border-radius: 16px; }
  .ga-card { padding: 16px 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ga-card.flash { animation: none; }
}

/* v2.1: Windows and Mac cards */
.ga-card h3 { margin: 10px 0 4px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted, #4a5d50); }
.ga-alt { background: var(--field, #eef3eb); border-radius: 10px; padding: 10px 12px; font-size: 1rem; }

/* v2.2: large text (older eyes set their phone to 115–130% text). Nothing may push the page sideways. */
.ga-hero > div { min-width: 0; }
.ga-hero h1, .ga-card h2, .ga-card li, .ga-lead { overflow-wrap: break-word; }
.ga-card, .ga-cta, .ga-steps { min-width: 0; max-width: 100%; }
@media (max-width: 480px) {
  .ga-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ga-hero h1 { font-size: clamp(1.5rem, 7.2vw, 2rem); }
  .ga-button { font-size: 1.2rem; min-height: 64px; padding-left: 10px; padding-right: 10px; }
  .ga-card ol li { padding-left: 48px; }
}
a.get-app-bar span:not(.go) { min-width: 0; }
/* the pop-up banner must never be wider than the screen, at any text size */
.pwa-banner { max-width: calc(100vw - 24px); box-sizing: border-box; }
.pwa-banner-text { overflow-wrap: break-word; }
@media (max-width: 480px) {
  .pwa-banner { grid-template-columns: 48px minmax(0, 1fr); }
  .pwa-banner .btn.small { white-space: normal; }
}
