.pwa-install-offer {
  position: fixed;
  left: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 118;
  width: clamp(240px, 19vw, 300px);
  padding: 15px;
  border: 1px solid rgba(255, 45, 107, .72);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(29, 16, 23, .98), rgba(8, 8, 11, .99) 72%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .72), 0 0 24px rgba(255, 23, 79, .22);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  transform: translateY(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overflow: visible;
}

.pwa-install-offer.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.pwa-install-offer__close {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: 400 25px/1 system-ui, sans-serif;
  cursor: pointer;
  z-index: 3;
}

.pwa-install-offer__model {
  position: absolute;
  z-index: 1;
  left: -8px;
  bottom: 0;
  width: 112px;
  height: auto;
  max-width: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, .62)) drop-shadow(0 0 9px rgba(255, 23, 79, .2));
}

.pwa-install-offer__content {
  position: relative;
  z-index: 2;
  min-height: 104px;
  margin-left: 94px;
  padding-right: 18px;
}

.pwa-install-offer h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.pwa-install-offer p {
  margin: 8px 0 11px;
  color: #d4cdd2;
  font-size: 12px;
  line-height: 1.5;
}

.pwa-install-offer__button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#ff315f, #cf0034);
  box-shadow: 0 0 18px rgba(255, 23, 79, .28);
  color: #fff;
  font: 850 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
}

.pwa-install-offer__ios {
  margin-top: 11px;
  padding: 0;
  color: #ded8dc;
  font-size: 12px;
  line-height: 1.5;
}

.pwa-install-offer__ios[hidden] { display: none; }

