/* Installable app + notifications UI (pwa.js). Soulute pages only. */

/* Header: pill on desktop, icon-only circle on phones (the header is already full there). */
.pwa-install-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pwa-install-header:hover { background: var(--green-tint-2); border-color: var(--green-light); }
.pwa-install-header[hidden] { display: none; }

@media (max-width: 720px) {
  .pwa-install-header { width: 34px; padding: 0; justify-content: center; }
  .pwa-install-header-label { display: none; }
}
@media (max-width: 360px) {
  /* Very narrow phones: the header holds support + install icons, language and the login
     link; tighten the gaps so the install icon stays visible on the landing too. */
  .site-header .header-actions { gap: 6px; }
}

/* Hero: app-store-badge style button under the main CTAs. */
.pwa-install-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 22px 10px 14px;
  border: none;
  border-radius: 16px;
  background: var(--dark);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  justify-self: start;
  transition: transform 0.1s ease, background 0.15s ease;
}
.pwa-install-cta:hover { background: var(--dark-card); }
.pwa-install-cta:active { transform: scale(0.98); }
.pwa-install-cta[hidden] { display: none; }
.pwa-install-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--green-light);
  color: var(--dark);
}
.pwa-install-cta-text { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 600px) {
  /* Line up with the full-width hero buttons above it. */
  .pwa-install-cta { width: 100%; justify-content: center; }
}
.pwa-install-cta-title { font-size: 15px; font-weight: 700; }
.pwa-install-cta-sub { font-size: 12px; color: rgba(255, 255, 255, 0.62); }

/* Install instructions: bottom sheet on phones, centered card on desktop. */
.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 20, 16, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pwa-modal.is-visible { opacity: 1; }
.pwa-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  color: var(--ink);
  transform: translateY(24px);
  transition: transform 0.25s ease;
}
.pwa-modal.is-visible .pwa-sheet { transform: none; }
@media (min-width: 721px) {
  .pwa-modal { align-items: center; }
  .pwa-sheet { border-radius: 24px; padding-bottom: 24px; }
}
.pwa-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pwa-sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-right: 36px; }
.pwa-sheet-head img { border-radius: 14px; flex-shrink: 0; }
.pwa-sheet-title { font-size: 18px; font-weight: 800; line-height: 1.25; }
.pwa-sheet-sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.pwa-steps { list-style: none; counter-reset: pwa-step; margin: 0 0 16px; padding: 0; }
.pwa-steps li {
  counter-increment: pwa-step;
  position: relative;
  padding: 12px 0 12px 44px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
}
.pwa-steps li:first-child { border-top: none; }
.pwa-steps li::before {
  content: counter(pwa-step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-inline-icon {
  display: inline-block;
  vertical-align: -3px;
  margin: 0 2px;
  color: #007AFF;
}
.pwa-sheet-hint { margin: 0 0 18px; font-size: 13px; color: var(--ink-faint); }
.pwa-sheet-ok { width: 100%; }

/* "Turn on notifications?" offer inside the installed app — top of the screen, so it
   never covers the chat input. */
.pwa-notify-offer {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 999;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 20, 16, 0.18);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pwa-notify-offer.is-visible { opacity: 1; transform: none; }
.pwa-notify-offer-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--green-tint);
  color: var(--green-dark);
}
.pwa-notify-offer-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.pwa-notify-offer-text { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.pwa-notify-offer-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.pwa-link-btn {
  border: none;
  background: none;
  padding: 0;
  font: 600 13px/1 var(--font);
  color: var(--ink-faint);
  cursor: pointer;
}

/* Account → Profile: notifications switch. */
/* ID: the sidebar layout resets account cards to `margin: 0 auto` with a long selector. */
#pushSettingsCard { margin-top: 16px; }
.pwa-card-title { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--ink); }
.pwa-card-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.pwa-card-actions:empty { display: none; }

.pwa-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 1001;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 20, 16, 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pwa-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* "A new version is available" bar (pwa.js checkForUpdate) — top, clear of the chat input. */
.pwa-update-bar {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 1002;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 20, 16, 0.25);
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pwa-update-bar.is-visible { opacity: 1; transform: translate(-50%, 0); }
.pwa-update-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwa-update-btn {
  flex-shrink: 0;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--dark);
  font: 700 13px/1 var(--font);
  cursor: pointer;
}
.pwa-update-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
