/* ============================================================
   GhostChat download — GhostSocial v2 design language.
   Standalone: tokens + полный каркас. DOM и download.js не меняются.
   Палитра и типографика = ghostsocial-v2-ui.css (:root):
   тёмный нейтральный #111113, поверхности #1b1b1f/#242429,
   лаванда #b39af4, Inter, плоские карточки, тонкие сепараторы.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1b1b1f;
  --surface2: #242429;
  --text: #f1f1f4;
  --sub: #9b9ba5;
  --muted: #777782;
  --primary: #b39af4;
  --primary2: #b39af4;
  --accent: #b39af4;
  --border: #28282e;
  --border-strong: #3a3a43;
  --red: #f27889;
  --green: #82cfa7;
  --amber: #e7c078;

  /* производные (social-стиль) */
  --primary-soft: rgba(179, 154, 244, .14);
  --primary-line: rgba(179, 154, 244, .40);
  --glow: rgba(179, 154, 244, .16);
  --ink: #151218; /* тёмный текст на лавандовой кнопке */
  --content-w: 640px;
  --gs-ease: cubic-bezier(.2, .8, .2, 1);
  --gs-fast: 160ms;
}

/* ---------- база ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1, h2, h3, p, ul, ol { margin: 0; }

::selection { background: rgba(179, 154, 244, .35); color: var(--text); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

svg { flex: none; }

/* ---------- каркас: app / screens ---------- */

.app {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  display: none;
}

.screen.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.screen > .topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 10px;
}

.screen > .body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 24px 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.screen > .bottom {
  padding: 10px 24px calc(16px + env(safe-area-inset-bottom, 0px));
}

/* ---------- шапка ---------- */

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand em {
  font-style: normal;
  color: var(--primary);
}

.step-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* ---------- кнопки ---------- */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--gs-fast) ease, color var(--gs-fast) ease,
              transform var(--gs-fast) ease;
}

.button:hover { background: var(--border-strong); }

.button:active { transform: translateY(1px); }

.button.primary {
  background: var(--primary);
  color: var(--ink);
}

.button.primary:hover { background: #c6b1f7; }
.button.primary:disabled {
  background: var(--primary);
  color: var(--ink);
  opacity: .42;
}

.button.ghost {
  background: transparent;
  color: var(--sub);
}

.button.ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

.button:disabled {
  transform: none;
  cursor: default;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:focus-visible,
.version-card:focus-visible,
.migration-link:focus-visible,
.release-preview:focus-visible,
.runtime-refresh:focus-visible {
  outline: 2px solid rgba(179, 154, 244, .65);
  outline-offset: 2px;
}

/* ---------- появление элементов ---------- */

.enter {
  opacity: 0;
  animation: enter .45s var(--gs-ease) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   ЭКРАН 1 — скачивание
   ============================================================ */

.screen--download > .download-body {
  display: grid;
  align-content: center;
  padding-bottom: 12px;
}

.download-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .86fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "copy visual"
    "actions visual";
  align-items: center;
  column-gap: clamp(44px, 6.5vw, 96px);
  row-gap: 24px;
  width: min(100%, 1030px);
  margin-inline: auto;
}

/* --- левая колонка --- */

.download-copy {
  grid-area: copy;
  min-width: 0;
}

.download-title {
  margin-bottom: 24px;
  font-size: clamp(34px, 4.6vw, 44px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.03em;
}

.download-title-brand,
.download-title-platform { display: block; }

.download-title em {
  font-style: normal;
  color: var(--primary);
}

.download-title-platform {
  margin-top: 6px;
  color: var(--sub);
  font-size: .5em;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -.01em;
}

.download-release-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 455px);
  min-height: 84px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color var(--gs-fast) ease, background var(--gs-fast) ease;
}

.download-release-panel:hover {
  border-color: var(--border-strong);
  background: var(--surface2);
}

.release-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface2);
  color: var(--primary);
}

.release-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.release-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.release-caption {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.download-version-title {
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-file-size {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.release-format {
  display: grid;
  place-items: center;
  flex: none;
  margin-left: auto;
  min-width: 40px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--sub);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

/* примечание о сборке — визуально скрыто, читается скринридером */
.download-release-note {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* --- миграция с 1.1.24 --- */

.migration-disclosure {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.migration-link {
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  margin: 14px 0 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--sub);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color var(--gs-fast) ease;
}

.migration-link:hover { color: var(--text); }

.migration-link[hidden] { display: none !important; }

.migration-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s var(--gs-ease);
}

.migration-link[aria-expanded="true"] svg { transform: rotate(180deg); }

.migration-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .32s var(--gs-ease), opacity .2s ease,
              visibility 0s linear .32s;
}

.migration-details.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows .32s var(--gs-ease), opacity .2s ease;
}

.migration-details-inner { min-height: 0; overflow: hidden; }

.migration-copy {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 455px;
}

.migration-copy strong { color: var(--text); font-weight: 650; }

/* --- правая колонка: визуал --- */

.download-visual-column {
  position: relative;
  grid-area: visual;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  min-height: 420px;
  min-width: 0;
}

.download-art {
  --phone-half: clamp(125px, 13.5vw, 157.5px);
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 420px);
  isolation: isolate;
}

