:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #14211f;
  --muted: #60716d;
  --line: #d9e2df;
  --blue: #155eef;
  --teal: #0f766e;
  --soft: #eef6f5;
  --warn: #8a5a12;
  --warnbg: #fff8e8;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.bar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; object-fit: contain; }
.brand small { display: block; color: var(--muted); font-size: 13px; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
a { color: inherit; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 800; padding: 9px 11px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current="page"] { background: #eef4f6; }
main { padding: 34px 0 56px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { max-width: 760px; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; }
h2 { font-size: 24px; }
h3 { font-size: 21px; }

.download-hero { padding: 20px 0 32px; }
.eyebrow { margin-bottom: 8px; color: var(--teal); font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.lead { max-width: 800px; margin-top: 14px; color: var(--muted); font-size: 18px; }
.detection-status { display: inline-flex; margin-top: 20px; padding: 9px 12px; border: 1px solid #c8d8e5; border-radius: 999px; background: #eef6ff; color: #174ea6; font-size: 14px; font-weight: 800; }
.download-section { margin-top: 4px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.release-state-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.release-state { color: var(--muted); font-size: 13px; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }

.recommended-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card, .release-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 10px 30px rgba(25, 45, 55, .06); }
.card { padding: 22px; }
.card p { margin-top: 6px; color: var(--muted); }
.release-card { display: flex; min-width: 0; flex-direction: column; padding: 22px; }
.recommended-card { min-height: 300px; border-color: #b9ccf8; background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 58%, #eef6ff 100%); }
.release-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.recommended-badge { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; background: #155eef; color: #fff; font-size: 12px; font-weight: 900; }
.release-description, .section-note { margin-top: 8px; color: var(--muted); }
.meta { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 7px 10px; margin: 18px 0 0; font-size: 14px; }
.meta dt { color: #42526e; font-weight: 800; }
.meta dd { color: var(--muted); overflow-wrap: anywhere; }
.changelog { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 20px; }
.primary-actions { margin-top: 16px; padding-top: 0; }
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 16px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn.secondary { border: 1px solid #c9dcda; background: var(--soft); color: #0b5f59; }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.checksum { margin-top: 16px; color: var(--muted); font-size: 13px; }
.checksum summary { cursor: pointer; font-weight: 800; }
.checksum code { display: block; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf9; color: #344054; overflow-wrap: anywhere; }
.release-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.release-notes summary { cursor: pointer; color: #344054; font-weight: 800; }
.release-notes p { margin-top: 9px; }
.unsupported-card { min-height: 220px; }
.empty-card { color: var(--muted); }

.loading-card { min-height: 300px; justify-content: center; gap: 16px; }
.loading-bar, .loading-button { display: block; height: 24px; border-radius: 8px; background: linear-gradient(100deg, #edf1f5 20%, #f8fafc 45%, #edf1f5 70%); background-size: 220% 100%; animation: loading-shimmer 1.2s linear infinite; }
.loading-bar.short { width: 62%; height: 18px; }
.loading-button { width: 190px; height: 42px; margin-top: 16px; }
@keyframes loading-shimmer { to { background-position: -220% 0; } }

.advanced-downloads { margin-top: 22px; padding: 0; overflow: hidden; }
.advanced-downloads > summary { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; cursor: pointer; list-style: none; font-size: 18px; font-weight: 900; }
.advanced-downloads > summary::-webkit-details-marker { display: none; }
.advanced-downloads > summary::after { content: "+"; display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--blue); font-size: 22px; }
.advanced-downloads[open] > summary::after { content: "−"; }
.advanced-downloads > summary small { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.advanced-content { display: grid; gap: 28px; padding: 0 22px 24px; border-top: 1px solid var(--line); }
.advanced-content > section { padding-top: 24px; }
.note { border-color: #ead8af; background: var(--warnbg); color: var(--warn); }
.note p { color: var(--warn); }
.user-center-promo { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.user-center-promo .btn { flex: 0 0 auto; }
.mt-16 { margin-top: 16px; }

.modal { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(10, 20, 24, .52); }
.modal.open { display: flex; }
.dialog { width: min(420px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.dialog[aria-busy="true"] { cursor: wait; }
.dialog h2 { font-size: 20px; }
.dialog label { display: block; margin: 14px 0 7px; font-weight: 800; }
.dialog input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #c7d3d0; border-radius: 8px; font-size: 18px; }
.dialog .error { min-height: 22px; margin-top: 9px; color: #b42318; font-size: 14px; }
.dialog .actions { justify-content: flex-end; padding-top: 8px; }
.dialog .actions [hidden] { display: none; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .release-state-wrap { justify-content: flex-start; }
  .advanced-downloads > summary { align-items: flex-start; }
  .advanced-downloads > summary small { display: none; }
  .user-center-promo { align-items: stretch; flex-direction: column; }
  .user-center-promo .btn { width: 100%; }
}

@media (max-width: 520px) {
  main { padding-top: 22px; }
  .download-hero { padding-top: 8px; }
  .meta { grid-template-columns: 1fr; }
  .meta dd + dt { margin-top: 5px; }
  .release-card, .card { padding: 18px; }
  .advanced-downloads { padding: 0; }
  .advanced-downloads > summary { padding: 18px; }
  .advanced-content { padding: 0 18px 18px; }
  .primary-actions .btn { width: 100%; }
  .dialog .actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar, .loading-button { animation: none; }
}
