* {
  box-sizing: border-box;
}

.install-body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: #f2f2f7;
  color: #1c1c1e;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* —— iOS guide (как на скрине Safari) —— */
.ios-guide {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px calc(120px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.phone-mockup {
  display: flex;
  justify-content: center;
  margin: 8px 0 28px;
}

.phone-mockup__frame {
  width: min(280px, 78vw);
  aspect-ratio: 9 / 16;
  max-height: 340px;
  border: 3px solid #c8c8ce;
  border-radius: 36px;
  background: linear-gradient(180deg, #fafafa 0%, #ececf0 100%);
  padding: 28px 22px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 12px;
  height: 100%;
  align-content: start;
}

.icon-grid__cell {
  aspect-ratio: 1;
  border-radius: 14px;
  background: #e3e3e8;
  opacity: 0.55;
}

.icon-grid__cell--app {
  opacity: 1;
  background: transparent;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.icon-grid__cell--app img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.ios-guide__title {
  margin: 0 0 22px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.ios-guide__link {
  font-size: 1.1em;
}

.ios-guide__steps {
  list-style: none;
  margin: 0 auto 24px;
  padding: 0;
  max-width: 340px;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #3a3a3c;
}

.ios-guide__steps li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 14px;
}

.ios-guide__n {
  font-weight: 600;
  color: #1c1c1e;
}

.ios-guide__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  color: #007aff;
}

.ios-guide__icon--share svg {
  transform: translateY(1px);
}

.ios-guide__status {
  font-size: 0.9rem;
  color: #8e8e93;
  margin: 0 0 12px;
}

.ios-guide__warn {
  margin: 0 auto 16px;
  padding: 12px 14px;
  max-width: 340px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #8a6d00;
  background: #fff8e6;
  border-radius: 12px;
  border: 1px solid #f0e0a8;
}

.ios-guide__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.ios-guide__btn {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.ios-guide__btn--primary {
  background: #007aff;
  color: #fff;
}

.ios-guide__btn--ghost {
  background: #fff;
  color: #007aff;
  border: 1px solid #c7c7cc;
}

/* Синяя подсказка к кнопке «Поделиться» */
.ios-share-hint {
  position: fixed;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: hint-bounce 2s ease-in-out infinite;
}

.ios-share-hint__pill {
  background: #007aff;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.ios-share-hint__ico {
  display: inline-block;
  margin-left: 4px;
  font-size: 1.1em;
}

.ios-share-hint__arrow {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid #007aff;
  margin-top: -1px;
}

@keyframes hint-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

/* —— Android / generic —— */
.install-generic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70dvh;
  padding: 2rem 1.25rem 6rem;
  text-align: center;
  background: #0a0e12;
  color: #e8eef4;
}

.install-generic__icon img {
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(0, 255, 90, 0.25);
}

.install-generic h1 {
  margin: 1rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.install-generic__lead {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: #8b9aab;
  max-width: 20rem;
  line-height: 1.45;
}

.install-generic__status {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: #5a6b7d;
}

.install-generic__warn {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #f0c674;
  background: rgba(240, 198, 116, 0.08);
  border-radius: 10px;
  max-width: 22rem;
}

body[data-platform="ios"] .install-generic,
body[data-platform="ios"] .install-bar {
  display: none !important;
}

body[data-platform="android"] .ios-guide,
body[data-platform="android"] .ios-share-hint,
body[data-platform="desktop"] .ios-guide,
body[data-platform="desktop"] .ios-share-hint {
  display: none !important;
}

body[data-platform="android"] .install-generic,
body[data-platform="desktop"] .install-generic {
  display: flex !important;
}

/* —— Bottom bar (Android) —— */
.install-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: rgba(12, 16, 22, 0.96);
  border-top: 1px solid rgba(62, 207, 142, 0.2);
  z-index: 20;
  flex-direction: column;
}

.install-bar__text {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: #e8eef4;
}

.install-bar__text strong {
  display: block;
  font-weight: 600;
}

.install-bar__actions {
  display: flex;
  gap: 0.5rem;
}

.install-bar__btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #3ecf8e;
  color: #061008;
  cursor: pointer;
}

.install-bar__btn--full {
  width: 100%;
  margin-top: 0.5rem;
}

.install-bar__btn--ghost {
  background: transparent;
  color: #8b9aab;
  border: 1px solid rgba(139, 154, 171, 0.25);
}

.install-bar__close {
  width: 2.75rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #8b9aab;
  font-size: 1.25rem;
  cursor: pointer;
}

.ios-install {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.ios-install__card {
  width: 100%;
  background: #121820;
  border-radius: 16px 16px 0 0;
  padding: 1.25rem;
  border: 1px solid rgba(62, 207, 142, 0.15);
  color: #e8eef4;
}

.ios-install__card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.ios-install__lead {
  margin: 0 0 0.75rem;
  color: #8b9aab;
  font-size: 0.9rem;
}

.ios-install__card ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #c5d0dc;
  font-size: 0.9rem;
  line-height: 1.5;
}

.install-chip {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: #3ecf8e;
  font-size: 1.25rem;
  z-index: 15;
}
