/* LiteBinx PWA install prompt */
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(14, 22, 36, 0.97), rgba(8, 12, 22, 0.98));
  border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #e8eef8;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 480px;
  margin: 0 auto;
  animation: pwaSlideUp 0.35s ease-out;
}

.pwa-banner.is-visible {
  display: flex;
}

@keyframes pwaSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-banner__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: #060a12;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.pwa-banner__icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pwa-banner__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.pwa-banner__copy strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.pwa-banner__copy span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: rgba(210, 220, 235, 0.78);
  line-height: 1.35;
}

.pwa-banner__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.pwa-banner__install {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: #22c55e;
  color: #04110a;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-banner__install:hover {
  filter: brightness(1.06);
}

.pwa-banner__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(200, 210, 225, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.pwa-banner__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* iOS guide modal */
.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.55);
}

.pwa-modal.is-open {
  display: flex;
}

.pwa-modal__sheet {
  width: min(420px, 100%);
  border-radius: 20px;
  background: #0c1220;
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 22px 20px 18px;
  color: #e8eef8;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: pwaSlideUp 0.3s ease-out;
}

.pwa-modal__sheet h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.pwa-modal__sheet > p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: rgba(210, 220, 235, 0.8);
  line-height: 1.45;
}

.pwa-modal__steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.pwa-modal__steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(230, 236, 246, 0.92);
}

.pwa-modal__steps b {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.pwa-modal__steps kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-family: inherit;
}

.pwa-modal__done {
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #22c55e;
  color: #04110a;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Soften on trade terminal (bottom nav) */
body .app .pwa-banner,
.trade-page .pwa-banner {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .pwa-banner {
    left: auto;
    right: 20px;
    bottom: 20px;
    width: 380px;
    margin: 0;
  }

  body .app .pwa-banner,
  .trade-page .pwa-banner {
    bottom: 20px;
  }

  .pwa-modal {
    align-items: center;
  }
}
