.floating-download-demo {
  --floating-safe-bottom: max(12px, env(safe-area-inset-bottom));
  --floating-space-xs: 4px;
  --floating-space-sm: 8px;
  --floating-space-md: 12px;
  --floating-space-lg: 16px;
  --floating-space-xl: 24px;
  padding-bottom: 138px;
}

.floating-download-demo .day-download-dock { display: none; }

.floating-demo-controls {
  position: fixed;
  z-index: 60;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--day-deep-ink) 24%, transparent);
  background: color-mix(in srgb, var(--day-paper) 94%, transparent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--day-deep-ink) 14%, transparent);
  backdrop-filter: blur(16px);
}

.floating-demo-controls > span {
  padding-left: 8px;
  color: var(--day-muted);
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.floating-demo-controls div { display: flex; }

.floating-demo-controls button {
  display: grid;
  min-width: 58px;
  min-height: 44px;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border: 0;
  color: var(--day-muted);
  background: transparent;
  cursor: pointer;
}

.floating-demo-controls button b { color: var(--day-deep-ink); font-size: .75rem; }
.floating-demo-controls button span { font-size: .6875rem; font-weight: 750; }
.floating-demo-controls button[aria-pressed="true"] { color: var(--day-paper); background: var(--day-deep-ink); }
.floating-demo-controls button[aria-pressed="true"] b { color: inherit; }

.floating-download {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.floating-download[hidden] { display: none; }
.floating-download a { pointer-events: auto; }

.floating-download--split,
.floating-download--ribbon,
.floating-download--badge { padding: 0 var(--floating-space-md) var(--floating-safe-bottom); }

.floating-download__inner {
  margin-inline: auto;
  pointer-events: auto;
}

.floating-download__mascot {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.floating-download__copy {
  display: grid;
  gap: var(--floating-space-xs);
  margin: 0;
  min-width: 0;
}

.floating-download__copy strong {
  color: var(--day-deep-ink);
  font-size: .9375rem;
  letter-spacing: -.035em;
  line-height: 1.25;
}

.floating-download__copy span {
  color: var(--day-muted);
  font-size: .6875rem;
  font-weight: 700;
  line-height: 1.35;
}

.floating-download__stores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.floating-download__stores a {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: var(--floating-space-sm);
  padding: var(--floating-space-sm) var(--floating-space-md);
  color: inherit;
  text-decoration: none;
}

.store-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
}

.store-mark svg { display: block; width: 100%; height: 100%; }
.store-mark--apple svg { width: 22px; height: 22px; }

.store-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
  white-space: nowrap;
}

.store-copy small {
  font-size: .4375rem;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1;
}

.store-copy strong {
  font-size: .8125rem;
  letter-spacing: -.025em;
  line-height: 1.15;
}

/* A · character and message lead, stores read as two complete labels. */
.floating-download--split .floating-download__inner {
  display: grid;
  width: min(100%, 820px);
  min-height: 92px;
  grid-template-columns: 64px minmax(168px, 1fr) minmax(318px, auto);
  align-items: center;
  gap: var(--floating-space-md);
  padding: var(--floating-space-sm) var(--floating-space-md);
  border: 1px solid color-mix(in srgb, var(--day-deep-ink) 32%, transparent);
  border-radius: 32px;
  background: var(--day-paper);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--day-deep-ink) 16%, transparent);
}

.floating-download--split .floating-download__mascot { margin-left: -6px; }
.floating-download--split .floating-download__stores { gap: var(--floating-space-sm); }

.floating-download--split .floating-download__stores a {
  border: 1px solid color-mix(in srgb, var(--day-deep-ink) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--day-paper) 84%, var(--day-surface));
}

.floating-download--split .floating-download__stores a + a {
  color: var(--day-paper);
  border-color: var(--day-deep-ink);
  background: var(--day-deep-ink);
}

/* B · a warm identity capsule with the two stores integrated as one ribbon. */
.floating-download--ribbon .floating-download__inner {
  width: min(100%, 640px);
  overflow: hidden;
  border: 1px solid var(--day-deep-ink);
  border-radius: 30px;
  background: var(--day-paper);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--day-deep-ink) 18%, transparent);
}

.floating-download--ribbon .floating-download__identity {
  display: grid;
  min-height: 66px;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: var(--floating-space-sm);
  padding: 0 var(--floating-space-lg);
  background: color-mix(in srgb, var(--day-paper) 76%, var(--day-surface));
}

.floating-download--ribbon .floating-download__mascot {
  width: 68px;
  height: 68px;
  align-self: end;
  margin-left: -10px;
}

.floating-download--ribbon .floating-download__stores {
  border-top: 1px solid var(--day-deep-ink);
}

.floating-download--ribbon .floating-download__stores a {
  justify-content: center;
  color: var(--day-paper);
  background: var(--day-deep-ink);
}

.floating-download--ribbon .floating-download__stores a + a {
  color: var(--day-deep-ink);
  border-left: 1px solid var(--day-deep-ink);
  background: var(--day-accent);
}

