.updates-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  place-items: center;
  padding: clamp(12px, 4vw, 32px);
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.updates-overlay.open,
.updates-overlay[aria-hidden="false"] {
  display: grid;
  opacity: 1;
  pointer-events: auto;
}

.updates-panel {
  color: var(--fg);
  width: min(92vw, 900px);
  max-height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vh, 28px);
  padding: clamp(34px, 4vw, 56px);
  border: 3px solid rgba(255,255,255,0.96);
  border-radius: 18px;
  background: rgba(8, 20, 16, 0.55);
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  transform: translateY(6px) scale(0.985);
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
  opacity: 0.98;
}

.updates-overlay.open .updates-panel,
.updates-overlay[aria-hidden="false"] .updates-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.updates-panel:focus {
  outline: none;
}

.updates-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.updates-header h2 {
  margin: 0 0 clamp(6px, 1.2vh, 12px) 0;
  font-size: clamp(calc(18px * var(--ui-scale)), calc(1.6vw * var(--ui-scale)), calc(28px * var(--ui-scale)));
  letter-spacing: 0.3px;
}

.updates-subtitle {
  margin: 0;
  color: rgba(231, 242, 235, 0.76);
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.5;
  max-width: 72ch;
}

.updates-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(20px, 3vw, 42px);
  overflow: visible;
}

.updates-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(12px, 1.8vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 32, 24, 0.55);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  width: 100%;
  margin: 0 0 clamp(18px, 3vh, 28px);
}

.updates-status.updates-status-current {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.28);
  background: rgba(16, 40, 28, 0.6);
}

.updates-status-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
}

.updates-status-note {
  margin: 0;
  color: rgba(231, 242, 235, 0.82);
  line-height: 1.45;
  font-size: clamp(13px, 1.3vw, 16px);
}

.updates-version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  background: rgba(10, 28, 20, 0.6);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 600;
  letter-spacing: 0.4px;
}

.updates-version-label {
  text-transform: uppercase;
  opacity: 0.75;
}

.updates-highlights-title {
  margin: 4px 0 0;
  font-size: clamp(16px, 1.8vw, 20px);
}

.updates-highlights {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: clamp(13px, 1.3vw, 16px);
  color: rgba(231, 242, 235, 0.82);
}

.updates-highlights li {
  line-height: 1.4;
}

.updates-changelog,
.updates-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(12px, 1.8vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(12, 30, 24, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.updates-changelog-title,
.updates-details-title {
  margin: 0;
  font-size: clamp(20px, 2.3vw, 26px);
}

.updates-changelog-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.updates-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 24, 18, 0.55);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.updates-card:hover,
.updates-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(12, 32, 24, 0.65);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

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

.updates-card-current {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(16, 42, 30, 0.68);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.updates-card-current::before {
  content: attr(data-current-label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 2px 10px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(231, 242, 235, 0.85);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.updates-card-label {
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 600;
}

.updates-card-summary {
  color: rgba(231, 242, 235, 0.78);
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.4;
}

.updates-empty {
  margin: 6px 0 0;
  color: rgba(231, 242, 235, 0.6);
  font-size: clamp(13px, 1.3vw, 16px);
}

.updates-details[hidden] {
  display: none !important;
}

.updates-details-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.updates-details-summary {
  margin: 0;
  color: rgba(231, 242, 235, 0.8);
  line-height: 1.45;
  font-size: clamp(14px, 1.5vw, 18px);
}

.updates-details-features-title {
  margin: 4px 0 0;
  font-size: clamp(16px, 1.9vw, 20px);
}

.updates-details-features {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(13px, 1.4vw, 16px);
  color: rgba(231, 242, 235, 0.82);
}

.updates-details-features li {
  line-height: 1.45;
}

.updates-actions {
  display: flex;
  justify-content: flex-end;
  gap: clamp(12px, 1.5vw, 18px);
  margin-top: auto;
}

.updates-actions button {
  appearance: none;
  cursor: pointer;
  border: 3px solid rgba(255,255,255,0.96);
  background: transparent;
  color: var(--btn-text, var(--fg));
  padding: clamp(10px, 1.2vw, 16px) clamp(18px, 2.2vw, 28px);
  min-height: clamp(42px, 6vh, 60px);
  min-width: clamp(160px, 18vw, 240px);
  font-size: clamp(calc(16px * var(--ui-scale)), calc(1.2vw * var(--ui-scale)), calc(20px * var(--ui-scale)));
  letter-spacing: 0.2px;
  border-radius: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 120ms ease, filter 180ms ease, border-color 150ms ease, background-color 150ms ease;
}

.updates-actions button:hover,
.updates-actions button:focus-visible {
  filter: brightness(1.05);
  border-color: rgba(255,255,255,0.9);
}

.updates-actions button:active {
  transform: translateY(1px) scale(0.99);
}

.updates-actions button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.updates-actions button[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .updates-panel {
    max-height: none;
    height: 100%;
  }

  .updates-body {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .updates-overlay {
    transition: none;
  }
  .updates-panel {
    transition: none;
  }
  .updates-card,
  .updates-actions button {
    transition: none;
  }
}