.download-art::before {
  content: "";
  position: absolute;
  z-index: -2;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    var(--glow) 0%,
    rgba(179, 154, 244, .08) 43%,
    transparent 72%);
}

.download-art-ring {
  position: absolute;
  inset: 15% 11%;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.download-phone-mockup {
  display: block;
  width: calc(var(--phone-half) * 2);
  max-width: 100%;
  height: auto;
  border-radius: 24px;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, .42));
  user-select: none;
  pointer-events: none;
}

.download-apk-sticker {
  position: absolute;
  right: calc(50% - var(--phone-half) - 8px);
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--primary);
}

.download-apk-sticker svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- блок действий --- */

.download-action-cluster {
  grid-area: actions;
  display: grid;
  gap: 10px;
  width: min(100%, 455px);
}

.release-preview {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity var(--gs-fast) ease;
}

.release-preview[hidden] { display: none !important; }

.release-preview:hover { opacity: .86; }

.release-preview-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}

.release-preview-heading strong {
  color: var(--primary);
  font-weight: 700;
}

.release-preview-heading svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--gs-fast) ease;
}

.release-preview:hover .release-preview-heading svg { transform: translateX(3px); }

.release-preview-copy {
  display: -webkit-box;
  max-width: 42em;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.download-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.download-action-primary {
  min-height: 52px;
  width: 100%;
  min-width: 0;
}

.download-action-primary svg { width: 20px; height: 20px; }

.download-action-secondary {
  min-height: 44px;
}

/* ============================================================
   ЭКРАН 2 — каталог версий
   ============================================================ */

.screen--versions > .versions-body {
  width: min(100%, 640px);
  margin-inline: auto;
  padding-top: 20px;
  padding-bottom: 34px;
}

.versions-body h1 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.versions-body h1 em {
  font-style: normal;
  color: var(--primary);
}

.versions-body > p {
  color: var(--sub);
  margin-bottom: 26px;
  font-size: 14px;
}

.download-version-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  text-align: left;
}

.version-group { min-width: 0; }

.version-group-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.01em;
}

.version-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.version-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.version-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-height: 96px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--gs-fast) ease, border-color var(--gs-fast) ease,
              transform var(--gs-fast) ease;
}

.version-card:hover {
  background: var(--surface2);
  border-color: var(--border-strong);
}

.version-card:active { transform: translateY(1px); }

.version-card[aria-current="true"],
.version-card[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.version-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--primary);
}