.pwa-install-offer__ios-title {
  padding-right: 34px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.pwa-install-offer__steps {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.pwa-install-offer__steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(255, 49, 95, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
}

.pwa-install-offer__step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(#ff315f, #cf0034);
  box-shadow: 0 0 14px rgba(255, 23, 79, .27);
  color: #fff;
  font-weight: 900;
}

.pwa-install-offer__steps strong,
.pwa-install-offer__steps small { display: block; }
.pwa-install-offer__steps strong { color: #fff; font-size: 13px; }
.pwa-install-offer__steps small { margin-top: 2px; color: #bfb7bd; font-size: 10px; line-height: 1.4; }

.pwa-install-offer__ios-note {
  margin-top: 9px;
  color: #ff9bb2;
  font-size: 10px;
  text-align: center;
}

.pwa-install-offer.is-ios-guide {
  left: 50%;
  width: min(420px, calc(100vw - 24px));
  padding: 17px;
  overflow: hidden;
  transform: translateX(-50%);
}

.pwa-install-offer.is-ios-guide .pwa-install-offer__model,
.pwa-install-offer.is-ios-guide .pwa-install-offer__button { display: none; }
.pwa-install-offer.is-ios-guide .pwa-install-offer__content { min-height: 0; margin-left: 0; padding-right: 0; }
.pwa-install-offer.is-ios-guide h2,
.pwa-install-offer.is-ios-guide p { display: none; }

body.pwa-ios-guide-open .tg-v2,
body.pwa-ios-guide-open .tg-invite {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 620px) {
  .pwa-install-offer {
    left: 4px;
    bottom: max(4px, env(safe-area-inset-bottom));
    width: 42vw;
    max-width: 180px;
    padding: 8px;
    border-radius: 15px;
  }
  .pwa-install-offer__close { top: 2px; right: 2px; width: 30px; height: 30px; font-size: 20px; }
  .pwa-install-offer__model { left: -3px; width: 65px; }
  .pwa-install-offer__content { min-height: 66px; margin-left: 54px; padding-right: 10px; }
  .pwa-install-offer h2 { font-size: 11px; line-height: 1.2; }
  .pwa-install-offer p { display: none; }
  .pwa-install-offer__button { min-height: 31px; margin-top: 8px; padding-inline: 4px; font-size: 9px; }
  .pwa-install-offer__ios { margin-top: 7px; padding: 7px; font-size: 9px; }
  .pwa-install-offer.is-ios-guide {
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    max-width: 420px;
    padding: 14px;
    border-radius: 18px;
    transform: translateX(-50%);
  }
  .pwa-install-offer.is-ios-guide .pwa-install-offer__close { top: 8px; right: 8px; }
  .pwa-install-offer.is-ios-guide .pwa-install-offer__ios { margin-top: 0; padding: 0; }
  .pwa-install-offer__ios-title { font-size: 16px; }
  .pwa-install-offer__steps { gap: 7px; margin-top: 10px; }
  .pwa-install-offer__steps li { grid-template-columns: 30px 1fr; gap: 8px; padding: 8px; }
  .pwa-install-offer__step-number { width: 28px; height: 28px; font-size: 12px; }
  .pwa-install-offer__steps strong { font-size: 12px; }
  .pwa-install-offer__steps small { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-offer { transition: none; }
}

/* PWA-only mobile navigation — Glass Dock */
.pwa-app-nav,
.pwa-app-sheet,
.pwa-app-sheet-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  html.pwa-standalone body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  html.pwa-standalone .pwa-app-nav {
    position: fixed;
    z-index: 124;
    right: 8px;
    bottom: max(6px, env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    min-height: 68px;
    padding: 7px 5px 5px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-top-color: rgba(255, 34, 91, .82);
    border-radius: 19px;
    background: linear-gradient(180deg, rgba(27, 19, 24, .9), rgba(8, 8, 11, .96));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .68), 0 -1px 18px rgba(255, 23, 79, .12);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    backdrop-filter: blur(18px) saturate(1.35);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  }

  html.pwa-standalone .pwa-app-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px 2px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #8f8990;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: color .18s ease, transform .18s ease, background-color .18s ease;
  }

  html.pwa-standalone .pwa-app-nav__item:active {
    transform: scale(.94);
  }

  html.pwa-standalone .pwa-app-nav__item.is-active {
    color: #ff315f;
  }

  html.pwa-standalone .pwa-app-nav__item:focus-visible {
    outline: 2px solid #ff315f;
    outline-offset: -2px;
  }

  html.pwa-standalone .pwa-app-nav__icon {
    display: block;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    background: currentColor;
    -webkit-mask: var(--pwa-nav-icon) center / contain no-repeat;
    mask: var(--pwa-nav-icon) center / contain no-repeat;
  }

  html.pwa-standalone .pwa-app-nav__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: currentColor;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .pwa-app-nav__item--search {
    padding-top: 0;
    color: #fff;
  }

  html.pwa-standalone .pwa-app-nav__search-ring {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-top: -25px;
    border: 4px solid #100d10;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff3b6b, #d9003c);
    box-shadow: 0 8px 20px rgba(255, 23, 79, .42), 0 0 0 1px rgba(255, 123, 153, .45) inset;
  }

  html.pwa-standalone .pwa-app-nav__item--search .pwa-app-nav__label {
    color: #ff6b8d;
  }

  html.pwa-standalone .pwa-app-sheet-backdrop {
    position: fixed;
    z-index: 128;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, .64);
    opacity: 0;
    transition: opacity .2s ease;
    cursor: default;
  }

  html.pwa-standalone .pwa-app-sheet-backdrop[hidden],
  html.pwa-standalone .pwa-app-sheet[hidden] {
    display: none;
  }

  html.pwa-standalone .pwa-app-sheet-backdrop.is-visible {
    opacity: 1;
  }

  html.pwa-standalone .pwa-app-sheet {
    position: fixed;
    z-index: 129;
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 8px;
    display: block;
    max-height: min(68vh, 540px);
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(27, 18, 24, .99), rgba(8, 8, 11, .995));
    box-shadow: 0 22px 55px rgba(0, 0, 0, .72), 0 0 24px rgba(255, 23, 79, .12);
    color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    opacity: 0;
    transform: translateY(18px) scale(.985);
    transition: opacity .2s ease, transform .2s ease;
  }

  html.pwa-standalone .pwa-app-sheet.is-visible {
    opacity: 1;
    transform: none;
  }

  html.pwa-standalone .pwa-app-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
  }

  html.pwa-standalone .pwa-app-sheet__header h2 {
    margin: 0;
    color: #fff;
    font-size: 21px;
    line-height: 1.2;
  }

  html.pwa-standalone .pwa-app-sheet__close {
    min-width: 54px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 49, 95, .45);
    border-radius: 999px;
    background: rgba(255, 49, 95, .1);
    color: #ff7696;
    font: 800 13px/1 system-ui, sans-serif;
  }

  html.pwa-standalone .pwa-app-sheet__search label {
    display: block;
    margin-bottom: 8px;
    color: #c8c0c6;
    font-size: 13px;
  }

  html.pwa-standalone .pwa-app-sheet__search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  html.pwa-standalone .pwa-app-sheet__search input,
  html.pwa-standalone .pwa-app-sheet__search button {
    min-height: 48px;
    border-radius: 13px;
    font: 700 15px/1.2 system-ui, sans-serif;
  }

  html.pwa-standalone .pwa-app-sheet__search input {
    min-width: 0;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    outline: 0;
    background: rgba(255, 255, 255, .065);
    color: #fff;
  }

  html.pwa-standalone .pwa-app-sheet__search input:focus {
    border-color: #ff315f;
    box-shadow: 0 0 0 3px rgba(255, 49, 95, .16);
  }

  html.pwa-standalone .pwa-app-sheet__search button {
    padding: 0 18px;
    border: 0;
    background: linear-gradient(#ff315f, #d3003a);
    color: #fff;
  }

  html.pwa-standalone .pwa-app-sheet__empty {
    margin: 0;
    padding: 24px 14px;
    border: 1px dashed rgba(255, 255, 255, .15);
    border-radius: 15px;
    color: #aaa2a8;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
  }

  html.pwa-standalone .pwa-app-history {
    display: grid;
    gap: 9px;
  }

  html.pwa-standalone .pwa-app-history__item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-height: 58px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
    color: #fff;
    text-decoration: none;
  }

  html.pwa-standalone .pwa-app-history__item img {
    width: 48px;
    height: 48px;
    border-radius: 9px;
    object-fit: cover;
  }

  html.pwa-standalone .pwa-app-history__item > span,
  html.pwa-standalone .pwa-app-history__item strong,
  html.pwa-standalone .pwa-app-history__item small {
    display: block;
    min-width: 0;
  }

  html.pwa-standalone .pwa-app-history__item strong,
  html.pwa-standalone .pwa-app-history__item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .pwa-app-history__item strong {
    color: #fff;
    font-size: 14px;
  }

  html.pwa-standalone .pwa-app-history__item small {
    margin-top: 3px;
    color: #aaa2a8;
    font-size: 11px;
  }

  html.pwa-standalone .pwa-app-more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  html.pwa-standalone .pwa-app-more a,
  html.pwa-standalone .pwa-app-more__notification {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
  }

  html.pwa-standalone .pwa-app-more__notification {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
    cursor: pointer;
  }

  html.pwa-standalone .pwa-app-more__notification.is-enabled {
    border-color: rgba(63, 218, 169, .38);
    color: #70e4bb;
  }

  html.pwa-standalone .pwa-app-more__notification:disabled {
    cursor: default;
    opacity: .62;
  }

  html.pwa-standalone .pwa-app-more a:last-of-type {
    border-color: rgba(255, 49, 95, .33);
    color: #ff7898;
  }

  html.pwa-standalone .tg-invite {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  html.pwa-fullscreen body {
    padding-bottom: 0;
  }

  html.pwa-fullscreen .pwa-app-nav,
  html.pwa-fullscreen .pwa-app-sheet,
  html.pwa-fullscreen .pwa-app-sheet-backdrop {
    display: none !important;
  }
}

