@layer components {
  /* Install nudge — MODAL (bottom-sheet). showModal() → top-layer + ::backdrop.
     Anclado abajo, esquinas superiores redondeadas, desliza translateY con
     `.is-open`. Mismo lenguaje que consent/inapp-breakout. Cerrado = display:none
     (UA) → sin FOUC. */
  .app-install-modal {
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: 0;
    margin: 0;
    background: transparent;
    transform: translateY(110%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text, #fff);
    font-family: var(--font-body, Manrope, sans-serif);
  }

  .app-install-modal.is-open {
    transform: translateY(0);
  }

  .app-install-modal::backdrop {
    background: rgb(0 0 0 / 0%);
    backdrop-filter: blur(0);
    transition:
      background 280ms ease-out,
      backdrop-filter 280ms ease-out;
  }

  .app-install-modal.is-open::backdrop {
    background: rgb(0 0 0 / 70%);
    backdrop-filter: blur(4px);
  }

  @media (prefers-reduced-motion: reduce) {
    .app-install-modal,
    .app-install-modal::backdrop {
      transition: none;
    }
  }

  .app-install-modal :focus-visible {
    outline: none;
  }

  .app-install-modal__inner {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
    background: var(--color-surface, #111113);
    border-top: 1px solid var(--color-surface-border, rgb(255 255 255 / 8%));
    border-radius: 22px 22px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .app-install-modal__handle {
    flex: 0 0 auto;
    width: 40px;
    height: 4px;
    margin: 0 auto 2px;
    border-radius: var(--radius-full, 9999px);
    background: rgb(255 255 255 / 22%);
  }

  .app-install-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    appearance: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-border, rgb(255 255 255 / 8%));
    color: rgb(255 255 255 / 70%);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition:
      background 160ms ease,
      color 160ms ease;
  }

  .app-install-modal__close:hover {
    background: rgb(255 255 255 / 14%);
    color: #fff;
  }

  /* ── Burbuja de notificación (preview) ──
     `margin-top` deja un carril propio para la ✕ (absolute, top:14px + 32px),
     que de otro modo solaparía la esquina superior derecha de la burbuja. */
  .app-install-modal__notif {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin-top: 22px;
    padding: 12px 14px;
    background: rgb(255 255 255 / 6%);
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 16px;
  }

  .app-install-modal__notif-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .app-install-modal__notif-body {
    min-width: 0;
    flex: 1;
  }

  .app-install-modal__notif-head {
    margin: 0 0 3px;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #a1a1aa);
  }

  .app-install-modal__notif-head strong {
    color: var(--color-text-secondary, #e4e4e7);
    font-weight: 700;
  }

  .app-install-modal__notif-l1 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
  }

  .app-install-modal__notif-goal {
    color: var(--color-accent, #00ff87);
    font-weight: 800;
  }

  .app-install-modal__notif-l2 {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-text-muted, #a1a1aa);
  }

  /* ── Mensaje principal ── */
  .app-install-modal__headline {
    margin: 4px 0 0;
    font-family: var(--font-title, Oswald, sans-serif);
    font-size: 27px;
    line-height: 1.05;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
  }

  .app-install-modal__subhead {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
    color: var(--color-text-muted, #a1a1aa);
    max-width: 36ch;
  }

  /* ── CTA ── */
  .app-install-modal__cta {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 17px 22px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    background: var(--color-accent, #00ff87);
    color: var(--color-on-accent, #000);
    transition: background 160ms ease;
  }

  .app-install-modal__cta:hover {
    filter: brightness(1.06);
  }

  /* ── Prueba social ── */
  .app-install-modal__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .app-install-modal__rating {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .app-install-modal__stars {
    color: #fbbf24;
    font-size: 15px;
    letter-spacing: 1px;
  }

  .app-install-modal__rating-value {
    font-weight: 700;
    color: #fff;
  }

  .app-install-modal__sep {
    width: 1px;
    height: 22px;
    background: rgb(255 255 255 / 14%);
  }

  .app-install-modal__store {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #e4e4e7);
  }

  .app-install-modal__store[hidden] {
    display: none;
  }
}