.version-icon svg,
.version-card svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.version-copy {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.version-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-meta {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-current {
  position: absolute;
  top: 10px;
  right: 11px;
  max-width: calc(100% - 42px);
  margin: 0;
  overflow: hidden;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versions-loading {
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   ЭКРАН 3 — карточка версии
   ============================================================ */

.screen--version-detail > .version-detail-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding-bottom: 10px;
}

.version-detail-content {
  width: min(100%, var(--content-w));
  margin-inline: auto;
}

.version-detail-title {
  display: grid;
  gap: 12px;
  margin-bottom: 6px;
}

.version-detail-brand {
  display: block;
  font-size: clamp(34px, 6vw, 42px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.03em;
}

.version-detail-brand em {
  font-style: normal;
  color: var(--primary);
}

.version-detail-version {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.version-detail-version-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.version-detail-number {
  color: var(--primary);
  font-size: clamp(26px, 4.5vw, 32px);
  font-weight: 800;
  letter-spacing: -.02em;
}

.version-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.version-detail-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.version-detail-notes {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.version-detail-notes h2 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.version-detail-notes p {
  color: var(--sub);
  font-size: 14.5px;
  line-height: 1.6;
}

/* состояние загрузки */

.version-detail-download-state {
  width: min(100%, var(--content-w));
  margin: 20px auto 0;
}

.download-progress {
  overflow: hidden;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--border);
}

.download-progress[hidden] { display: none !important; }

.download-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .18s linear;
}

.download-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.download-status:empty { display: none; }

.download-status[data-kind="error"] { color: #ffb8c5; }
.download-status[data-kind="ok"]    { color: #bdffd2; }

/* нижняя панель карточки версии */

.version-detail-bottom .controls {
  display: flex;
  gap: 8px;
  width: min(100%, var(--content-w));
  margin-inline: auto;
}

.version-detail-bottom .controls > .button:first-child { flex: none; }

.version-detail-bottom .controls > .button:last-child,
.version-detail-bottom .download-action-primary {
  flex: 1;
  min-height: 52px;
}

/* ============================================================
   Модальный (captcha / сообщения) — строит download.js
   ============================================================ */

.runtime-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 17, 19, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: overlay-in .18s ease both;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.runtime-dialog {
  width: min(100%, 420px);
  display: grid;
  gap: 4px;
  text-align: center;
}

.runtime-dialog.is-card {
  padding: 22px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .5);
  animation: dialog-in .22s var(--gs-ease) both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.runtime-kicker {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.runtime-title {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.runtime-copy {
  color: var(--sub);
  font-size: 13px;
  line-height: 1.55;
}

.runtime-captcha {
  display: block;
  margin: 12px auto 2px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}

.runtime-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.runtime-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.runtime-input:focus-visible {
  outline: none;
  border-color: var(--primary);
}

.runtime-refresh {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--sub);
  cursor: pointer;
  transition: color var(--gs-fast) ease, background var(--gs-fast) ease;
}

.runtime-refresh:hover {
  background: var(--border-strong);
  color: var(--text);
}

.runtime-refresh svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.runtime-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.runtime-actions > .button { flex: 1; min-height: 46px; }

.button.primary.runtime-submit {
  background: var(--primary);
  color: var(--ink);
}

.button.primary.runtime-submit:hover { background: #c6b1f7; }

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 720px) {
  .screen > .topbar { padding: 12px 18px 8px; }
  .screen > .body {
    padding: 10px 18px 20px;
    scrollbar-width: none;
  }

  .screen > .body::-webkit-scrollbar { display: none; }

  .screen > .bottom { padding-inline: 18px; }

  .download-layout {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 36%);
    grid-template-rows: auto auto;
    grid-template-areas:
      "copy copy"
      "actions visual";
    align-content: start;
    align-items: end;
    column-gap: 10px;
    row-gap: 8px;
    width: 100%;
    padding-bottom: 4px;
  }

  .download-title {
    margin-bottom: 16px;
    font-size: clamp(30px, 9vw, 38px);
  }

  .download-release-panel {
    width: 100%;
    min-height: 72px;
    padding: 12px 14px 12px 52px;
    gap: 11px;
  }

  .release-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .download-version-title { font-size: 18px; }

  .migration-copy {
    max-width: none;
    font-size: 13px;
  }

  .download-visual-column {
    min-height: clamp(150px, 32vh, 235px);
  }

  .download-art { --phone-half: clamp(62px, 17vw, 92px); }
  .download-art-ring { inset: 12% 8%; }

  .download-apk-sticker {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .download-apk-sticker svg { width: 17px; height: 17px; }

  .download-action-row { gap: 8px; }
  .download-action-primary { min-height: 50px; padding-inline: 14px; }

  .versions-body h1 { font-size: clamp(30px, 10vw, 38px); }

  .download-version-list { gap: 18px; padding-top: 4px; }

  .version-group-grid { gap: 7px; }

  .version-card {
    gap: 7px;
    min-height: 84px;
    padding: 10px 9px;
    border-radius: 11px;
  }

  .version-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  .version-name { font-size: 13px; }

  .screen--version-detail .version-detail-number { font-size: clamp(24px, 7vw, 30px); }
}

@media (max-height: 640px) and (max-width: 720px) {
  .download-title { margin-bottom: 12px; }
  .download-release-panel { min-height: 64px; }
  .download-visual-column { min-height: clamp(110px, 22vh, 150px); }
  .download-art { --phone-half: clamp(52px, 14vw, 74px); }
  .migration-link { margin-top: 10px; }
  .screen > .topbar { padding-top: 8px; }
}

@media (max-height: 480px) and (max-width: 720px) {
  .download-visual-column { min-height: 96px; }
  .download-art { --phone-half: clamp(44px, 12vw, 60px); }
}

@media (max-width: 430px) {
  .screen > .topbar { padding: 12px 16px 8px; }
  .screen > .body { padding: 10px 16px 20px; }
  .screen > .bottom { padding-inline: 16px; }

  .download-release-panel { padding-left: 48px; min-height: 68px; }
  .release-icon { width: 32px; height: 32px; }
  .download-action-secondary { padding-inline: 12px; }

  .version-card { min-height: 78px; }
}

@media (max-width: 300px) {
  .version-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-action-row {
    grid-template-columns: 1fr;
  }

  .download-action-secondary { min-height: 44px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .enter {
    animation: none;
    opacity: 1;
  }

  .runtime-overlay,
  .runtime-dialog.is-card {
    animation: none;
  }

  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }

  html { scroll-behavior: auto; }
}

/* ---------- печать / прочее ---------- */

@media (min-width: 1441px) {
  .download-layout { column-gap: 110px; }
}