@media (max-width: 1024px) and (orientation: landscape) and (max-height: 560px) {
  html.pwa-standalone body {
    padding-bottom: 0;
    padding-left: calc(66px + env(safe-area-inset-left));
  }

  html.pwa-standalone .pwa-app-nav {
    top: max(6px, env(safe-area-inset-top));
    right: auto;
    bottom: max(6px, env(safe-area-inset-bottom));
    left: max(6px, env(safe-area-inset-left));
    width: 56px;
    min-height: 0;
    padding: 5px;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, minmax(0, 1fr));
    align-items: center;
    border-top-color: rgba(255, 255, 255, .1);
    border-left-color: rgba(255, 34, 91, .82);
    border-radius: 17px;
  }

  html.pwa-standalone .pwa-app-nav__item {
    justify-content: center;
    width: 100%;
    min-height: 0;
    padding: 4px;
  }

  html.pwa-standalone .pwa-app-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  html.pwa-standalone .pwa-app-nav__item--search {
    color: #fff;
  }

  html.pwa-standalone .pwa-app-nav__search-ring {
    width: 42px;
    height: 42px;
    margin: 0;
    border-width: 2px;
  }

  html.pwa-standalone .pwa-app-sheet {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: calc(72px + env(safe-area-inset-left));
    max-height: none;
  }

  html.pwa-standalone .tg-invite {
    bottom: 4px;
  }

  html.pwa-fullscreen body {
    padding-left: 0;
  }
}

@media (max-width: 370px) and (orientation: portrait) {
  html.pwa-standalone .pwa-app-nav {
    right: 4px;
    left: 4px;
  }

  html.pwa-standalone .pwa-app-nav__label {
    font-size: 9px;
  }

  html.pwa-standalone .pwa-app-nav__search-ring {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-app-nav__item,
  .pwa-app-sheet,
  .pwa-app-sheet-backdrop {
    transition: none !important;
  }
}
