.update-gate {
  position: fixed;
  top: var(--titlebar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg, #ffffff);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text, #1a1a1a);
}

.update-gate.show {
  display: flex;
}

.update-card {
  width: min(520px, 100%);
  background: var(--panel, #ffffff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
  padding: 32px;
}

.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft, rgba(0, 0, 0, 0.06));
  color: var(--primary, #111111);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.update-title {
  margin: 16px 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #1a1a1a);
}

.update-desc {
  margin: 0 0 20px;
  color: var(--muted, #6b7280);
  line-height: 1.6;
  font-size: 14px;
}

.update-version-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.update-version-item {
  padding: 14px 16px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.update-version-item span {
  display: block;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 6px;
}

.update-version-item strong {
  font-size: 18px;
  color: var(--text, #1a1a1a);
}

.update-notice {
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.update-notice-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.update-notice-body {
  margin: 0;
  word-break: break-word;
  line-height: 1.7;
  color: var(--text, #1a1a1a);
  font-size: 14px;
}

.update-notice-body ul,
.update-notice-body ol {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.update-notice-body li {
  margin: 4px 0;
}

.update-notice-body a {
  color: var(--primary, #111111);
  text-decoration: underline;
}

.update-notice-body a:hover {
  color: var(--primary-hover, #2b2b2b);
}

.update-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.update-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.update-btn.primary {
  background: var(--primary, #111111);
  color: #ffffff;
}

.update-btn.primary:hover:not(:disabled) {
  background: var(--primary-hover, #2b2b2b);
}

.update-btn.ghost {
  background: transparent;
  color: var(--text, #1a1a1a);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
}

.update-btn.ghost:hover:not(:disabled) {
  background: #fafafa;
}

.update-btn.ghost.hidden {
  display: none;
}

.update-progress-wrap {
  margin-bottom: 20px;
}

.update-progress-wrap.hidden {
  display: none;
}

.update-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted, #6b7280);
}

.update-progress-meta strong {
  color: var(--text, #1a1a1a);
  font-variant-numeric: tabular-nums;
}

.update-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.update-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--primary, #111111);
  transition: width 0.2s ease;
}

.update-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 14px;
}

.update-line-wrap {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.update-line-wrap.hidden {
  display: none;
}

.update-line-wrap label {
  display: block;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 8px;
}

.update-line-wrap select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text, #1a1a1a);
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.update-line-wrap select:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.35);
}

.update-line-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #6b7280);
  line-height: 1.4;
}

.update-error.hidden,
.update-notice.hidden,
.update-version-row.hidden {
  display: none;
}
