.sync-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.sync-modal {
  background: var(--bg-surface);
  border-radius: 12px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sync-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sync-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.sync-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-light);
  padding: 0 4px;
}

.sync-modal-body {
  padding: 20px;
}

.sync-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.sync-tab {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.sync-tab:hover { background: rgba(0, 0, 0, 0.04); }
.sync-tab.active { background: var(--accent); color: white; }

.sync-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-light);
}

.sync-form input[type="text"],
.sync-form input[type="password"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-surface);
  color: var(--ink-dark);
}

.sync-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.sync-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.sync-checkbox input[type="checkbox"] { width: 16px; height: 16px; }

.sync-hint {
  font-size: 13px;
  color: var(--ink-light);
  margin-bottom: 4px;
}

.sync-hint a { color: var(--accent); }
.sync-hint code { font-size: 12px; }

.sync-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.sync-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sync-btn.primary { background: var(--accent); color: white; }
.sync-btn.primary:hover:not(:disabled) { opacity: 0.9; }
.sync-btn.secondary { background: rgba(0, 0, 0, 0.06); color: var(--ink-dark); }
.sync-btn.secondary:hover { background: rgba(0, 0, 0, 0.1); }

.sync-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes sync-spin {
  to { transform: rotate(360deg); }
}

.sync-success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #22c55e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 12px;
}

.sync-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 8px;
}

.sync-warning {
  background: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
}

.sync-warning a { color: var(--accent); }
