.desktop-update-anchor {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

.desktop-update-anchor[hidden] {
  display: none;
}

.desktop-update-trigger {
  position: relative;
}

.desktop-update-trigger[data-update-state="available"]::after,
.desktop-update-trigger[data-update-state="ready"]::after,
.desktop-update-trigger[data-update-state="error"]::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 2px 6px rgba(74, 222, 128, 0.38);
}

.desktop-update-trigger[data-update-state="error"]::after {
  background: var(--danger);
  box-shadow: 0 2px 6px rgba(248, 113, 113, 0.34);
}

.desktop-update-panel {
  position: fixed;
  z-index: 1800;
  top: 42px;
  right: 58px;
  display: none;
  width: 388px;
  max-width: calc(100vw - 24px);
  padding: 0;
  color: var(--text-0);
  background: var(--bg-2);
  border: 1px solid rgba(65, 71, 85, 0.72);
  border-radius: 14px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.52);
  overflow: hidden;
  user-select: text;
}

.desktop-license-backdrop {
  position: fixed;
  z-index: 1799;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 10, .84);
  backdrop-filter: blur(5px) saturate(.72);
}

.desktop-license-backdrop[hidden] { display: none; }

.desktop-update-panel.is-open {
  display: flex;
  animation: desktop-update-enter 160ms cubic-bezier(.16, 1, .3, 1) both;
}

.desktop-update-panel.requires-activation {
  position: relative;
  top: auto;
  right: auto;
  width: 760px;
  max-width: 94%;
  min-height: 468px;
}

.desktop-update-panel.requires-activation.is-open {
  animation: desktop-license-enter 180ms cubic-bezier(.16, 1, .3, 1) both;
}

.desktop-update-panel [hidden] {
  display: none !important;
}

.desktop-license-identity {
  display: none;
}

.desktop-update-content {
  min-width: 0;
  padding: 20px;
}

.desktop-update-panel.requires-activation .desktop-license-identity {
  position: relative;
  display: flex;
  width: 270px;
  flex: 0 0 270px;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 30px;
  background: var(--bg-0);
  border-right: 1px solid rgba(65, 71, 85, .44);
  overflow: hidden;
}

.desktop-update-panel.requires-activation .desktop-license-identity::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  left: -78px;
  bottom: -92px;
  border-radius: 50%;
  background: rgba(163, 201, 255, .08);
  box-shadow: 88px -46px 100px rgba(74, 222, 128, .07);
  pointer-events: none;
}

.desktop-license-brand-mark {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 14px;
}

.desktop-license-identity-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.desktop-license-brand-name {
  color: var(--text-0);
  font-size: 17px;
  letter-spacing: .1em;
}

.desktop-license-product-name {
  max-width: 180px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

.desktop-update-panel.requires-activation .desktop-update-content {
  flex: 1 1 auto;
  padding: 34px 38px 30px;
}

@keyframes desktop-update-enter {
  from { opacity: .72; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes desktop-license-enter {
  from { opacity: .72; }
  to { opacity: 1; }
}

.desktop-update-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.desktop-update-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.requires-activation .desktop-update-title {
  max-width: 370px;
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.desktop-update-version,
.desktop-update-message,
.desktop-update-help {
  color: var(--text-2);
  line-height: 1.5;
}

.desktop-update-version {
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.desktop-update-message {
  margin: 16px 0 0;
  padding: 11px 12px;
  color: var(--text-1);
  background: rgba(139, 144, 160, 0.08);
  border-radius: 10px;
}

.requires-activation .desktop-update-message {
  margin-top: 20px;
  padding: 0;
  color: var(--text-1);
  background: transparent;
  font-size: 12px;
  line-height: 1.55;
}

.desktop-license-promise {
  display: flex;
  gap: 11px;
  margin-top: 18px;
  padding: 12px 13px;
  background: var(--bg-3);
  border-radius: 10px;
}

.desktop-license-proof-mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(74, 222, 128, .14);
}

.desktop-license-proof-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 6px;
  height: 3px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.desktop-license-promise div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desktop-license-promise strong { color: var(--text-0); font-size: 11px; }
.desktop-license-promise span:last-child { color: var(--text-2); line-height: 1.45; }

.desktop-license-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--text-2);
}

.desktop-license-divider span { height: 1px; flex: 1 1 auto; background: rgba(65, 71, 85, .58); }
.desktop-license-divider em { font-size: 10px; font-style: normal; white-space: nowrap; }

.desktop-update-message[data-tone="error"] {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.11);
}

.desktop-update-message[data-tone="success"] {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.1);
}

.desktop-update-token,
.desktop-update-channel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}

.desktop-update-token label,
.desktop-update-channel label {
  color: var(--text-1);
  font-size: 11px;
  font-weight: 700;
}

.desktop-update-token input,
.desktop-update-channel select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  color: var(--text-0);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  user-select: text;
}

.desktop-update-channel select {
  color-scheme: dark;
  cursor: pointer;
}

.desktop-update-channel select:disabled {
  cursor: default;
  opacity: .55;
}

.desktop-update-channel-help {
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.45;
}

.desktop-update-token input:focus-visible,
.desktop-update-channel select:focus-visible,
.desktop-update-action:focus-visible,
.desktop-update-link:focus-visible,
.desktop-update-trigger:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}

.desktop-update-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.desktop-update-action,
.desktop-update-link {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.desktop-update-action {
  color: #07121e;
  background: var(--primary);
  font-weight: 700;
  border: 1px solid transparent;
}

.desktop-update-action.secondary {
  color: var(--text-1);
  background: rgba(139, 144, 160, 0.12);
}

.desktop-update-action.signin {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: #07121e;
  background: var(--primary);
  border-color: var(--primary);
}

.desktop-update-panel.requires-activation .desktop-update-actions .desktop-update-action:first-child {
  width: 100%;
  color: var(--text-0);
  background: var(--bg-4);
  border-color: var(--line);
}

.desktop-license-signin {
  width: 100%;
  height: min(520px, calc(100vh - 220px));
  margin-top: 14px;
  background: #111;
  border: 0;
  border-radius: 10px;
}

.desktop-update-action.danger {
  margin-left: auto;
  color: #fecaca;
  background: transparent;
}

.desktop-update-action:hover { filter: brightness(1.08); }
.desktop-update-action:disabled { opacity: .45; cursor: default; filter: none; }

.desktop-update-help {
  margin-top: 16px;
  font-size: 10px;
}

.desktop-update-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 620px) {
  .desktop-update-panel { right: 12px; }
  .desktop-update-panel.requires-activation { width: 94%; min-height: 0; }
  .desktop-update-panel.requires-activation .desktop-license-identity { display: none; }
  .desktop-update-panel.requires-activation .desktop-update-content { padding: 24px; }
  .desktop-update-panel.requires-activation.is-open { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-update-panel.is-open { animation: none; }
}