/* C · smallest capsule, with familiar store badges kept fully legible. */
.floating-download--badge .floating-download__inner {
  display: grid;
  width: min(100%, 620px);
  min-height: 88px;
  grid-template-columns: minmax(220px, 1fr) 208px;
  align-items: center;
  gap: var(--floating-space-lg);
  padding: var(--floating-space-md);
  border-radius: 48px;
  background: var(--day-deep-ink);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--day-deep-ink) 22%, transparent);
}

.floating-download--badge .floating-download__identity {
  display: grid;
  min-width: 0;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: var(--floating-space-sm);
}

.floating-download--badge .floating-download__mascot {
  width: 58px;
  height: 58px;
}

.floating-download--badge .floating-download__copy strong { color: var(--day-paper); }
.floating-download--badge .floating-download__copy span { color: color-mix(in srgb, var(--day-paper) 70%, var(--day-accent)); }

.floating-download__cta {
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--floating-space-sm);
  padding: 6px 8px 6px 16px;
  border-radius: 22px;
  color: var(--day-deep-ink);
  background: var(--day-accent);
  text-decoration: none;
}

.floating-download__cta strong { font-size: .9375rem; letter-spacing: -.03em; line-height: 1.2; }
.floating-download__cta i {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  place-items: center;
  color: var(--day-paper);
  background: var(--day-deep-ink);
  font-size: 1rem;
  font-style: normal;
}

.floating-download-demo .mockup-toast {
  bottom: calc(156px + env(safe-area-inset-bottom));
}

:is(.floating-demo-controls button, .floating-download a):focus-visible {
  position: relative;
  outline: 3px solid var(--day-accent);
  outline-offset: 3px;
}

@media (max-width: 47.99rem) {
  .floating-download-demo { padding-bottom: 154px; }
  .floating-demo-controls { top: 8px; right: 8px; }
  .floating-demo-controls > span { display: none; }
  .floating-demo-controls button { min-width: 52px; }

  .floating-download__stores a {
    min-height: 50px;
    justify-content: center;
    padding-inline: var(--floating-space-sm);
  }

  .store-mark { width: 20px; height: 20px; flex-basis: 20px; }
  .store-mark--apple svg { width: 19px; height: 19px; }
  .store-copy strong { font-size: .75rem; }

  .floating-download--split .floating-download__inner {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas: "mascot copy" "stores stores";
    gap: var(--floating-space-xs) var(--floating-space-sm);
    padding: var(--floating-space-sm);
    border-radius: 26px;
  }

  .floating-download--split .floating-download__mascot {
    grid-area: mascot;
    width: 52px;
    height: 52px;
  }

  .floating-download--split .floating-download__copy { grid-area: copy; }
  .floating-download--split .floating-download__stores { grid-area: stores; gap: var(--floating-space-xs); }

  .floating-download--ribbon .floating-download__identity {
    min-height: 58px;
    grid-template-columns: 48px minmax(0, 1fr);
    padding-inline: var(--floating-space-md);
  }

  .floating-download--ribbon .floating-download__mascot {
    width: 56px;
    height: 56px;
  }

  .floating-download--badge .floating-download__inner {
    width: min(100%, 300px);
    min-height: 72px;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: var(--floating-space-sm);
    padding: var(--floating-space-sm);
    border-radius: 30px;
  }

  .floating-download--badge .floating-download__identity {
    display: block;
  }

  .floating-download--badge .floating-download__mascot {
    width: 44px;
    height: 44px;
  }

  .floating-download--badge .floating-download__copy { display: none; }
  .floating-download__cta { min-height: 52px; border-radius: 20px; }
}

@media (max-width: 22rem) {
  .floating-demo-controls {
    position: absolute;
    top: 82px;
    padding: 0;
  }
  .floating-demo-controls button {
    min-width: 44px;
    grid-template-columns: 1fr;
  }
  .floating-demo-controls button span { display: none; }
  .floating-download--split,
  .floating-download--ribbon,
  .floating-download--badge { padding-inline: var(--floating-space-sm); }
  .floating-download__copy strong { font-size: .8125rem; }
  .floating-download__copy span { font-size: .625rem; }
  .floating-download--badge .floating-download__inner { grid-template-columns: 40px minmax(0, 1fr); }
  .floating-download--badge .floating-download__mascot { width: 40px; height: 40px; }
  .floating-download__cta { width: 100%; }
  .store-copy small { font-size: .375rem; }
  .store-copy strong { font-size: .6875rem; }
}

@media (hover: hover) and (pointer: fine) {
  .floating-download a { transition: color .2s ease, background-color .2s ease, transform .2s cubic-bezier(.22, 1, .36, 1); }
  .floating-download a:hover { transform: translateY(-2px); }
  .floating-download--split a:hover,
  .floating-download--badge a:hover { color: var(--day-paper); background: var(--day-accent); }
  .floating-download--ribbon a:hover { color: var(--day-deep-ink); background: var(--day-paper); }
}

@media (prefers-reduced-motion: reduce) {
  .floating-download a { transition: none; }
}
