:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17202e;
  --muted: #667281;
  --border: #dce3eb;
  --soft: #f7f9fb;
  --accent: #1f6feb;
  --accent-hover: #1557bd;
  --dark: #17202e;
  --shadow: 0 18px 45px rgba(22, 32, 46, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 18px auto 48px;
}

.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 24px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(22, 32, 46, 0.06);
}

.tab {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background: var(--dark);
  color: #ffffff;
}

.card {
  margin-top: 24px;
}

.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(31, 111, 235, 0.24);
}

.download-btn:hover {
  background: var(--accent-hover);
}

.status {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.status.ok {
  color: #2d7d46;
}

.status.error {
  color: #b42318;
}

.versions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.release-card {
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(22, 32, 46, 0.08);
}

.release-line {
  display: grid;
  grid-template-columns:
    minmax(110px, 1fr)
    minmax(145px, 1fr)
    minmax(95px, 0.8fr)
    minmax(170px, 1.2fr)
    auto;
  align-items: center;
  gap: 14px;
}

.release-version {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.release-meta {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.release-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.release-download:hover {
  background: var(--accent-hover);
}

.release-comment {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  color: var(--text);
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, 1040px);
    margin-top: 10px;
  }

  .hero {
    padding: 24px;
    border-radius: 18px;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .download-btn {
    width: 100%;
  }

  .release-line {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .release-download {
    width: 100%;
    margin-top: 4px;
  }
}

/* ===== QR для последней версии ===== */

.release-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.release-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.release-qr:hover {
  background: #eef4ff;
  border-color: #b9cef7;
}

.qr-open {
  overflow: hidden;
}

.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.qr-modal.open {
  display: block;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.qr-dialog {
  position: relative;
  width: min(420px, calc(100% - 32px));
  margin: 8vh auto 0;
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  color: var(--text);
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.qr-dialog h3 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  color: var(--text);
}

.qr-subtitle {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.qr-image-wrap {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-radius: 18px;
  background: #f7f9fb;
  border: 1px solid var(--border);
}

.qr-image-wrap img {
  width: 280px;
  height: 280px;
  max-width: 100%;
  object-fit: contain;
}

.qr-link {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fb;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-all;
  text-decoration: none;
}

.qr-copy {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 760px) {
  .release-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .release-qr,
  .release-download {
    width: 100%;
  }

  .qr-dialog {
    margin-top: 4vh;
  }
}

/* ===== v7: убран верхний блок, последняя версия отдельно, старые версии ниже ===== */

.card {
  margin-top: 16px;
}

.status[hidden] {
  display: none !important;
}

.release-card-latest {
  border-color: #b9cef7;
  box-shadow: 0 16px 40px rgba(31, 111, 235, 0.12);
}

.releases-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.releases-separator::before,
.releases-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.release-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.release-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.release-qr:hover {
  background: #eef4ff;
  border-color: #b9cef7;
}

.release-card:not(.release-card-latest) .release-qr {
  display: none !important;
}

.qr-open {
  overflow: hidden;
}

.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.qr-modal.open {
  display: block;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.qr-dialog {
  position: relative;
  width: min(420px, calc(100% - 32px));
  margin: 8vh auto 0;
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  color: var(--text);
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.qr-dialog h3 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  color: var(--text);
}

.qr-subtitle {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.qr-image-wrap {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-radius: 18px;
  background: #f7f9fb;
  border: 1px solid var(--border);
}

.qr-image-wrap img {
  width: 280px;
  height: 280px;
  max-width: 100%;
  object-fit: contain;
}

.qr-link {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fb;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-all;
  text-decoration: none;
}

.qr-copy {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 760px) {
  .release-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .release-qr,
  .release-download {
    width: 100%;
  }

  .qr-dialog {
    margin-top: 4vh;
  }
}
