@layer components {
  /* The invitation to install the app: a centered dialog, a sheet along the bottom edge on a phone. */
  .install-prompt-dialog {
    width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-sm);
  }
  .install-prompt-dialog::backdrop { background: oklch(0 0 0 / 0.45); }
  .install-prompt-dialog:not([open]) { display: none; }
  /* .button sets its own display, which would otherwise win over the hidden attribute. */
  .install-prompt-dialog [hidden] { display: none; }
  .install-prompt-body { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
  .install-prompt-head { display: flex; align-items: center; gap: 12px; }
  .install-prompt-icon { flex: none; border-radius: var(--radius-md); }
  .install-prompt-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; text-wrap: balance; }
  .install-prompt-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
  .install-prompt-steps { display: grid; gap: 12px; margin: 12px 0; padding: 0; list-style: none; }
  .install-prompt-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
  .install-prompt-steps svg { flex: none; color: var(--jx-accent); }
  .install-prompt-step-icon { flex: none; border-radius: var(--radius-sm); }
  .install-prompt-path { color: var(--foreground); font-weight: 500; }
  .install-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; }

  @media (max-width: 767px) {
    .install-prompt-dialog {
      width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      padding-bottom: var(--safe-bottom);
    }
    .install-prompt-actions { flex-direction: column-reverse; }
  }
}
