.platforms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  width: min(100%, 1120px);
  margin: 28px auto 0;
}
.platform {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}
.platform-button {
  position: relative;
  display: block;
  width: min(100%, 224px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.platform-face, .platform-qr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 180ms ease, transform 240ms ease, border-color 180ms ease, background 180ms ease;
}
.platform-face {
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
}
.platform-logo { width: 60px; height: 60px; fill: currentColor; flex: none; }
.platform--android .platform-logo { color: var(--blue); }
.platform-name { font-size: 23px; font-weight: 500; line-height: 1.3; letter-spacing: 0; }
.platform-qr { opacity: 0; transform: translateY(8px) scale(0.96); pointer-events: none; gap: 13px; }
.platform-qr img { width: 164px; height: 164px; border-radius: 8px; background: white; }
.platform-qr span { font-size: 15px; line-height: 1.5; color: var(--blue); }
.platform.is-qr-open .platform-face { opacity: 0; transform: translateY(-6px) scale(0.96); }
.platform.is-qr-open .platform-qr { opacity: 1; transform: none; }
.platform-button:focus-visible, .platform-caption--link:focus-visible,
.desktop-close:focus-visible, .desktop-download-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 6px;
}
.platform-caption {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1.6;
}
.platform-caption svg { width: 15px; height: 15px; }
@media (hover: hover) {
  .platform-button:hover .platform-face {
    border-color: var(--blue);
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-4px);
  }
  .platform.is-qr-open .platform-button:hover .platform-face { transform: translateY(-6px) scale(0.96); }
  .platform-caption--link:hover { color: var(--blue); }
}
body:has(.desktop-download[open]) { overflow: hidden; }
.desktop-download {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.desktop-download[open] { animation: download-dialog-in 180ms ease-out; }
.desktop-download::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); }
.desktop-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--text-faint);
  background: transparent;
}
.desktop-close:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.desktop-close svg { width: 20px; height: 20px; }
.desktop-logo { width: 38px; height: 38px; fill: currentColor; margin-bottom: 20px; }
.desktop-heading h2 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.desktop-heading p { margin: 10px 0 28px; color: var(--text-faint); font-size: 14px; line-height: 1.6; }
.desktop-versions { display: grid; gap: 12px; padding: 0; margin: 0; min-width: 0; border: 0; }
.desktop-version {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 90px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.desktop-version:has(input:checked) { border-color: var(--blue); background: rgba(27, 112, 255, 0.08); }
.desktop-version:has(input:disabled) { cursor: default; }
.desktop-version input {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: transparent;
}
.desktop-version input:checked { border: 5px solid var(--blue); }
.desktop-version input:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.desktop-version-copy { display: grid; gap: 6px; min-width: 0; flex: 1; }
.desktop-version-name { font-size: 16px; line-height: 1.3; font-weight: 500; }
.desktop-version-detail { font-size: 12px; line-height: 1.5; color: var(--text-faint); }
.desktop-version-status { font-size: 12px; color: var(--text-faint); flex: none; }
.desktop-help { margin: 18px 0 24px; color: var(--text-faint); font-size: 12px; line-height: 1.8; }
.desktop-footer { padding-top: 22px; border-top: 1px solid var(--line); }
.desktop-file { min-height: 20px; margin: 0 0 14px; color: var(--text-soft); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}
.desktop-download-button svg { width: 18px; height: 18px; }
.desktop-download-button:hover { background: var(--blue-strong); }
.desktop-download-button[aria-disabled="true"] { background: rgba(255, 255, 255, 0.07); color: var(--text-faint); cursor: not-allowed; }
@keyframes download-dialog-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 920px) {
  .platforms { gap: 20px; }
  .platform-name { font-size: 20px; }
  .platform-qr img { width: 132px; height: 132px; }
  .platform-logo { width: 48px; height: 48px; }
}
@media (max-width: 640px) {
  body[data-page="download"] .site-main { padding-inline: 16px; padding-top: 28px; }
  body[data-page="download"] .download-section { margin-inline: 0; }
  body[data-page="download"] .download-shell { width: 100%; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px 18px; margin-top: 12px; }
  .platform { gap: 15px; }
  .platform-button { max-width: 190px; }
  .platform-face { gap: 14px; }
  .platform-qr { gap: 8px; }
  .platform-qr img { width: 74%; height: auto; aspect-ratio: 1; }
  .platform-qr span { font-size: 12px; }
  .platform-caption { font-size: 12px; }
  .desktop-download { padding: 28px 20px; }
  .desktop-heading h2 { font-size: 22px; }
  .desktop-version { padding: 14px 12px; gap: 10px; }
  .desktop-version-status { max-width: 72px; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .platform-face, .platform-qr, .desktop-version { transition: none; }
  .desktop-download[open] { animation: none; }
}
