/* The same compact platform picker, wherever a visitor downloads Central. */
.download-menu {
  position: relative;
  min-width: 0;
}

/* Anchor header menus to the trailing edge of the whole navigation. An
   icon between the logo and Sign in is too far left on a narrow phone. */
.top-nav {
  position: relative;
}

.download-menu-top {
  position: static;
}

.download-menu [data-download-toggle] {
  gap: 8px;
  touch-action: manipulation;
}

.download-chevron {
  flex: none;
  width: 12px;
  height: 12px;
  opacity: 0.65;
  transition: transform 140ms var(--ease);
}

[data-download-toggle][aria-expanded='true'] .download-chevron {
  transform: rotate(180deg);
}

.download-options {
  position: absolute;
  z-index: 12;
  top: calc(100% + 10px);
  right: 0;
  width: min(294px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: min(360px, calc(100dvh - 104px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 18px;
  background: #252525;
  color: var(--label);
  box-shadow: 0 18px 54px rgb(0 0 0 / 0.36);
  animation: download-menu-in 140ms var(--ease) both;
}

.download-menu-heading {
  margin: 5px 10px 7px;
  color: var(--label-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.download-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.download-option:not(:disabled):hover,
.download-option:not(:disabled):focus-visible {
  background: rgb(255 255 255 / 0.08);
}

.download-option:disabled {
  color: var(--label-2);
  cursor: default;
}

.download-option-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.download-option-copy strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.download-option-copy > span {
  color: var(--label-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.download-option:disabled .download-option-copy > span {
  color: inherit;
}

.download-platform-mark {
  flex: none;
  width: 22px;
  height: 24px;
}

.download-option-arrow {
  flex: none;
  width: 17px;
  height: 17px;
  margin-left: auto;
  color: var(--label-2);
}

.download-options .download-meta {
  margin: 6px 12px 8px;
  padding-top: 11px;
  border-top: 1px solid var(--edge);
  font-size: 0.6875rem;
  line-height: 1.6;
}

.download-menu-retry {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill-1);
  color: var(--label);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.download-menu-profile .profile-item {
  display: flex;
  align-items: center;
}

.download-menu-profile .download-chevron {
  margin-left: auto;
}

.download-menu-profile .download-options {
  position: relative;
  inset: auto;
  width: 100%;
  margin: 3px 0 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgb(0 0 0 / 0.14);
  box-shadow: none;
}

.download-menu-profile .download-menu-heading {
  display: none;
}

.download-menu-main .download-options {
  top: auto;
  bottom: calc(100% + 10px);
  right: auto;
  left: 0;
}

.download-found:not([data-state='release']) {
  display: grid;
}

/* Home has its public Download control in the header. */
.home .download-found {
  display: none;
}

.signin-consent {
  min-height: 64px;
  padding: 14px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--fill-1);
  color: var(--label-2);
}

.signin-consent input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.signin-consent:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.signin-consent:has(input:checked) {
  border-color: rgb(255 255 255 / 0.28);
}

.signin-consent-help {
  margin: -8px 2px 0;
  color: var(--label-2);
  font-size: 0.75rem;
  line-height: 1.5;
}

.signin-dialog .signin-close {
  min-width: 44px;
  min-height: 44px;
}

@keyframes download-menu-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  .download-menu-top .top-link {
    display: inline-flex;
    min-width: 40px;
    padding: 0 10px;
  }

  .download-menu-top .top-link > span,
  .download-menu-top .top-link .download-chevron {
    display: none;
  }
}

@media (pointer: coarse) {
  .download-menu-top .top-link,
  .download-menu-profile .profile-item {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-options { animation: none; }
  .download-chevron { transition: none; }
}
