/* Fluentix Member PWA / Add-to-Home-Screen shell */
:root {
  --fx-pwa-teal: #0f766e;
  --fx-pwa-bg: #f8fafc;
  --fx-pwa-safe-b: env(safe-area-inset-bottom, 0px);
  --fx-pwa-safe-t: env(safe-area-inset-top, 0px);
}

/* Install banner */
.fx-pwa-install {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--fx-pwa-safe-b));
  z-index: 99990;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.fx-pwa-install[hidden] {
  display: none !important;
}
.fx-pwa-install__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.fx-pwa-install__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #475569;
}
.fx-pwa-install__copy strong {
  color: #0f172a;
  font-size: 0.92rem;
}
.fx-pwa-install__btn {
  border: 0;
  background: var(--fx-pwa-teal);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.fx-pwa-install__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem;
  cursor: pointer;
}

/* Bottom tab bar — mobile + standalone */
.fx-pwa-tabbar {
  display: none;
}
@media (max-width: 900px) {
  body.fx-mem-pwa-ready.fx-mem-auth-page .fx-pwa-tabbar,
  body.fx-mem-standalone .fx-pwa-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99980;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e2e8f0;
    padding: 0.35rem 0.25rem calc(0.35rem + var(--fx-pwa-safe-b));
  }
  body.fx-mem-pwa-ready.fx-mem-auth-page,
  body.fx-mem-standalone.fx-mem-pwa-ready {
    padding-bottom: calc(4.25rem + var(--fx-pwa-safe-b));
  }
}
.fx-pwa-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-decoration: none !important;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem;
}
.fx-pwa-tab.is-active {
  color: var(--fx-pwa-teal);
}
.fx-pwa-tab__ico {
  font-size: 1.05rem;
  line-height: 1;
}

/* Standalone (home-screen) — hide remaining site chrome */
@media (display-mode: standalone) {
  body.fx-mem-pwa-ready .site-header,
  body.fx-mem-pwa-ready .site-footer,
  body.fx-mem-pwa-ready .utopia-announcement-bar,
  body.fx-mem-standalone .site-header,
  body.fx-mem-standalone .site-footer,
  body.fx-mem-standalone .utopia-announcement-bar {
    display: none !important;
  }
  body.fx-mem-standalone,
  body.fx-mem-pwa-ready.fx-mem-auth-page {
    background: var(--fx-pwa-bg);
  }
  body.fx-mem-standalone .site-content,
  body.fx-mem-standalone .utopia-container.content,
  body.fx-mem-standalone .content-area,
  body.fx-mem-pwa-ready.fx-mem-auth-page .site-content {
    padding-top: calc(0.75rem + var(--fx-pwa-safe-t)) !important;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
  }
}

/* iOS Safari standalone fallback (navigator.standalone) */
body.fx-mem-standalone .site-header,
body.fx-mem-standalone .site-footer {
  display: none !important;
}

/* App-like hub polish on small screens */
@media (max-width: 900px) {
  body.fx-mem-auth-page .fx-mem-hub,
  body.fx-mem-auth-page .fx-mem-login {
    max-width: 28rem;
    margin: 0 auto;
  }
  body.fx-mem-auth-page .fx-mem-hub__hello {
    font-size: 1.35rem;
  }
  body.fx-mem-auth-page .fx-mem-hub__cta {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-weight: 700;
  }
  body.fx-mem-auth-page .fx-mem-hub__list a {
    display: block;
    padding: 0.55rem 0;
  }
  body.fx-mem-auth-page .fx-mem-dash__stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Logout visible again for PWA “More” tab */
body.fx-mem-pwa-ready.fx-mem-auth-page .fx-mem-hub__out {
  display: block !important;
  margin-top: 1.75rem;
  padding: 1rem 0 calc(0.5rem + var(--fx-pwa-safe-b));
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.fx-pwa-topbar {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0 0.85rem;
  margin-bottom: 0.35rem;
}
.fx-pwa-topbar__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.fx-pwa-topbar__name {
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
