.sd-release-library {
  width: 100%;
  max-width: 56rem;
  margin: 5rem auto 0;
}

.sd-release-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sd-release-intro h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}

.sd-release-intro p {
  max-width: 38rem;
  margin: 0.65rem 0 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.sd-release-count,
.sd-release-channel,
.sd-release-backup,
.sd-release-device,
.sd-release-unavailable {
  font-family: var(--font-fira-code), ui-monospace, SFMono-Regular, Consolas, monospace;
}

.sd-release-count {
  flex: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
}

.sd-release-list {
  display: grid;
  gap: 0.75rem;
}

.sd-release-card {
  padding: 1.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.sd-release-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.sd-release-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.sd-release-notes {
  max-width: 44rem;
  margin: 0.45rem 0 0;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.55;
}

.sd-release-channel {
  flex: none;
  padding: 0.38rem 0.55rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.4rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sd-release-badges {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sd-release-live {
  padding: 0.38rem 0.55rem;
  border: 1px solid #86efac;
  border-radius: 0.4rem;
  background: #f0fdf4;
  color: #15803d;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sd-release-card.is-live {
  border-color: #93c5fd;
  background: #eff6ff;
}

.sd-release-channel[data-channel="beta"],
.sd-current-channel[data-channel="beta"] {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.sd-release-channel[data-channel="legacy"],
.sd-current-channel[data-channel="legacy"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.sd-release-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.sd-release-detail {
  min-width: 0;
}

.sd-release-detail dt {
  color: #64748b;
  font-size: 0.72rem;
}

.sd-release-detail dd {
  margin: 0.3rem 0 0;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sd-release-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.sd-release-backup,
.sd-release-device {
  color: #64748b;
  font-size: 0.69rem;
}

.sd-release-download {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0 0.9rem;
  border-radius: 0.6rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.sd-release-download:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.sd-release-download:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

.sd-release-unavailable {
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 700;
}

.sd-release-empty,
.sd-release-load-error {
  width: 100%;
  max-width: 56rem;
  margin: 4rem auto 0;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  color: #475569;
  font-size: 0.9rem;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .sd-release-intro h2,
  .sd-release-heading h3,
  .sd-release-detail dd { color: #f8fafc; }
  .sd-release-intro p,
  .sd-release-notes { color: #cbd5e1; }
  .sd-release-count,
  .sd-release-channel { border-color: #1e3a8a; background: rgba(30, 64, 175, 0.2); color: #93c5fd; }
  .sd-release-channel[data-channel="beta"],
  .sd-current-channel[data-channel="beta"] { border-color: #854d0e; background: rgba(161, 98, 7, 0.18); color: #fde68a; }
  .sd-release-channel[data-channel="legacy"],
  .sd-current-channel[data-channel="legacy"] { border-color: #475569; background: rgba(71, 85, 105, 0.24); color: #cbd5e1; }
  .sd-release-card { border-color: #1e293b; background: #11131f; }
  .sd-release-card.is-live { border-color: #1d4ed8; background: rgba(30, 64, 175, 0.14); }
  .sd-release-live { border-color: #166534; background: rgba(22, 101, 52, 0.2); color: #86efac; }
  .sd-release-metadata { border-color: #1e293b; }
  .sd-release-detail dt,
  .sd-release-backup,
  .sd-release-device { color: #94a3b8; }
  .sd-release-download { background: #f8fafc; color: #0f172a; }
  .sd-release-download:hover { background: #bfdbfe; }
  .sd-release-empty,
  .sd-release-load-error { border-color: #1e293b; color: #cbd5e1; }
}

.dark .sd-release-intro h2,
.dark .sd-release-heading h3,
.dark .sd-release-detail dd { color: #f8fafc; }
.dark .sd-release-intro p,
.dark .sd-release-notes { color: #cbd5e1; }
.dark .sd-release-count,
.dark .sd-release-channel { border-color: #1e3a8a; background: rgba(30, 64, 175, 0.2); color: #93c5fd; }
.dark .sd-release-channel[data-channel="beta"],
.dark .sd-current-channel[data-channel="beta"] { border-color: #854d0e; background: rgba(161, 98, 7, 0.18); color: #fde68a; }
.dark .sd-release-channel[data-channel="legacy"],
.dark .sd-current-channel[data-channel="legacy"] { border-color: #475569; background: rgba(71, 85, 105, 0.24); color: #cbd5e1; }
.dark .sd-release-card { border-color: #1e293b; background: #11131f; }
.dark .sd-release-card.is-live { border-color: #1d4ed8; background: rgba(30, 64, 175, 0.14); }
.dark .sd-release-live { border-color: #166534; background: rgba(22, 101, 52, 0.2); color: #86efac; }
.dark .sd-release-metadata { border-color: #1e293b; }
.dark .sd-release-detail dt,
.dark .sd-release-backup,
.dark .sd-release-device { color: #94a3b8; }
.dark .sd-release-download { background: #f8fafc; color: #0f172a; }
.dark .sd-release-download:hover { background: #bfdbfe; }
.dark .sd-release-empty,
.dark .sd-release-load-error { border-color: #1e293b; color: #cbd5e1; }

@media (max-width: 640px) {
  .sd-release-library { margin-top: 4rem; }
  .sd-release-intro { align-items: flex-start; flex-direction: column; gap: 0.85rem; }
  .sd-release-card { padding: 1.1rem; }
  .sd-release-heading { flex-direction: column-reverse; gap: 0.75rem; }
  .sd-release-footer { align-items: stretch; flex-direction: column; }
  .sd-release-download { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sd-release-download { transition-duration: 0.001ms; }
}
