.pwa-install-card,
.pwa-update-toast {
  position: fixed;
  z-index: 150;
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 36px));
  border: 1px solid rgba(202, 214, 231, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  color: #182438;
  box-shadow: 0 22px 54px rgba(7, 25, 58, 0.2);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwa-install-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.pwa-install-card[hidden],
.pwa-update-toast[hidden] {
  display: none;
}

.pwa-install-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.pwa-install-card__copy {
  min-width: 0;
}

.pwa-install-card strong,
.pwa-update-toast strong {
  display: block;
  color: #0b2e6b;
  font-size: 0.9rem;
  line-height: 1.25;
}

.pwa-install-card p,
.pwa-update-toast p {
  margin: 4px 0 0;
  color: #637087;
  font-size: 0.76rem;
  line-height: 1.4;
}

.pwa-install-card__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pwa-install-card button,
.pwa-update-toast button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: #0b2e6b;
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.pwa-install-card .pwa-install-card__dismiss {
  width: 38px;
  padding: 0;
  background: #eef2f7;
  color: #506078;
  font-size: 1.1rem;
}

.pwa-update-toast {
  padding: 16px;
}

.pwa-update-toast__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pwa-update-toast__later {
  background: #edf1f6 !important;
  color: #43516a !important;
}

@media (max-width: 760px) {
  .pwa-install-card,
  .pwa-update-toast {
    right: 10px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    width: auto;
  }

  .pwa-install-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 13px;
  }

  .pwa-install-card__actions {
    grid-column: auto;
    justify-content: initial;
  }

  .pwa-install-card__icon {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(202, 214, 231, 0.75);
    border-radius: 15px;
  }

  .pwa-install-card strong {
    font-size: 0.88rem;
  }

  .pwa-install-card p {
    font-size: 0.74rem;
  }

  .pwa-install-card button {
    min-height: 42px;
  }

  .pwa-install-card .pwa-install-card__dismiss {
    width: 36px;
  }
}

@media (max-width: 390px) {
  .pwa-install-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px;
  }

  .pwa-install-card__icon {
    width: 46px;
    height: 46px;
  }

  .pwa-install-card__copy p {
    display: none;
  }

  .pwa-install-card button {
    padding-inline: 10px;
  }
}

html[data-theme="dark"] .pwa-install-card,
html[data-theme="dark"] .pwa-update-toast {
  border-color: rgba(107, 132, 168, 0.3);
  background: rgba(10, 15, 24, 0.98);
  color: #edf4ff;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .pwa-install-card strong,
html[data-theme="dark"] .pwa-update-toast strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .pwa-install-card p,
html[data-theme="dark"] .pwa-update-toast p {
  color: #9dadc5;
}

.pwa-ios-guide {
  position: fixed;
  z-index: 170;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(3, 9, 18, 0.64);
  backdrop-filter: blur(8px);
}

.pwa-ios-guide[hidden] {
  display: none;
}

.pwa-ios-guide__card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid #d8e1ee;
  border-radius: 26px;
  background: #fff;
  color: #182438;
  box-shadow: 0 28px 80px rgba(2, 12, 29, 0.34);
}

.pwa-ios-guide__card > img {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 17px;
}

.pwa-ios-guide__card strong {
  display: block;
  color: #0b2e6b;
  font-size: 1.08rem;
}

.pwa-ios-guide__card ol {
  display: grid;
  gap: 11px;
  margin: 16px 0 20px;
  padding-left: 22px;
  color: #53627a;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pwa-ios-guide__card button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: #0b2e6b;
  color: #fff;
  font: inherit;
  font-weight: 800;
}

html[data-theme="dark"] .pwa-ios-guide__card {
  border-color: rgba(107, 132, 168, 0.35);
  background: #0d1521;
  color: #f4f8ff;
}

html[data-theme="dark"] .pwa-ios-guide__card strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .pwa-ios-guide__card ol {
  color: #b7c3d6;
}
