/* Keep the last footer links clear of the floating download card. */
body { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
html { scroll-padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }

.app-download {
  position: fixed;
  z-index: 40;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  width: 440px;
  max-width: calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  padding: 15px 18px 15px 15px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 26px;
  background: linear-gradient(115deg, rgb(37 52 41 / 97%), rgb(17 24 19 / 97%));
  color: #fff;
  box-shadow: 0 16px 44px rgb(12 27 17 / 24%), 0 3px 10px rgb(12 27 17 / 12%), inset 0 1px 0 rgb(255 255 255 / 7%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  text-decoration: none;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.app-download-icon { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 0 0 1px rgb(255 255 255 / 12%); }
.app-download-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 5px; }
.app-download-eyebrow { color: #b5c9ba; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.app-download-copy strong { font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; }
.app-download-stores { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #d4dfd7; font-size: 11px; line-height: 1.4; }
.app-download-stores > span { display: inline-flex; align-items: center; gap: 5px; }
.app-download-divider { width: 1px; height: 11px; background: rgb(255 255 255 / 24%); }
.app-download-action { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: #81eca5; color: #102b19; box-shadow: 0 0 24px rgb(70 223 125 / 10%); transition: background .2s ease, transform .2s ease; }
.app-download:focus-visible { outline: 3px solid #22c55e; outline-offset: 5px; }
@media (hover: hover) {
  .app-download:hover { border-color: rgb(129 236 165 / 55%); box-shadow: 0 18px 50px rgb(12 27 17 / 32%), 0 3px 10px rgb(12 27 17 / 12%); }
  .app-download:hover .app-download-action { background: #a2f5bd; transform: translateY(-2px); }
}
/* Let support and reading take priority, including keyboard navigation. */
body.document-reader-open .app-download,
body.app-download-open .app-download,
body:has([data-support-modal]:not([hidden])) .app-download { visibility: hidden; pointer-events: none; }
@media (max-width: 600px) {
  body { padding-bottom: calc(106px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-bottom: calc(106px + env(safe-area-inset-bottom, 0px)); }
  .app-download { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); gap: 12px; padding: 12px; border-radius: 22px; }
  .app-download-icon { width: 44px; height: 44px; border-radius: 12px; }
  .app-download-eyebrow { display: none; }
  .app-download-copy strong { font-size: 17px; }
  .app-download-action { width: 40px; height: 40px; }
}
@media (max-width: 360px) {
  .app-download { gap: 9px; }
  .app-download-copy strong { font-size: 15px; }
  .app-download-stores { gap: 6px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-download, .app-download-action { transition: none; }
}
@media print { .app-download { display: none; } body { padding-bottom: 0; } }

body.app-download-open { overflow: hidden; }
.app-download-dialog {
  width: min(460px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--theme-surface);
  color: var(--ink);
  box-shadow: var(--shadow-modal);
  overscroll-behavior: contain;
}
.app-download-dialog::backdrop { background: var(--color-overlay); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.app-download-dialog-inner { position: relative; padding: 44px 36px 30px; text-align: center; overflow: hidden; }
.app-download-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--theme-surface); color: var(--ink); cursor: pointer; }
.app-download-close:hover { background: var(--theme-surface-2); }
.app-download-art { display: grid; place-items: center; width: 160px; height: 160px; margin: 0 auto 22px; border: 1px solid #d6ecdc; border-radius: 50%; background: radial-gradient(circle, #c8f4d7 0%, #eef9f1 68%, #f6fcf8 100%); }
.app-download-art img { width: 88px; height: 88px; border-radius: 23px; transform: rotate(-7deg); box-shadow: 0 12px 26px rgb(13 61 31 / 20%); }
.app-download-dialog-eyebrow { margin: 0 0 12px; color: var(--theme-on-contrast-button); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.app-download-dialog h2 { margin: 0; font-family: var(--font-display); font-size: clamp(30px, 6vw, 38px); font-weight: 500; line-height: 1.15; letter-spacing: -.04em; }
.app-download-description { margin: 18px 0 25px; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }
.app-download-continue { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 14px 20px; border-radius: 16px; background: #183723; color: #fff; text-decoration: none; font-weight: 650; line-height: 1.4; }
.app-download-continue:hover { background: #244f33; }
.app-download-continue svg { flex-shrink: 0; color: #81eca5; }
.app-download-dialog .app-download-stores { justify-content: center; margin: 18px 0 22px; color: var(--ink-soft); font-size: 12px; gap: 12px; }
.app-download-dialog .app-download-divider { background: var(--line); }
.app-download-note { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
@media (max-width: 600px) {
  .app-download-dialog-inner { padding: 38px 24px 24px; }
  .app-download-art { width: 132px; height: 132px; margin-bottom: 20px; }
  .app-download-art img { width: 76px; height: 76px; border-radius: 20px; }
}
