/* Source-owned app install banner V6. Fixed, compact install prompt: no layout shifts.
   Preserve device-neutral HTML; JS owns store selection, dismiss TTL and eligibility. */
.app-promo-banner, .app-promo-banner * { box-sizing: border-box; }
.app-promo-banner[hidden] { display: none !important; }
.app-promo-banner {
  /* Out of normal flow: becoming visible after DOMContentLoaded cannot push
     the header or hero down, including when the prompt is dismissed. */
  position: fixed;
  inset-inline: 0;
  inset-block-end: calc(.55rem + env(safe-area-inset-bottom, 0px));
  z-index: 65;
  width: min(100%, 52rem);
  margin-inline: auto;
  padding: 0 clamp(.45rem, 2vw, .9rem);
  color: #f8fafc;
  font-family: inherit;
  pointer-events: none;
}
.app-promo-banner__inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-areas: "brand copy action close";
  grid-template-columns: 3.7rem minmax(0, 1fr) auto 2.5rem;
  align-items: center;
  column-gap: clamp(.65rem, 1.9vw, 1.15rem);
  width: min(100%, 76rem);
  min-height: 5.2rem;
  margin-inline: auto;
  padding: .5rem clamp(.7rem, 1.8vw, 1.1rem);
  border: 1px solid rgb(183 199 216 / 40%);
  border-radius: 1.3rem;
  background:
    radial-gradient(ellipse at 96% 112%, rgb(255 153 20 / 21%), transparent 31%),
    linear-gradient(115deg, #303b48 0%, #1b2531 43%, #111820 100%);
  box-shadow: 0 9px 24px rgb(16 24 40 / 20%), inset 0 1px rgb(255 255 255 / 8%);
  pointer-events: auto;
}
.app-promo-banner__inner::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset-inline-end: -6.5rem;
  bottom: -4.4rem;
  width: 21rem;
  height: 6.1rem;
  border-radius: 100%;
  transform: rotate(-15deg);
  background: linear-gradient(90deg, transparent 4%, #fb923c 55%, #facc15 100%);
  pointer-events: none;
}
.app-promo-banner__inner > * { position: relative; z-index: 1; }
.app-promo-banner__brand {
  grid-area: brand;
  display: block;
  width: 3.7rem;
  height: 3.7rem;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 1rem;
  box-shadow: 0 6px 14px rgb(0 0 0 / 22%);
}
.app-promo-banner__copy {
  grid-area: copy;
  min-width: 0;
  padding-inline-start: .85rem;
  border-inline-start: 1px solid rgb(226 232 240 / 35%);
  text-align: start;
}
.app-promo-banner__title {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: clamp(.95rem, 1.5vw, 1.12rem);
  line-height: 1.32;
}
.app-promo-banner__desc {
  margin: .19rem 0 0;
  color: #d3dce7;
  font-size: clamp(.75rem, 1.3vw, .88rem);
  line-height: 1.45;
  text-wrap: pretty;
}
.app-promo-banner__action {
  grid-area: action;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .32rem;
  min-width: 0;
  text-decoration: none;
}
.app-promo-banner__store-badge {
  display: block;
  width: 9rem;
  height: 2.55rem;
  background: url("../img/app_apple_store_badge_v4.2923ae4713b9.webp") center / contain no-repeat;
}
.app-promo-banner[data-app-promo-platform="android"] .app-promo-banner__store-badge {
  background-image: url("../img/app_google_play_badge_v4.ac8516e91251.webp");
}
.app-promo-banner__action-label {
  display: inline-grid;
  place-items: center;
  min-width: 9rem;
  min-height: 2.1rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-weight: 800;
  font-size: .79rem;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgb(0 0 0 / 20%);
}
.app-promo-banner__action:hover .app-promo-banner__action-label { background: #f4f5f7; }
.app-promo-banner__close {
  grid-area: close;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.app-promo-banner__close:hover { background: rgb(255 255 255 / 22%); }
.app-promo-banner :is(a, button):focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}
html[lang="fa"] .app-promo-banner__title { line-height: 1.6; }
html[lang="fa"] .app-promo-banner__desc { line-height: 1.7; }

/* The Assistant launcher also occupies the viewport bottom. Keep it usable
   above the app prompt instead of letting the two controls overlap. */
body:has(> .app-promo-banner:not([hidden])) .assistant-launcher {
  bottom: calc(7.15rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 620px) {
  .app-promo-banner {
    inset-block-end: calc(.45rem + env(safe-area-inset-bottom, 0px));
    padding-inline: .4rem;
  }
  .app-promo-banner__inner {
    grid-template-areas: "brand copy action close";
    grid-template-columns: 2.7rem minmax(0, 1fr) auto 2.3rem;
    column-gap: .48rem;
    min-height: 3.9rem;
    padding: .46rem .55rem;
    border-radius: .95rem;
  }
  .app-promo-banner__brand {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: .72rem;
  }
  .app-promo-banner__copy {
    padding-inline-start: .45rem;
  }
  .app-promo-banner__title {
    font-size: .88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  /* Mobile is a one-row CTA, not a second row with a large store badge. */
  .app-promo-banner__desc,
  .app-promo-banner__store-badge {
    display: none;
  }
  .app-promo-banner__action {
    flex-direction: row;
    justify-content: center;
  }
  .app-promo-banner__action-label {
    display: block;
    min-width: 0;
    min-height: 2.4rem;
    max-width: clamp(5rem, 30vw, 9rem);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: .6rem .65rem;
    font-size: .75rem;
  }
  .app-promo-banner__close {
    width: 2.3rem;
    height: 2.3rem;
  }
  body:has(> .app-promo-banner:not([hidden])) .assistant-launcher {
    bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 359px) {
  .app-promo-banner__inner {
    grid-template-columns: 2.35rem minmax(0, 1fr) auto 2.15rem;
    column-gap: .32rem;
    padding-inline: .45rem;
  }
  .app-promo-banner__brand {
    width: 2.35rem;
    height: 2.35rem;
  }
  .app-promo-banner__copy { padding-inline-start: .35rem; }
  .app-promo-banner__title { font-size: .81rem; }
  .app-promo-banner__action-label { padding-inline: .5rem; font-size: .7rem; }
  .app-promo-banner__close { width: 2.15rem; height: 2.15rem; }
}
@media print {
  .app-promo-banner { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .app-promo-banner *, .app-promo-banner *::before { transition: none !important; }
}
