/* Scoped to the install controls; homepage content and shared design stay intact. */
.bottom-nav:has(.phone-menu) { overflow: visible; }
.phone-menu { min-width: 0; }
.phone-menu summary {
  display: grid; place-items: center; align-content: center; gap: 3px;
  min-height: 62px; padding: 7px 2px; color: var(--white); cursor: pointer;
  font-size: clamp(8px, 2.3vw, 10px); font-weight: 800; line-height: 1.2;
  list-style: none; border-radius: 0 16px 16px 0;
}
.phone-menu summary::-webkit-details-marker { display: none; }
.phone-menu__items {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  width: min(290px, calc(100vw - 24px)); padding: 8px;
  border: 1px solid #30343a; border-radius: 16px; background: #0b0d10;
  box-shadow: 0 12px 35px #0b0d1047;
}
.bottom-nav .phone-menu__items a, .bottom-nav .phone-menu__items button {
  display: flex; align-items: center; width: 100%; min-height: 48px;
  padding: 12px; border-radius: 9px; text-align: left; font-size: 14px; line-height: 1.4;
}
.phone-menu__items a:hover, .phone-menu__items button:hover { background: #30343a; }
.phone-menu summary:focus-visible, .phone-menu__items :focus-visible,
.phone-install-dialog :focus-visible, .phone-install-footer:focus-visible { outline: 3px solid #ff5a4d; outline-offset: 2px; }
.phone-install-dialog {
  box-sizing: border-box; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  margin: auto; padding: 28px; overflow-y: auto; border: 1px solid #d8d8d8; border-radius: 20px;
  background: #f6f5f1; color: #0d0d0d; font-family: inherit; line-height: 1.55;
}
.phone-install-dialog::backdrop { background: #0b0d10a6; }
.phone-install-dialog h2 { margin: 16px 0 12px; font-size: 26px; line-height: 1.15; }
.phone-install-dialog img { border-radius: 14px; }
.phone-install-dialog ol { padding-left: 22px; }
.phone-install-dialog li + li { margin-top: 12px; }
.phone-install-close { float: right; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #e5e4df; color: #0d0d0d; font-size: 28px; cursor: pointer; }
.phone-install-native { min-height: 48px; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #0d0d0d; color: white; font: inherit; font-weight: 800; cursor: pointer; }
[data-phone-install][hidden], .phone-install-native[hidden] { display: none !important; }
@media (max-width: 899px) { .site-footer .phone-install-footer { min-height: 44px; } }
/* Keep the expanded menu above the existing floating page-help control. */
.bottom-nav:has(.phone-menu[open]) { z-index: 46; }

/* A mobile-only invitation directly above the first homepage action card. */
.phone-install-card { display: none; }
@media (max-width: 899px) {
  .home-hub .phone-install-card {
    display: block; width: 100%; margin: 0 0 14px; padding: 0;
    border: 0; border-radius: 18px; background: #6842ad; color: #fff;
    text-align: left; font: inherit; cursor: pointer;
  }
  .phone-install-card__heading { font: 900 clamp(24px, 6vw, 30px)/1.08 var(--display); text-transform: uppercase; }
  .phone-install-card__copy { max-width: 44ch; font-size: 15px; line-height: 1.5; }
  .phone-install-card__action { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 14px; font-weight: 850; }
  .phone-install-card > summary { display: grid; gap: 10px; padding: 22px; list-style: none; cursor: pointer; }
  .phone-install-card > summary::-webkit-details-marker { display: none; }
  .phone-install-card[open] .phone-install-card__action > span { transform: rotate(45deg); }
  .phone-install-card__options { display: grid; gap: 10px; padding: 0 22px 22px; }
  .phone-install-card__options a, .phone-install-card__options button { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 52px; width: 100%; box-sizing: border-box; padding: 14px; border: 0; font-family: inherit; text-align: left; cursor: pointer; border-radius: 12px; background: #fff; color: #39245e; font-size: 16px; font-weight: 800; text-decoration: none; }
  .phone-install-card > summary:focus-visible, .phone-install-card__options a:focus-visible, .phone-install-card__options button:focus-visible { outline: 3px solid #0d0d0d; outline-offset: 3px; }
}

/* Hide unsupported native dialogs; older browsers use the standalone help page. */
.phone-install-dialog:not([open]) { display: none; }
.phone-install-help { box-sizing: border-box; max-width: 680px; margin: 0 auto; padding: 24px 20px 48px; font: 18px/1.6 system-ui, sans-serif; color: #171717; background: #f6f5f1; }
.phone-install-help h1 { font-size: 32px; line-height: 1.15; }
.phone-install-help li + li { margin-top: 14px; }
.phone-install-help a { color: #4b278c; text-decoration: underline; }
.phone-install-help nav a { display: inline-block; padding: 12px 0; margin-right: 20px; }

[data-android-install-status] { margin: 0; color: #fff; font-size: 15px; line-height: 1.5; }
.phone-install-card__options button:disabled { opacity: .7; cursor: wait; }
