.app-update-panel {
  grid-area: version;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.install-link[hidden],
.app-update-button[hidden],
.app-update-state[hidden] {
  display: none !important;
}

.app-version-badge,
.app-update-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.app-version-badge {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.app-update-state {
  background: #e9f8ef;
  color: #236b43;
}

.app-update-state[data-state="offline"] {
  background: #f0f1f5;
  color: var(--muted);
}

.app-update-state[data-state="checking"],
.app-update-state[data-state="downloading"] {
  background: #eef0ff;
  color: var(--accent-strong);
}

.app-update-state[data-state="error"] {
  background: #fff0f0;
  color: #a13a3a;
}

.app-update-button {
  grid-area: update;
  justify-self: start;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(90, 96, 234, 0.2);
}

.app-update-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.app-update-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 560px) {
  .top-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: auto;
  }

  .app-update-panel {
    margin-right: 0;
  }

  .app-version-badge,
  .app-update-state {
    min-height: 28px;
    padding: 0.22rem 0.48rem;
    font-size: 0.72rem;
  }

  .app-update-button {
    width: 100%;
    min-height: 34px;
    padding: 0.3rem 0.6rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  .app-update-state[data-state="latest"] {
    display: none;
  }
}
