/* Desktop update controls stay quiet until a real native status is available. */
.desktop-update-widget {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  margin-inline-start: 4px;
}

.desktop-update-widget--compact .desktop-update-button {
  min-width: 26px;
  min-height: 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  color: var(--text-faint);
  white-space: nowrap;
}

.desktop-update-widget--compact .desktop-update-button > .icon { width: 15px; height: 15px; min-width: 15px; min-height: 15px; flex-basis: 15px; }
.desktop-update-widget[data-update-state="ready"] .desktop-update-button::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-primary); position: absolute; top: 3px; right: 3px;
}
.desktop-update-button { position: relative; }

.desktop-update-widget--compact .desktop-update-button:hover:not(:disabled),
.desktop-update-widget--compact .desktop-update-button:focus-visible:not(:disabled) {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.desktop-update-widget[data-update-state="unavailable"] .desktop-update-button,
.desktop-update-widget[data-update-state="failed"] .desktop-update-button {
  color: var(--text-faint);
}

.desktop-update-button-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-update-settings .setting-row {
  align-items: flex-start;
  padding-block: 14px;
}

.desktop-update-settings .setting-copy {
  min-width: 0;
}

.desktop-update-settings .setting-description[role="status"] {
  overflow-wrap: anywhere;
}

.desktop-update-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.desktop-update-settings .toggle-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  margin-inline-start: auto;
  cursor: pointer;
}

.desktop-update-settings .toggle-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--text-primary);
}

.desktop-update-settings .toggle-control input:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.desktop-update-settings .toggle-control-track {
  display: none;
}

@media (max-width: 600px) {
  .desktop-update-settings .setting-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .desktop-update-actions {
    width: 100%;
    margin-inline-start: 0;
  }

  .desktop-update-settings .toggle-control {
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-update-button { transition: none; }
}

.desktop-update-panel {
  position: fixed;
  z-index: var(--z-popover);
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 80px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: var(--shadow-menu);
  outline: none;
}
.desktop-update-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.desktop-update-panel-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.desktop-update-panel-heading .button { width: 28px; height: 28px; padding: 4px; }
.desktop-update-version, .desktop-update-background { margin: 8px 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-update-panel-status { margin: 14px 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-update-progress { display: block; width: 100%; height: 6px; accent-color: var(--text-primary); }
.desktop-update-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* Status actions can change while a theme/state update is being patched; keep their text and surface in a valid contrast pair. */
.desktop-update-panel .button { transition: none; }
.desktop-update-widget[data-update-state="available"] .desktop-update-button::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--text-primary); top: 3px; right: 3px; }

.desktop-update-panel:focus-visible { outline: 2px solid var(--text-secondary); outline-offset: 2px; }

.desktop-update-notes { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-update-notes summary { cursor: pointer; }
.desktop-update-notes p { white-space: pre-wrap; }

.desktop-update-diagnostic { font-size: 11px; overflow-wrap: anywhere; user-select: text; }
